@@ -28,12 +28,12 @@ project(OpenTimelineIO VERSION ${OTIO_VERSION} LANGUAGES C CXX)
2828# Installation options
2929option (OTIO_CXX_INSTALL "Install the C++ bindings" ON )
3030option (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 )
3232option (OTIO_INSTALL_PYTHON_MODULES "Install OTIO pure Python modules/files" ON )
3333option (OTIO_INSTALL_COMMANDLINE_TOOLS "Install the OTIO command line tools" ON )
3434option (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 )
3737set (OTIO_PYTHON_INSTALL_DIR "" CACHE STRING "Python installation dir (such as the site-packages dir)" )
3838
3939# Build options
@@ -118,16 +118,41 @@ else()
118118 endif ()
119119endif ()
120120
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+
121146set (OTIO_RESOLVED_CXX_INSTALL_DIR "${CMAKE_INSTALL_PREFIX} " )
122147
123148if (OTIO_CXX_INSTALL)
124149 message (STATUS "Installing C++ bindings to: ${OTIO_RESOLVED_CXX_INSTALL_DIR} " )
125150 message (STATUS "Installing C++ dynamic libraries to: ${OTIO_RESOLVED_CXX_DYLIB_INSTALL_DIR} " )
126151
127152 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)" )
129154 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)" )
131156 endif ()
132157else ()
133158 message (STATUS "Install C++ bindings: OFF" )
@@ -150,7 +175,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
150175set (CMAKE_CXX_EXTENSIONS OFF )
151176
152177if (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/*' " )
154179 # this causes cmake to produce file.gcno instead of file.cpp.gcno
155180 set (CMAKE_CXX_OUTPUT_EXTENSION_REPLACE 1)
156181 message (STATUS "Building C++ with Coverage: ON" )
@@ -217,47 +242,30 @@ set(CTEST_OUTPUT_ON_FAILURE ON)
217242# Build the dependencies and components
218243
219244#----- 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)
227247 if (Imath_FOUND)
228248 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 ()
241249 endif ()
242250else ()
243251 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" )
245264endif ()
246265
247266# set up the internally hosted dependencies
248267add_subdirectory (src/deps)
249268
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-
261269add_subdirectory (src/opentime)
262270add_subdirectory (src/opentimelineio)
263271
@@ -272,4 +280,3 @@ endif()
272280if (OTIO_CXX_EXAMPLES)
273281 add_subdirectory (examples)
274282endif ()
275-
0 commit comments