--- a/CMakeLists.txt 2000-01-01 01:00:00.000000000 +0100 +++ b/CMakeLists.txt 2026-10-19 17:51:13.926710164 +0200 @@ -51,6 +51,10 @@ option(OTIO_AUTOMATIC_SUBMODULES "Fetch #------------------------------------------------------------------------------ # Set option dependent variables +# relative library dir for relocatable CMake targets, the libraries are not +# installed into the Python package +include(GNUInstallDirs) + if(OTIO_PYTHON_INSTALL) # Find the python interpreter using FindPython module. # The Development.Module component is used instead of the Development one @@ -81,7 +85,7 @@ if(OTIO_PYTHON_INSTALL) if(OTIO_PYTHON_INSTALL_DIR STREQUAL "" AND CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) # neither install directory supplied from the command line set(OTIO_RESOLVED_PYTHON_INSTALL_DIR "${Python_SITEARCH}") - set(OTIO_RESOLVED_CXX_DYLIB_INSTALL_DIR "${OTIO_RESOLVED_PYTHON_INSTALL_DIR}/opentimelineio") + set(OTIO_RESOLVED_CXX_DYLIB_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}") message(STATUS "OTIO Defaulting Python install to ${OTIO_RESOLVED_PYTHON_INSTALL_DIR}") else() # either python_install or install_prefix have been set @@ -92,12 +96,12 @@ if(OTIO_PYTHON_INSTALL) # In order to not require setting $PYTHONPATH to point at the .so, # the shared libraries are installed into the python library # location. - set(OTIO_RESOLVED_CXX_DYLIB_INSTALL_DIR "${OTIO_RESOLVED_PYTHON_INSTALL_DIR}/opentimelineio") + set(OTIO_RESOLVED_CXX_DYLIB_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}") message(STATUS "OTIO Defaulting Python install to ${OTIO_RESOLVED_PYTHON_INSTALL_DIR}") else() # OTIO_PYTHON_INSTALL_DIR was set, so install everything into the python package set(OTIO_RESOLVED_PYTHON_INSTALL_DIR "${OTIO_PYTHON_INSTALL_DIR}") - set(OTIO_RESOLVED_CXX_DYLIB_INSTALL_DIR "${OTIO_PYTHON_INSTALL_DIR}/opentimelineio") + set(OTIO_RESOLVED_CXX_DYLIB_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}") endif() endif() @@ -106,7 +110,7 @@ if(OTIO_PYTHON_INSTALL) endif() else() - set(OTIO_RESOLVED_CXX_DYLIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib") + set(OTIO_RESOLVED_CXX_DYLIB_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}") message(STATUS "OTIO C++ installing to ${CMAKE_INSTALL_PREFIX}") endif() --- a/src/py-opentimelineio/opentime-bindings/CMakeLists.txt 2000-01-01 01:00:00.000000000 +0100 +++ b/src/py-opentimelineio/opentime-bindings/CMakeLists.txt 2026-10-19 17:51:13.926892023 +0200 @@ -43,6 +43,6 @@ elseif(UNIX) endif() install(TARGETS _opentime - ARCHIVE DESTINATION "${OTIO_RESOLVED_CXX_DYLIB_INSTALL_DIR}" - LIBRARY DESTINATION "${OTIO_RESOLVED_CXX_DYLIB_INSTALL_DIR}" - RUNTIME DESTINATION "${OTIO_RESOLVED_CXX_DYLIB_INSTALL_DIR}") + ARCHIVE DESTINATION "${OTIO_RESOLVED_PYTHON_INSTALL_DIR}/opentimelineio" + LIBRARY DESTINATION "${OTIO_RESOLVED_PYTHON_INSTALL_DIR}/opentimelineio" + RUNTIME DESTINATION "${OTIO_RESOLVED_PYTHON_INSTALL_DIR}/opentimelineio") --- a/src/py-opentimelineio/opentimelineio-bindings/CMakeLists.txt 2000-01-01 01:00:00.000000000 +0100 +++ b/src/py-opentimelineio/opentimelineio-bindings/CMakeLists.txt 2026-10-19 17:51:13.926817564 +0200 @@ -53,6 +53,6 @@ elseif(UNIX) endif() install(TARGETS _otio - ARCHIVE DESTINATION "${OTIO_RESOLVED_CXX_DYLIB_INSTALL_DIR}" - LIBRARY DESTINATION "${OTIO_RESOLVED_CXX_DYLIB_INSTALL_DIR}" - RUNTIME DESTINATION "${OTIO_RESOLVED_CXX_DYLIB_INSTALL_DIR}") + ARCHIVE DESTINATION "${OTIO_RESOLVED_PYTHON_INSTALL_DIR}/opentimelineio" + LIBRARY DESTINATION "${OTIO_RESOLVED_PYTHON_INSTALL_DIR}/opentimelineio" + RUNTIME DESTINATION "${OTIO_RESOLVED_PYTHON_INSTALL_DIR}/opentimelineio")