@@ -28,12 +28,12 @@ project(OpenTimelineIO VERSION ${OTIO_VERSION} LANGUAGES C CXX)
28
28
# Installation options
29
29
option (OTIO_CXX_INSTALL "Install the C++ bindings" ON )
30
30
option (OTIO_PYTHON_INSTALL "Install the Python bindings" OFF )
31
- option (OTIO_DEPENDENCIES_INSTALL "Install OTIO's C++ header dependencies (any and nonstd )" ON )
31
+ option (OTIO_DEPENDENCIES_INSTALL "Install OTIO's C++ header dependencies (Imath )" ON )
32
32
option (OTIO_INSTALL_PYTHON_MODULES "Install OTIO pure Python modules/files" ON )
33
33
option (OTIO_INSTALL_COMMANDLINE_TOOLS "Install the OTIO command line tools" ON )
34
34
option (OTIO_INSTALL_CONTRIB "Install the opentimelineio_contrib Python package" ON )
35
- set ( OTIO_IMATH_LIBS "" CACHE STRING "Imath library overrides to use instead of src/deps or find_package" )
36
- option (OTIO_FIND_IMATH "Find Imath using find_package, ignored if OTIO_IMATH_LIBS is set " OFF )
35
+ option ( OTIO_FIND_IMATH "Find Imath using find_package" OFF )
36
+ option (OTIO_FIND_RAPIDJSON "Find RapidJSON using find_package" OFF )
37
37
set (OTIO_PYTHON_INSTALL_DIR "" CACHE STRING "Python installation dir (such as the site-packages dir)" )
38
38
39
39
# Build options
@@ -118,16 +118,41 @@ else()
118
118
endif ()
119
119
endif ()
120
120
121
+ # Set the SO version. The SO version must be incremented every time a change
122
+ # occurs to the ABI that causes a backward incompatibility. Such changes
123
+ # include, exhaustively:
124
+ #
125
+ # * a change to struct or class layout
126
+ # * enum changes that would cause a renumbering of previously published enums
127
+ # * a removal of a struct, class, enumeration, or function
128
+ # * a change in parameters to a free standing function
129
+ # * a removal of a global variable
130
+ #
131
+ # OTIO currently designates the minor version number for breaking changes,
132
+ # e.g. v0.15, v0.16.0, v0.17.0, accordingly the SO version will be incremented
133
+ # to match. SO version must be monotically increasing, so the ABI version
134
+ # should be computed as: major * 100 + revision. The third digit will never
135
+ # implicate an ABI version change. So for example, the following OTIO versions
136
+ # would map to these ABI versions:
137
+ #
138
+ # * v0.18.0 - 18
139
+ # * v0.19.0 - 19
140
+ # * v0.19.1 - 19 # No ABI changes with minor version changes
141
+ # * v1.0.0 - 100
142
+ # * v1.1.0 - 101
143
+ #
144
+ math (EXPR OTIO_SOVERSION "${OTIO_VERSION_MAJOR} * 100 + ${OTIO_VERSION_MINOR} " )
145
+
121
146
set (OTIO_RESOLVED_CXX_INSTALL_DIR "${CMAKE_INSTALL_PREFIX} " )
122
147
123
148
if (OTIO_CXX_INSTALL )
124
149
message (STATUS "Installing C++ bindings to: ${OTIO_RESOLVED_CXX_INSTALL_DIR} " )
125
150
message (STATUS "Installing C++ dynamic libraries to: ${OTIO_RESOLVED_CXX_DYLIB_INSTALL_DIR} " )
126
151
127
152
if (OTIO_DEPENDENCIES_INSTALL )
128
- message (STATUS " Installing 'any' and 'nonstd' for C++ (OTIO_DEPENDENCIES_INSTALL=ON)" )
153
+ message (STATUS " Installing header dependencies for C++ (OTIO_DEPENDENCIES_INSTALL=ON)" )
129
154
else ()
130
- message (STATUS " Not installing any and nonstd for C++ (OTIO_DEPENDENCIES_INSTALL=OFF)" )
155
+ message (STATUS " Not installing header dependencies for C++ (OTIO_DEPENDENCIES_INSTALL=OFF)" )
131
156
endif ()
132
157
else ()
133
158
message (STATUS "Install C++ bindings: OFF" )
@@ -150,7 +175,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
150
175
set (CMAKE_CXX_EXTENSIONS OFF )
151
176
152
177
if (OTIO_CXX_COVERAGE AND NOT MSVC )
153
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage" )
178
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage -fprofile-update=atomic -fprofile-exclude-files='/usr/*;src/deps/*' " )
154
179
# this causes cmake to produce file.gcno instead of file.cpp.gcno
155
180
set (CMAKE_CXX_OUTPUT_EXTENSION_REPLACE 1 )
156
181
message (STATUS "Building C++ with Coverage: ON" )
@@ -217,47 +242,30 @@ set(CTEST_OUTPUT_ON_FAILURE ON)
217
242
# Build the dependencies and components
218
243
219
244
#----- Imath
220
- set (OTIO_RESOLVED_IMATH_LIBRARIES "" )
221
- if (NOT "${OTIO_IMATH_LIBS} " STREQUAL "" )
222
- message (STATUS "Using Imath from OTIO_MATH_LIBS: ${OTIO_IMATH_LIBS} " )
223
- set (OTIO_RESOLVED_IMATH_LIBRARIES "${OTIO_IMATH_LIBS} " )
224
- set (USE_DEPS_IMATH OFF )
225
- elseif (OTIO_FIND_IMATH )
226
- find_package (Imath QUIET )
245
+ if (OTIO_FIND_IMATH )
246
+ find_package (Imath REQUIRED )
227
247
if (Imath_FOUND )
228
248
message (STATUS "Found Imath 3 at ${Imath_CONFIG} " )
229
- set (USE_DEPS_IMATH OFF )
230
- else ()
231
- find_package (IlmBase QUIET )
232
- if (IlmBase_FOUND )
233
- message (STATUS "Imath 3 not found, found Imath 2 at ${IlmBase_CONFIG} " )
234
- message (STATUS "You may need to point to the Imath headers by setting IMATH_INCLUDES" )
235
- set (USE_DEPS_IMATH_OFF )
236
- set (OTIO_RESOLVED_IMATH_LIBRARIES "${IlmBase_LIBRARIES" )
237
- else ()
238
- message (STATUS "Imath 3 and 2 were not found, using src/deps/Imath" )
239
- set (USE_DEPS_IMATH ON )
240
- endif ()
241
249
endif ()
242
250
else ()
243
251
message (STATUS "Using src/deps/Imath by default" )
244
- set (USE_DEPS_IMATH ON )
252
+ include_directories ("${PROJECT_SOURCE_DIR} /src/deps/Imath/src" )
253
+ endif ()
254
+
255
+ #----- RapidJSON
256
+
257
+ if (OTIO_FIND_RAPIDJSON )
258
+ find_package (RapidJSON CONFIG REQUIRED )
259
+ if (RapidJSON_FOUND )
260
+ message (STATUS "Found RapidJSON at ${RapidJSON_CONFIG} " )
261
+ endif ()
262
+ else ()
263
+ message (STATUS "Using src/deps/rapidjson by default" )
245
264
endif ()
246
265
247
266
# set up the internally hosted dependencies
248
267
add_subdirectory (src/deps )
249
268
250
- set (OTIO_IMATH_TARGETS
251
- # For OpenEXR/Imath 3.x:
252
- $< TARGET_NAME_IF_EXISTS:Imath::Imath>
253
- $< TARGET_NAME_IF_EXISTS:Imath::Half>
254
- # For OpenEXR >= 2.4/2.5 with reliable exported targets
255
- $< TARGET_NAME_IF_EXISTS:IlmBase::Imath>
256
- $< TARGET_NAME_IF_EXISTS:IlmBase::Half>
257
- $< TARGET_NAME_IF_EXISTS:IlmBase::Iex>
258
- # For OpenEXR <= 2.3:
259
- ${ILMBASE_LIBRARIES} )
260
-
261
269
add_subdirectory (src/opentime )
262
270
add_subdirectory (src/opentimelineio )
263
271
@@ -272,4 +280,3 @@ endif()
272
280
if (OTIO_CXX_EXAMPLES )
273
281
add_subdirectory (examples )
274
282
endif ()
275
-
0 commit comments