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)
34
34
option (OTIO_INSTALL_CONTRIB "Install the opentimelineio_contrib Python package" ON )
35
35
set (OTIO_IMATH_LIBS "" CACHE STRING "Imath library overrides to use instead of src/deps or find_package" )
36
36
option (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 )
37
38
set (OTIO_PYTHON_INSTALL_DIR "" CACHE STRING "Python installation dir (such as the site-packages dir)" )
38
39
39
40
# Build options
@@ -240,6 +241,17 @@ if(USE_DEPS_IMATH)
240
241
include_directories ("${PROJECT_SOURCE_DIR} /src/deps/Imath/src" )
241
242
endif ()
242
243
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
+
243
255
# set up the internally hosted dependencies
244
256
add_subdirectory (src/deps )
245
257
Original file line number Diff line number Diff line change 4
4
#----- Other dependencies
5
5
6
6
# 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
+
8
13
foreach (submodule IN LISTS DEPS_SUBMODULES )
9
14
file (GLOB SUBMOD_CONTENTS ${submodule} )
10
15
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}
78
78
add_library (OTIO::opentimelineio ALIAS opentimelineio )
79
79
80
80
target_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 ()
84
90
85
91
86
92
target_link_libraries (opentimelineio
You can’t perform that action at this time.
0 commit comments