diff --git a/CMakeLists.txt b/CMakeLists.txt index c3c6958bed..333bd6087e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -228,36 +228,21 @@ elseif(OTIO_FIND_IMATH) message(STATUS "Found Imath 3 at ${Imath_CONFIG}") set(USE_DEPS_IMATH OFF) else() - find_package(IlmBase QUIET) - if (IlmBase_FOUND) - message(STATUS "Imath 3 not found, found Imath 2 at ${IlmBase_CONFIG}") - message(STATUS "You may need to point to the Imath headers by setting IMATH_INCLUDES") - set(USE_DEPS_IMATH_OFF) - set(OTIO_RESOLVED_IMATH_LIBRARIES "${IlmBase_LIBRARIES") - else() - message(STATUS "Imath 3 and 2 were not found, using src/deps/Imath") - set(USE_DEPS_IMATH ON) - endif() + message(STATUS "Imath 3 was not found, using src/deps/Imath") + set(USE_DEPS_IMATH ON) endif() else() message(STATUS "Using src/deps/Imath by default") set(USE_DEPS_IMATH ON) endif() +if(USE_DEPS_IMATH) + include_directories("${PROJECT_SOURCE_DIR}/src/deps/Imath/src") +endif() + # set up the internally hosted dependencies add_subdirectory(src/deps) -set (OTIO_IMATH_TARGETS - # For OpenEXR/Imath 3.x: - $ - $ - # For OpenEXR >= 2.4/2.5 with reliable exported targets - $ - $ - $ - # For OpenEXR <= 2.3: - ${ILMBASE_LIBRARIES}) - add_subdirectory(src/opentime) add_subdirectory(src/opentimelineio) @@ -272,4 +257,3 @@ endif() if(OTIO_CXX_EXAMPLES) add_subdirectory(examples) endif() - diff --git a/src/opentimelineio/CMakeLists.txt b/src/opentimelineio/CMakeLists.txt index 4b08e6d96f..7ccdd3b684 100644 --- a/src/opentimelineio/CMakeLists.txt +++ b/src/opentimelineio/CMakeLists.txt @@ -78,14 +78,13 @@ add_library(opentimelineio ${OTIO_SHARED_OR_STATIC_LIB} add_library(OTIO::opentimelineio ALIAS opentimelineio) target_include_directories(opentimelineio - PRIVATE "${IMATH_INCLUDES}" - "${PROJECT_SOURCE_DIR}/src" + PRIVATE "${PROJECT_SOURCE_DIR}/src" "${PROJECT_SOURCE_DIR}/src/deps" - "${PROJECT_SOURCE_DIR}/src/deps/rapidjson/include" - "${IMATH_INCLUDES}") + "${PROJECT_SOURCE_DIR}/src/deps/rapidjson/include") + target_link_libraries(opentimelineio - PUBLIC opentime ${OTIO_IMATH_TARGETS}) + PUBLIC opentime Imath::Imath) set_target_properties(opentimelineio PROPERTIES DEBUG_POSTFIX "${OTIO_DEBUG_POSTFIX}" diff --git a/src/opentimelineio/OpenTimelineIOConfig.cmake.in b/src/opentimelineio/OpenTimelineIOConfig.cmake.in index f735b36669..355f8ea952 100644 --- a/src/opentimelineio/OpenTimelineIOConfig.cmake.in +++ b/src/opentimelineio/OpenTimelineIOConfig.cmake.in @@ -2,5 +2,6 @@ include(CMakeFindDependencyMacro) find_dependency(OpenTime) +find_dependency(Imath) include("${CMAKE_CURRENT_LIST_DIR}/OpenTimelineIOTargets.cmake") diff --git a/src/opentimelineio/composable.h b/src/opentimelineio/composable.h index d2691ff097..4f6385634b 100644 --- a/src/opentimelineio/composable.h +++ b/src/opentimelineio/composable.h @@ -6,7 +6,7 @@ #include "opentimelineio/serializableObjectWithMetadata.h" #include "opentimelineio/version.h" -#include +#include namespace opentimelineio { namespace OPENTIMELINEIO_VERSION { diff --git a/src/opentimelineio/mediaReference.h b/src/opentimelineio/mediaReference.h index f7fde5a32a..63fa70c0a6 100644 --- a/src/opentimelineio/mediaReference.h +++ b/src/opentimelineio/mediaReference.h @@ -6,7 +6,7 @@ #include "opentimelineio/serializableObjectWithMetadata.h" #include "opentimelineio/version.h" -#include +#include namespace opentimelineio { namespace OPENTIMELINEIO_VERSION { diff --git a/src/opentimelineio/serializableObject.h b/src/opentimelineio/serializableObject.h index a0ba2892a7..7f0dc8dcb3 100644 --- a/src/opentimelineio/serializableObject.h +++ b/src/opentimelineio/serializableObject.h @@ -12,7 +12,7 @@ #include "opentimelineio/typeRegistry.h" #include "opentimelineio/version.h" -#include "ImathBox.h" +#include "Imath/ImathBox.h" #include "serialization.h" #include diff --git a/src/py-opentimelineio/opentimelineio-bindings/otio_bindings.cpp b/src/py-opentimelineio/opentimelineio-bindings/otio_bindings.cpp index ffa2da8c1e..3dfa67f3b3 100644 --- a/src/py-opentimelineio/opentimelineio-bindings/otio_bindings.cpp +++ b/src/py-opentimelineio/opentimelineio-bindings/otio_bindings.cpp @@ -14,7 +14,7 @@ #include "opentimelineio/typeRegistry.h" #include "opentimelineio/stackAlgorithm.h" -#include +#include namespace py = pybind11; using namespace pybind11::literals; diff --git a/src/py-opentimelineio/opentimelineio-bindings/otio_imath.cpp b/src/py-opentimelineio/opentimelineio-bindings/otio_imath.cpp index 540025a550..4cd5df28b5 100644 --- a/src/py-opentimelineio/opentimelineio-bindings/otio_imath.cpp +++ b/src/py-opentimelineio/opentimelineio-bindings/otio_imath.cpp @@ -6,8 +6,8 @@ #include "otio_utils.h" -#include "ImathBox.h" -#include "ImathVec.h" +#include "Imath/ImathBox.h" +#include "Imath/ImathVec.h" namespace py = pybind11; diff --git a/src/py-opentimelineio/opentimelineio-bindings/otio_serializableObjects.cpp b/src/py-opentimelineio/opentimelineio-bindings/otio_serializableObjects.cpp index 5be092c3a9..0b91a1641d 100644 --- a/src/py-opentimelineio/opentimelineio-bindings/otio_serializableObjects.cpp +++ b/src/py-opentimelineio/opentimelineio-bindings/otio_serializableObjects.cpp @@ -32,7 +32,7 @@ #include "otio_utils.h" #include "otio_anyDictionary.h" -#include "ImathBox.h" +#include "Imath/ImathBox.h" namespace py = pybind11; using namespace pybind11::literals; diff --git a/src/py-opentimelineio/opentimelineio-bindings/otio_utils.cpp b/src/py-opentimelineio/opentimelineio-bindings/otio_utils.cpp index 5ad4206f3c..2b1d5229c3 100644 --- a/src/py-opentimelineio/opentimelineio-bindings/otio_utils.cpp +++ b/src/py-opentimelineio/opentimelineio-bindings/otio_utils.cpp @@ -11,7 +11,7 @@ #include "opentimelineio/safely_typed_any.h" #include "opentimelineio/stringUtils.h" -#include +#include #include #include diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 85cb216f86..a17de5c8e8 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -20,9 +20,6 @@ foreach(test ${tests_opentimelineio}) add_executable(${test} utils.h utils.cpp ${test}.cpp) target_link_libraries(${test} opentimelineio) - if (NOT "${IMATH_INCLUDES}" STREQUAL "") - target_include_directories(${test} "${IMATH_INCLUDES}") - endif() set_target_properties(${test} PROPERTIES FOLDER tests) add_test(NAME ${test} COMMAND ${test}