Skip to content

OTIO installs CMake files in unexpected location #2008

@jfpanisset

Description

@jfpanisset

As per CMake documentation and examples from most other projects, the typical location for installing project CMake files is:

/usr/local/lib/cmake/<project_name>/

In OTIO 0.18.1, src/{opentime,opentimelineio}/CMakeLists.txt has:

    install(EXPORT OpenTimeTargets
            DESTINATION "${OTIO_RESOLVED_CXX_INSTALL_DIR}/share/opentime"
            NAMESPACE OTIO:: )

which lands the project .cmake files in:

# ls /usr/local/share/opentime/
OpenTimeConfig.cmake  OpenTimeTargets-noconfig.cmake  OpenTimeTargets-release.cmake  OpenTimeTargets.cmake
# ls /usr/local/share/opentimelineio/
OpenTimelineIOConfig.cmake  OpenTimelineIOTargets-noconfig.cmake  OpenTimelineIOTargets-release.cmake  OpenTimelineIOTargets.cmake

As per issue #2007 it can be argued that installation of C++ and Python components could be separated and thus we should use the guidance from the CMake documentation:

DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/opentime

and

DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/opentimelineio

to always install the CMake files in the expected location, but for now I'm suggesting the following patch which has the same result and installs the .cmake files in:

# ls /usr/local/lib/cmake/opentime
OpenTimeConfig.cmake  OpenTimeTargets-noconfig.cmake  OpenTimeTargets.cmake
# ls /usr/local/lib/cmake/opentimelineio
OpenTimelineIOConfig.cmake  OpenTimelineIOTargets-noconfig.cmake  OpenTimelineIOTargets.cmake

If this seems appropriate, I can submit this as a PR.

diff --git src/opentime/CMakeLists.txt src/opentime/CMakeLists.txt
index d99dd79ac..bfda2778a 100644
--- src/opentime/CMakeLists.txt
+++ src/opentime/CMakeLists.txt
@@ -73,7 +73,7 @@
             RUNTIME DESTINATION "${OTIO_RESOLVED_CXX_DYLIB_INSTALL_DIR}")

     install(EXPORT OpenTimeTargets
-            DESTINATION "${OTIO_RESOLVED_CXX_INSTALL_DIR}/share/opentime"
+            DESTINATION "${OTIO_RESOLVED_CXX_INSTALL_DIR}/lib/cmake/opentime"
             NAMESPACE OTIO:: )

     include(CMakePackageConfigHelpers)
@@ -81,7 +81,7 @@
         ${CMAKE_CURRENT_SOURCE_DIR}/OpenTimeConfig.cmake.in
         ${CMAKE_CURRENT_BINARY_DIR}/OpenTimeConfig.cmake
         INSTALL_DESTINATION
-            ${OTIO_RESOLVED_CXX_INSTALL_DIR}/share/opentime
+            ${OTIO_RESOLVED_CXX_INSTALL_DIR}/lib/cmake/opentime
         NO_SET_AND_CHECK_MACRO
         NO_CHECK_REQUIRED_COMPONENTS_MACRO
     )
@@ -90,7 +90,7 @@
         FILES
             ${CMAKE_CURRENT_BINARY_DIR}/OpenTimeConfig.cmake
         DESTINATION
-            ${OTIO_RESOLVED_CXX_INSTALL_DIR}/share/opentime
+            ${OTIO_RESOLVED_CXX_INSTALL_DIR}/lib/cmake/opentime
     )

     install(
diff --git src/opentimelineio/CMakeLists.txt src/opentimelineio/CMakeLists.txt
index d99dd79ac..bfda2778a 100644
--- src/opentimelineio/CMakeLists.txt
+++ src/opentimelineio/CMakeLists.txt
@@ -151,7 +151,7 @@
            RUNTIME DESTINATION "${OTIO_RESOLVED_CXX_DYLIB_INSTALL_DIR}")

     install(EXPORT OpenTimelineIOTargets
-           DESTINATION "${OTIO_RESOLVED_CXX_INSTALL_DIR}/share/opentimelineio"
+           DESTINATION "${OTIO_RESOLVED_CXX_INSTALL_DIR}/lib/cmake/opentimelineio"
            NAMESPACE OTIO:: )

     include(CMakePackageConfigHelpers)
@@ -159,7 +159,7 @@
         ${CMAKE_CURRENT_SOURCE_DIR}/OpenTimelineIOConfig.cmake.in
         ${CMAKE_CURRENT_BINARY_DIR}/OpenTimelineIOConfig.cmake
         INSTALL_DESTINATION
-            ${OTIO_RESOLVED_CXX_INSTALL_DIR}/share/opentimelineio
+            ${OTIO_RESOLVED_CXX_INSTALL_DIR}/lib/cmake/opentimelineio
         NO_SET_AND_CHECK_MACRO
         NO_CHECK_REQUIRED_COMPONENTS_MACRO
     )
@@ -168,7 +168,7 @@
         FILES
             ${CMAKE_CURRENT_BINARY_DIR}/OpenTimelineIOConfig.cmake
         DESTINATION
-            ${OTIO_RESOLVED_CXX_INSTALL_DIR}/share/opentimelineio
+            ${OTIO_RESOLVED_CXX_INSTALL_DIR}/lib/cmake/opentimelineio
     )

     install(

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions