If trying to link with a downstream project that does not export its libraries (Imath in this example) this will occur when building:
-- OTIO Defaulting C++ install to
-- Building shared libs
-- Installing C++ bindings to: /opentimelineio/cxx-sdk
-- Installing C++ dynamic libraries to: /opentimelineio
-- Installing 'any' and 'nonstd' for C++ (OTIO_DEPENDENCIES_INSTALL=ON)
-- Installing Python bindings to:
-- Building C++ with Coverage: OFF
-- Checking git repo is available:
true
-- root: Updating git submodules to make sure they are up to date
-- pybind11 v2.3.dev0
-- Configure Imath Version: 3.0.0 Lib API: 26.0.0
-- Imath is configuring as a cmake sub project
-- Configuring done
CMake Error in src/opentimelineio/CMakeLists.txt:
export called with target "opentimelineio" which requires target "Imath"
that is not in any export set.
Additional Context
This occurs because opentime and opentimelineio call export in their CMakeFiles like this:
When exporting, all the dependencies must also be exported. Meaning that opentimelineio and opentimeio will not be able to link with any downstream projects that do not also export.
From the CMake docs:
Creates a file that may be included by outside projects to import targets from the current project's build tree. This is useful during cross-compiling to build utility executables that can run on the host platform in one project and then import them into another project being compiled for the target platform. If the NAMESPACE option is given the string will be prepended to all target names written to the file.
Target installations are associated with the export using the EXPORT option of the install(TARGETS) command.
It's not likely that any upstream project would ever need to reference the libraries directly from the build tree. In fact, its likely undesirable since this is most often a temporary location. Upstream projects would instead want to access the installed location created by the install( EXPORT ) command, which is also present in the CMakeFiles already.
This seems to have been added to support a local pip install, so any solution should make sure that it is still possible to call pip install ..
Bug Report
Build Problem
If trying to link with a downstream project that does not export its libraries (Imath in this example) this will occur when building:
Additional Context
This occurs because opentime and opentimelineio call export in their CMakeFiles like this:
When exporting, all the dependencies must also be exported. Meaning that opentimelineio and opentimeio will not be able to link with any downstream projects that do not also export.
From the CMake docs:
Target installations are associated with the export using the EXPORT option of the install(TARGETS) command.
It's not likely that any upstream project would ever need to reference the libraries directly from the build tree. In fact, its likely undesirable since this is most often a temporary location. Upstream projects would instead want to access the installed location created by the
install( EXPORT )
command, which is also present in the CMakeFiles already.This seems to have been added to support a local pip install, so any solution should make sure that it is still possible to call
pip install .
.