@@ -34,6 +34,7 @@ option(OTIO_INSTALL_COMMANDLINE_TOOLS "Install the OTIO command line tools" ON)
3434option (OTIO_INSTALL_CONTRIB "Install the opentimelineio_contrib Python package" ON )
3535set (OTIO_IMATH_LIBS "" CACHE STRING "Imath library overrides to use instead of src/deps or find_package" )
3636option (OTIO_FIND_IMATH "Find Imath using find_package, ignored if OTIO_IMATH_LIBS is set" OFF )
37+ option (OTIO_FIND_RAPIDJSON "Find RapidJSON using find_package" OFF )
3738set (OTIO_PYTHON_INSTALL_DIR "" CACHE STRING "Python installation dir (such as the site-packages dir)" )
3839
3940# Build options
@@ -118,6 +119,31 @@ else()
118119 endif ()
119120endif ()
120121
122+ # Set the SO version. The SO version must be incremented every time a change
123+ # occurs to the ABI that causes a backward incompatibility. Such changes
124+ # include, exhaustively:
125+ #
126+ # * a change to struct or class layout
127+ # * enum changes that would cause a renumbering of previously published enums
128+ # * a removal of a struct, class, enumeration, or function
129+ # * a change in parameters to a free standing function
130+ # * a removal of a global variable
131+ #
132+ # OTIO currently designates the minor version number for breaking changes,
133+ # e.g. v0.15, v0.16.0, v0.17.0, accordingly the SO version will be incremented
134+ # to match. SO version must be monotically increasing, so the ABI version
135+ # should be computed as: major * 100 + revision. The third digit will never
136+ # implicate an ABI version change. So for example, the following OTIO versions
137+ # would map to these ABI versions:
138+ #
139+ # * v0.18.0 - 18
140+ # * v0.19.0 - 19
141+ # * v0.19.1 - 19 # No ABI changes with minor version changes
142+ # * v1.0.0 - 100
143+ # * v1.1.0 - 101
144+ #
145+ math (EXPR OTIO_SOVERSION "${OTIO_VERSION_MAJOR} * 100 + ${OTIO_VERSION_MINOR} " )
146+
121147set (OTIO_RESOLVED_CXX_INSTALL_DIR "${CMAKE_INSTALL_PREFIX} " )
122148
123149if (OTIO_CXX_INSTALL)
@@ -223,13 +249,10 @@ if (NOT "${OTIO_IMATH_LIBS}" STREQUAL "")
223249 set (OTIO_RESOLVED_IMATH_LIBRARIES "${OTIO_IMATH_LIBS} " )
224250 set (USE_DEPS_IMATH OFF )
225251elseif (OTIO_FIND_IMATH)
226- find_package (Imath QUIET )
252+ set (USE_DEPS_IMATH OFF )
253+ find_package (Imath REQUIRED)
227254 if (Imath_FOUND)
228255 message (STATUS "Found Imath 3 at ${Imath_CONFIG} " )
229- set (USE_DEPS_IMATH OFF )
230- else ()
231- message (STATUS "Imath 3 was not found, using src/deps/Imath" )
232- set (USE_DEPS_IMATH ON )
233256 endif ()
234257else ()
235258 message (STATUS "Using src/deps/Imath by default" )
@@ -240,6 +263,17 @@ if(USE_DEPS_IMATH)
240263 include_directories ("${PROJECT_SOURCE_DIR} /src/deps/Imath/src" )
241264endif ()
242265
266+ #----- RapidJSON
267+
268+ if (OTIO_FIND_RAPIDJSON)
269+ find_package (RapidJSON CONFIG REQUIRED)
270+ if (RapidJSON_FOUND)
271+ message (STATUS "Found RapidJSON at ${RapidJSON_CONFIG} " )
272+ endif ()
273+ else ()
274+ message (STATUS "Using src/deps/rapidjson by default" )
275+ endif ()
276+
243277# set up the internally hosted dependencies
244278add_subdirectory (src/deps)
245279
0 commit comments