Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ option(OTIO_INSTALL_COMMANDLINE_TOOLS "Install the OTIO command line tools" ON)
option(OTIO_INSTALL_CONTRIB "Install the opentimelineio_contrib Python package" ON)
set(OTIO_IMATH_LIBS "" CACHE STRING "Imath library overrides to use instead of src/deps or find_package")
option(OTIO_FIND_IMATH "Find Imath using find_package, ignored if OTIO_IMATH_LIBS is set" OFF)
option(OTIO_FIND_RAPIDJSON "Find RapidJSON using find_package" OFF)
set(OTIO_PYTHON_INSTALL_DIR "" CACHE STRING "Python installation dir (such as the site-packages dir)")

# Build options
Expand Down Expand Up @@ -240,6 +241,17 @@ if(USE_DEPS_IMATH)
include_directories("${PROJECT_SOURCE_DIR}/src/deps/Imath/src")
endif()

#----- RapidJSON

if(OTIO_FIND_RAPIDJSON)
find_package(RapidJSON CONFIG REQUIRED)
if (RapidJSON_FOUND)
message(STATUS "Found RapidJSON at ${RapidJSON_CONFIG}")
endif()
else()
message(STATUS "Using src/deps/rapidjson by default")
endif()

# set up the internally hosted dependencies
add_subdirectory(src/deps)

Expand Down
7 changes: 6 additions & 1 deletion src/deps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@
#----- Other dependencies

# detect if the submodules haven't been updated
set(DEPS_SUBMODULES pybind11 rapidjson)
set(DEPS_SUBMODULES pybind11)

if(NOT OTIO_FIND_RAPIDJSON)
set(DEPS_SUBMODULES ${DEPS_SUBMODULES} rapidjson)
endif()

foreach(submodule IN LISTS DEPS_SUBMODULES)
file(GLOB SUBMOD_CONTENTS ${submodule})
list(LENGTH SUBMOD_CONTENTS SUBMOD_CONTENT_LEN)
Expand Down
12 changes: 9 additions & 3 deletions src/opentimelineio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,15 @@ add_library(opentimelineio ${OTIO_SHARED_OR_STATIC_LIB}
add_library(OTIO::opentimelineio ALIAS opentimelineio)

target_include_directories(opentimelineio
PRIVATE "${PROJECT_SOURCE_DIR}/src"
"${PROJECT_SOURCE_DIR}/src/deps"
"${PROJECT_SOURCE_DIR}/src/deps/rapidjson/include")
PRIVATE "${PROJECT_SOURCE_DIR}/src")

if(OTIO_FIND_RAPIDJSON)
target_include_directories(opentimelineio
PRIVATE "${RapidJSON_INCLUDE_DIRS}")
else()
target_include_directories(opentimelineio
PRIVATE "${PROJECT_SOURCE_DIR}/src/deps/rapidjson/include")
endif()


target_link_libraries(opentimelineio
Expand Down
Loading