From 646cc1faa73ffc36a999b4d6c9306e36f16c5d13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20K=C3=BCnzel?= Date: Sun, 9 Mar 2025 12:01:27 +0100 Subject: [PATCH 1/4] Drop support for Imath 2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Künzel --- CMakeLists.txt | 24 ++---------------------- src/opentimelineio/CMakeLists.txt | 8 +++----- tests/CMakeLists.txt | 3 --- 3 files changed, 5 insertions(+), 30 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c3c6958bed..8229f14e95 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -228,16 +228,8 @@ 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") @@ -247,17 +239,6 @@ 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 +253,3 @@ endif() if(OTIO_CXX_EXAMPLES) add_subdirectory(examples) endif() - diff --git a/src/opentimelineio/CMakeLists.txt b/src/opentimelineio/CMakeLists.txt index 4b08e6d96f..746e73237d 100644 --- a/src/opentimelineio/CMakeLists.txt +++ b/src/opentimelineio/CMakeLists.txt @@ -78,14 +78,12 @@ 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/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} From f13ca4ccec651fd84bbb2c00a40a3cd7a4a3ef2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20K=C3=BCnzel?= Date: Sun, 9 Mar 2025 12:04:55 +0100 Subject: [PATCH 2/4] Port Imath includes to Imath/*.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As suggested by Imath devs, see https://github.com/AcademySoftwareFoundation/Imath/issues/136#issuecomment-812671628 This is possible now that Imath 2 support was dropped Signed-off-by: Julius Künzel --- src/opentimelineio/CMakeLists.txt | 4 ++++ src/opentimelineio/composable.h | 2 +- src/opentimelineio/mediaReference.h | 2 +- src/opentimelineio/serializableObject.h | 2 +- src/py-opentimelineio/opentimelineio-bindings/CMakeLists.txt | 4 ++++ .../opentimelineio-bindings/otio_bindings.cpp | 2 +- src/py-opentimelineio/opentimelineio-bindings/otio_imath.cpp | 4 ++-- .../opentimelineio-bindings/otio_serializableObjects.cpp | 2 +- src/py-opentimelineio/opentimelineio-bindings/otio_utils.cpp | 2 +- tests/CMakeLists.txt | 4 ++++ 10 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/opentimelineio/CMakeLists.txt b/src/opentimelineio/CMakeLists.txt index 746e73237d..01e3fe88bf 100644 --- a/src/opentimelineio/CMakeLists.txt +++ b/src/opentimelineio/CMakeLists.txt @@ -82,6 +82,10 @@ target_include_directories(opentimelineio "${PROJECT_SOURCE_DIR}/src/deps" "${PROJECT_SOURCE_DIR}/src/deps/rapidjson/include") +if(USE_DEPS_IMATH) + target_include_directories(opentimelineio PRIVATE "${PROJECT_SOURCE_DIR}/src/deps/Imath/src") +endif() + target_link_libraries(opentimelineio PUBLIC opentime Imath::Imath) 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/CMakeLists.txt b/src/py-opentimelineio/opentimelineio-bindings/CMakeLists.txt index d37da3629f..b1c2b02e7e 100644 --- a/src/py-opentimelineio/opentimelineio-bindings/CMakeLists.txt +++ b/src/py-opentimelineio/opentimelineio-bindings/CMakeLists.txt @@ -25,6 +25,10 @@ target_include_directories(_otio PRIVATE "${PROJECT_SOURCE_DIR}/src/deps/optional-lite/include" ) +if(USE_DEPS_IMATH) + target_include_directories(_otio PRIVATE "${PROJECT_SOURCE_DIR}/src/deps/Imath/src") +endif() + target_link_libraries(_otio PUBLIC opentimelineio opentime) # The version of pybind11 we are currently using generates an overwhelming number of 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 a17de5c8e8..819c1a43cf 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -3,6 +3,10 @@ include_directories(${PROJECT_SOURCE_DIR}/src ${PROJECT_SOURCE_DIR}/src/deps/optional-lite/include ${PROJECT_SOURCE_DIR}/src/tests) +if(USE_DEPS_IMATH) + include_directories(${PROJECT_SOURCE_DIR}/src/deps/Imath/src) +endif() + list(APPEND tests_opentime test_opentime) foreach(test ${tests_opentime}) add_executable(${test} utils.h utils.cpp ${test}.cpp) From 224a48a7fa5f1ceed82c4223be5f61280b28d2d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20K=C3=BCnzel?= Date: Sun, 9 Mar 2025 12:06:19 +0100 Subject: [PATCH 3/4] Add find_dependency call for Imath to *Config.cmake MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will make it easier for downstream users Signed-off-by: Julius Künzel --- src/opentimelineio/OpenTimelineIOConfig.cmake.in | 1 + 1 file changed, 1 insertion(+) 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") From 72d07650ca3ced1a39f3838a7ef1df07285db5dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20K=C3=BCnzel?= Date: Tue, 18 Mar 2025 09:06:19 +0100 Subject: [PATCH 4/4] Use global include_directories for internal Imath MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Künzel --- CMakeLists.txt | 4 ++++ src/opentimelineio/CMakeLists.txt | 3 --- src/py-opentimelineio/opentimelineio-bindings/CMakeLists.txt | 4 ---- tests/CMakeLists.txt | 4 ---- 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8229f14e95..333bd6087e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -236,6 +236,10 @@ else() 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) diff --git a/src/opentimelineio/CMakeLists.txt b/src/opentimelineio/CMakeLists.txt index 01e3fe88bf..7ccdd3b684 100644 --- a/src/opentimelineio/CMakeLists.txt +++ b/src/opentimelineio/CMakeLists.txt @@ -82,9 +82,6 @@ target_include_directories(opentimelineio "${PROJECT_SOURCE_DIR}/src/deps" "${PROJECT_SOURCE_DIR}/src/deps/rapidjson/include") -if(USE_DEPS_IMATH) - target_include_directories(opentimelineio PRIVATE "${PROJECT_SOURCE_DIR}/src/deps/Imath/src") -endif() target_link_libraries(opentimelineio PUBLIC opentime Imath::Imath) diff --git a/src/py-opentimelineio/opentimelineio-bindings/CMakeLists.txt b/src/py-opentimelineio/opentimelineio-bindings/CMakeLists.txt index b1c2b02e7e..d37da3629f 100644 --- a/src/py-opentimelineio/opentimelineio-bindings/CMakeLists.txt +++ b/src/py-opentimelineio/opentimelineio-bindings/CMakeLists.txt @@ -25,10 +25,6 @@ target_include_directories(_otio PRIVATE "${PROJECT_SOURCE_DIR}/src/deps/optional-lite/include" ) -if(USE_DEPS_IMATH) - target_include_directories(_otio PRIVATE "${PROJECT_SOURCE_DIR}/src/deps/Imath/src") -endif() - target_link_libraries(_otio PUBLIC opentimelineio opentime) # The version of pybind11 we are currently using generates an overwhelming number of diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 819c1a43cf..a17de5c8e8 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -3,10 +3,6 @@ include_directories(${PROJECT_SOURCE_DIR}/src ${PROJECT_SOURCE_DIR}/src/deps/optional-lite/include ${PROJECT_SOURCE_DIR}/src/tests) -if(USE_DEPS_IMATH) - include_directories(${PROJECT_SOURCE_DIR}/src/deps/Imath/src) -endif() - list(APPEND tests_opentime test_opentime) foreach(test ${tests_opentime}) add_executable(${test} utils.h utils.cpp ${test}.cpp)