File tree Expand file tree Collapse file tree 3 files changed +27
-4
lines changed
Expand file tree Collapse file tree 3 files changed +27
-4
lines changed Original file line number Diff line number Diff line change @@ -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
@@ -240,6 +241,17 @@ if(USE_DEPS_IMATH)
240241 include_directories ("${PROJECT_SOURCE_DIR} /src/deps/Imath/src" )
241242endif ()
242243
244+ #----- RapidJSON
245+
246+ if (OTIO_FIND_RAPIDJSON)
247+ find_package (RapidJSON CONFIG REQUIRED)
248+ if (RapidJSON_FOUND)
249+ message (STATUS "Found RapidJSON at ${RapidJSON_CONFIG} " )
250+ endif ()
251+ else ()
252+ message (STATUS "Using src/deps/rapidjson by default" )
253+ endif ()
254+
243255# set up the internally hosted dependencies
244256add_subdirectory (src/deps)
245257
Original file line number Diff line number Diff line change 44#----- Other dependencies
55
66# detect if the submodules haven't been updated
7- set (DEPS_SUBMODULES pybind11 rapidjson)
7+ set (DEPS_SUBMODULES pybind11)
8+
9+ if (NOT OTIO_FIND_RAPIDJSON)
10+ set (DEPS_SUBMODULES ${DEPS_SUBMODULES} rapidjson)
11+ endif ()
12+
813foreach (submodule IN LISTS DEPS_SUBMODULES)
914 file (GLOB SUBMOD_CONTENTS ${submodule} )
1015 list (LENGTH SUBMOD_CONTENTS SUBMOD_CONTENT_LEN)
Original file line number Diff line number Diff line change @@ -78,9 +78,15 @@ add_library(opentimelineio ${OTIO_SHARED_OR_STATIC_LIB}
7878add_library (OTIO::opentimelineio ALIAS opentimelineio)
7979
8080target_include_directories (opentimelineio
81- PRIVATE "${PROJECT_SOURCE_DIR} /src"
82- "${PROJECT_SOURCE_DIR} /src/deps"
83- "${PROJECT_SOURCE_DIR} /src/deps/rapidjson/include" )
81+ PRIVATE "${PROJECT_SOURCE_DIR} /src" )
82+
83+ if (OTIO_FIND_RAPIDJSON)
84+ target_include_directories (opentimelineio
85+ PRIVATE "${RapidJSON_INCLUDE_DIRS} " )
86+ else ()
87+ target_include_directories (opentimelineio
88+ PRIVATE "${PROJECT_SOURCE_DIR} /src/deps/rapidjson/include" )
89+ endif ()
8490
8591
8692target_link_libraries (opentimelineio
You can’t perform that action at this time.
0 commit comments