OpenTimelineIO
OpenTimelineIO copied to clipboard
Added IMATH_INCLUDES to the cmake module
Bug Report
Build Problem
OTIO_IMATH_TARGETS is added to the cmake module so that applications using opentimelineio can inherit the correct library paths and libraries to link against, however IMATH_INCLUDES is not added to the cmake module. It specifies the include path for IMath header files included by files such as opentimelineio/serializableObject.h.
As a result, applications don't compile out of the box without discovering the correct IMath include path for themselves and manually adding it to the compiler's command line. The correct include path is needed to ensure the same version of IMath that opentimelineio was compiled against is referenced by the application.
For OTIO_IMATH_TARGETS, the src/opentimelineio/CMakeLists.txt file already does this:
target_link_libraries(opentimelineio
PUBLIC opentime ${OTIO_IMATH_TARGETS})
The same could be done for IMATH_INCLUDES by adding it to the public interface (it's only added to the private interface at the moment and hence not exported to the cmake module):
target_include_directories(opentimelineio
PUBLIC
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/Imath>)
I've tested this change locally and it resolves the build error in the attached log.
Expected Behavior
The cmake module provides application developers with the include path to the version of IMath that was discovered and used to build opentimelineio.
Logs
mkdir -p /home/mark/projects/build/_linux_debug/otio/x86_64-linux-gnu && \
mkdir -p /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu && \
cd /home/mark/projects/build/_linux_debug/otio/x86_64-linux-gnu && \
cmake /home/mark/projects/demos/deps/otio/ \
-DCMAKE_INSTALL_PREFIX="/home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu" \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DOTIO_INSTALL_PYTHON_MODULES=OFF \
-DOTIO_INSTALL_COMMANDLINE_TOOLS=OFF \
-DOTIO_INSTALL_CONTRIB=OFF \
-DOTIO_AUTOMATIC_SUBMODULES=OFF \
-DBUILD_SHARED_LIBS=OFF -DCMAKE_TOOLCHAIN_FILE="/opt/cmake-toolchains/toolchain-x86_64-linux-gnu.cmake" -DCMAKE_BUILD_TYPE=debug -DCMAKE_C_FLAGS="-I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include" -DCMAKE_CXX_FLAGS="-I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include" -DCMAKE_EXE_LINKER_FLAGS="" -DCMAKE_SHARED_LINKER_FLAGS="" -DCMAKE_MODULE_LINKER_FLAGS="" -DOTIO_SHARED_LIBS=OFF -DOTIO_SHARED_LIBS=OFF -DOTIO_SHARED_LIBS=OFF
-- OTIO C++ installing to /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu
-- Building static libs
-- Installing C++ bindings to: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu
-- Installing C++ dynamic libraries to: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/lib
-- Installing 'any' and 'nonstd' for C++ (OTIO_DEPENDENCIES_INSTALL=ON)
-- Install Python bindings: OFF
-- Building C++ with Coverage: OFF
-- Using src/deps/Imath by default
-- Imath is configuring as a cmake sub project
-- Configure Imath 3.2.0-dev, library API version: 29.0.0
-- Looking for sin in m
-- Looking for sin in m - found
-- Configuring done (0.1s)
-- Generating done (0.0s)
-- Build files have been written to: /home/mark/projects/build/_linux_debug/otio/x86_64-linux-gnu
cd /home/mark/projects/build/_linux_debug/otio/x86_64-linux-gnu && \
make -j8 --output-sync && \
make install
[ 10%] Building CXX object src/deps/Imath/src/Imath/CMakeFiles/Imath.dir/ImathRandom.cpp.o
[ 4%] Building CXX object src/deps/Imath/src/Imath/CMakeFiles/Imath.dir/ImathFun.cpp.o
[ 1%] Building CXX object src/opentime/CMakeFiles/opentime.dir/errorStatus.cpp.o
[ 3%] Building CXX object src/opentime/CMakeFiles/opentime.dir/rationalTime.cpp.o
[ 12%] Linking CXX static library libopentime.a
[ 12%] Built target opentime
[ 7%] Building CXX object src/deps/Imath/src/Imath/CMakeFiles/Imath.dir/ImathColorAlgo.cpp.o
[ 9%] Building CXX object src/deps/Imath/src/Imath/CMakeFiles/Imath.dir/ImathMatrixAlgo.cpp.o
[ 6%] Building CXX object src/deps/Imath/src/Imath/CMakeFiles/Imath.dir/half.cpp.o
[ 17%] Linking CXX static library libImath-3_2_d.a
[ 17%] Built target Imath
[ 15%] Building CXX object tests/CMakeFiles/test_opentime.dir/test_opentime.cpp.o
[ 14%] Building CXX object tests/CMakeFiles/test_opentime.dir/utils.cpp.o
[ 29%] Linking CXX executable test_opentime
[ 29%] Built target test_opentime
[ 28%] Building CXX object src/opentimelineio/CMakeFiles/opentimelineio.dir/errorStatus.cpp.o
[ 25%] Building CXX object src/opentimelineio/CMakeFiles/opentimelineio.dir/effect.cpp.o
[ 20%] Building CXX object src/opentimelineio/CMakeFiles/opentimelineio.dir/composable.cpp.o
[ 31%] Building CXX object src/opentimelineio/CMakeFiles/opentimelineio.dir/externalReference.cpp.o
[ 18%] Building CXX object src/opentimelineio/CMakeFiles/opentimelineio.dir/clip.cpp.o
[ 32%] Building CXX object src/opentimelineio/CMakeFiles/opentimelineio.dir/freezeFrame.cpp.o
[ 26%] Building CXX object src/opentimelineio/CMakeFiles/opentimelineio.dir/algo/editAlgorithm.cpp.o
[ 21%] Building CXX object src/opentimelineio/CMakeFiles/opentimelineio.dir/composition.cpp.o
[ 34%] Building CXX object src/opentimelineio/CMakeFiles/opentimelineio.dir/gap.cpp.o
[ 35%] Building CXX object src/opentimelineio/CMakeFiles/opentimelineio.dir/generatorReference.cpp.o
[ 23%] Building CXX object src/opentimelineio/CMakeFiles/opentimelineio.dir/deserialization.cpp.o
[ 37%] Building CXX object src/opentimelineio/CMakeFiles/opentimelineio.dir/imageSequenceReference.cpp.o
[ 40%] Building CXX object src/opentimelineio/CMakeFiles/opentimelineio.dir/linearTimeWarp.cpp.o
[ 42%] Building CXX object src/opentimelineio/CMakeFiles/opentimelineio.dir/marker.cpp.o
[ 39%] Building CXX object src/opentimelineio/CMakeFiles/opentimelineio.dir/item.cpp.o
[ 43%] Building CXX object src/opentimelineio/CMakeFiles/opentimelineio.dir/mediaReference.cpp.o
[ 45%] Building CXX object src/opentimelineio/CMakeFiles/opentimelineio.dir/missingReference.cpp.o
[ 46%] Building CXX object src/opentimelineio/CMakeFiles/opentimelineio.dir/safely_typed_any.cpp.o
[ 51%] Building CXX object src/opentimelineio/CMakeFiles/opentimelineio.dir/serializableObjectWithMetadata.cpp.o
[ 50%] Building CXX object src/opentimelineio/CMakeFiles/opentimelineio.dir/serializableObject.cpp.o
[ 48%] Building CXX object src/opentimelineio/CMakeFiles/opentimelineio.dir/serializableCollection.cpp.o
[ 57%] Building CXX object src/opentimelineio/CMakeFiles/opentimelineio.dir/stringUtils.cpp.o
[ 54%] Building CXX object src/opentimelineio/CMakeFiles/opentimelineio.dir/stack.cpp.o
[ 56%] Building CXX object src/opentimelineio/CMakeFiles/opentimelineio.dir/stackAlgorithm.cpp.o
[ 59%] Building CXX object src/opentimelineio/CMakeFiles/opentimelineio.dir/timeEffect.cpp.o
[ 60%] Building CXX object src/opentimelineio/CMakeFiles/opentimelineio.dir/timeline.cpp.o
[ 64%] Building CXX object src/opentimelineio/CMakeFiles/opentimelineio.dir/trackAlgorithm.cpp.o
[ 62%] Building CXX object src/opentimelineio/CMakeFiles/opentimelineio.dir/track.cpp.o
[ 70%] Building CXX object src/opentimelineio/CMakeFiles/opentimelineio.dir/CORE_VERSION_MAP.cpp.o
[ 65%] Building CXX object src/opentimelineio/CMakeFiles/opentimelineio.dir/transition.cpp.o
[ 68%] Building CXX object src/opentimelineio/CMakeFiles/opentimelineio.dir/unknownSchema.cpp.o
[ 53%] Building CXX object src/opentimelineio/CMakeFiles/opentimelineio.dir/serialization.cpp.o
[ 67%] Building CXX object src/opentimelineio/CMakeFiles/opentimelineio.dir/typeRegistry.cpp.o
[ 71%] Linking CXX static library libopentimelineio.a
[ 71%] Built target opentimelineio
[ 73%] Building CXX object tests/CMakeFiles/test_clip.dir/utils.cpp.o
[ 76%] Building CXX object tests/CMakeFiles/test_serializableCollection.dir/utils.cpp.o
[ 79%] Building CXX object tests/CMakeFiles/test_timeline.dir/utils.cpp.o
[ 81%] Building CXX object tests/CMakeFiles/test_serialization.dir/utils.cpp.o
[ 82%] Building CXX object tests/CMakeFiles/test_editAlgorithm.dir/utils.cpp.o
[ 79%] Building CXX object tests/CMakeFiles/test_track.dir/utils.cpp.o
[ 84%] Building CXX object tests/CMakeFiles/test_serialization.dir/test_serialization.cpp.o
[ 75%] Building CXX object tests/CMakeFiles/test_clip.dir/test_clip.cpp.o
[ 92%] Linking CXX executable test_serialization
[ 93%] Built target test_serialization
[ 93%] Linking CXX executable test_clip
[ 93%] Built target test_clip
[ 89%] Building CXX object tests/CMakeFiles/test_timeline.dir/test_timeline.cpp.o
[ 90%] Building CXX object tests/CMakeFiles/test_track.dir/test_track.cpp.o
[ 87%] Building CXX object tests/CMakeFiles/test_serializableCollection.dir/test_serializableCollection.cpp.o
[ 95%] Linking CXX executable test_timeline
[ 98%] Built target test_timeline
[ 96%] Linking CXX executable test_track
[ 98%] Built target test_track
[ 98%] Linking CXX executable test_serializableCollection
[ 98%] Built target test_serializableCollection
[ 85%] Building CXX object tests/CMakeFiles/test_editAlgorithm.dir/test_editAlgorithm.cpp.o
[100%] Linking CXX executable test_editAlgorithm
[100%] Built target test_editAlgorithm
[ 9%] Built target Imath
[ 14%] Built target opentime
[ 67%] Built target opentimelineio
[ 71%] Built target test_opentime
[ 76%] Built target test_clip
[ 81%] Built target test_serialization
[ 85%] Built target test_serializableCollection
[ 90%] Built target test_timeline
[ 95%] Built target test_track
[100%] Built target test_editAlgorithm
Install the project...
-- Install configuration: "debug"
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/deps/any/any.hpp
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/deps/nonstd/optional.hpp
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/Imath/ImathConfig.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/lib/pkgconfig/Imath.pc
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/lib/cmake/Imath/ImathConfig.cmake
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/lib/cmake/Imath/ImathConfigVersion.cmake
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/lib/cmake/Imath/ImathTargets.cmake
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/lib/cmake/Imath/ImathTargets-debug.cmake
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/lib/libImath-3_2_d.a
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/Imath/half.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/Imath/halfFunction.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/Imath/halfLimits.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/Imath/ImathBox.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/Imath/ImathBoxAlgo.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/Imath/ImathColor.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/Imath/ImathColorAlgo.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/Imath/ImathEuler.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/Imath/ImathExport.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/Imath/ImathForward.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/Imath/ImathFrame.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/Imath/ImathFrustum.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/Imath/ImathFrustumTest.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/Imath/ImathFun.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/Imath/ImathGL.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/Imath/ImathGLU.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/Imath/ImathInt64.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/Imath/ImathInterval.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/Imath/ImathLine.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/Imath/ImathLineAlgo.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/Imath/ImathMath.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/Imath/ImathMatrix.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/Imath/ImathMatrixAlgo.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/Imath/ImathNamespace.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/Imath/ImathPlane.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/Imath/ImathPlatform.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/Imath/ImathQuat.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/Imath/ImathRandom.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/Imath/ImathRoots.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/Imath/ImathShear.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/Imath/ImathSphere.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/Imath/ImathTypeTraits.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/Imath/ImathVec.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/Imath/ImathVecAlgo.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentime/errorStatus.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentime/rationalTime.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentime/stringPrintf.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentime/timeRange.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentime/timeTransform.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentime/version.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/lib/libopentime.a
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/share/opentime/OpenTimeTargets.cmake
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/share/opentime/OpenTimeTargets-debug.cmake
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/share/opentime/OpenTimeConfig.cmake
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/any.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/anyDictionary.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/anyVector.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/clip.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/composable.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/composition.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/deserialization.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/editAlgorithm.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/effect.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/errorStatus.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/externalReference.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/freezeFrame.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/gap.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/generatorReference.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/imageSequenceReference.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/item.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/linearTimeWarp.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/marker.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/mediaReference.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/missingReference.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/optional.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/safely_typed_any.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/serializableCollection.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/serializableObject.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/serializableObjectWithMetadata.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/serialization.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/stack.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/stackAlgorithm.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/timeEffect.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/timeline.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/track.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/trackAlgorithm.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/transition.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/typeRegistry.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/unknownSchema.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/vectorIndexing.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/version.h
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/lib/libopentimelineio.a
-- Old export file "/home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/share/opentimelineio/OpenTimelineIOTargets.cmake" will be replaced. Removing files [/home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/share/opentimelineio/OpenTimelineIOTargets-debug.cmake].
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/share/opentimelineio/OpenTimelineIOTargets.cmake
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/share/opentimelineio/OpenTimelineIOTargets-debug.cmake
-- Installing: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/share/opentimelineio/OpenTimelineIOConfig.cmake
mkdir -p /home/mark/projects/build/_linux_debug/otiotest/x86_64-linux-gnu && \
mkdir -p /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu && \
cd /home/mark/projects/build/_linux_debug/otiotest/x86_64-linux-gnu && \
cmake /home/mark/projects/demos/otiotest \
-DCMAKE_FIND_ROOT_PATH="/home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu" \
-DCMAKE_INSTALL_PREFIX="/home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu" \
-DCMAKE_BUILD_TYPE=debug \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_FLAGS="-I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include" \
-DCMAKE_CXX_FLAGS="-I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include" \
-DCMAKE_TOOLCHAIN_FILE=/opt/cmake-toolchains/toolchain-x86_64-linux-gnu.cmake \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DBUILD_SHARED_LIBS=OFF -DCMAKE_TOOLCHAIN_FILE="/opt/cmake-toolchains/toolchain-x86_64-linux-gnu.cmake" -DCMAKE_BUILD_TYPE=debug -DCMAKE_C_FLAGS="-I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include" -DCMAKE_CXX_FLAGS="-I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include" -DCMAKE_EXE_LINKER_FLAGS="" -DCMAKE_SHARED_LINKER_FLAGS="" -DCMAKE_MODULE_LINKER_FLAGS="" -DOTIO_SHARED_LIBS=OFF -DOTIO_SHARED_LIBS=OFF -DOTIO_SHARED_LIBS=OFF
-- The CXX compiler identification is GNU 11.4.0
-- The C compiler identification is GNU 11.4.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/x86_64-linux-gnu-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/x86_64-linux-gnu-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- CMAKE_MODULE_PATH:
-- CMAKE_CXX_FLAGS: -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include
-- CMAKE_PREFIX_PATH:
-- CMAKE_INSTALL_PREFIX: /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu
-- CMAKE_INSTALL_LIBDIR: lib
-- CMAKE_INSTALL_INCLUDEDIR: include
-- CMAKE_SOURCE_DIR: /home/mark/projects/demos/otiotest
-- PROJECT_SOURCE_DIR: /home/mark/projects/demos/otiotest
-- CMAKE_CURRENT_SOURCE_DIR: /home/mark/projects/demos/otiotest
-- CMAKE_CURRENT_BINARY_DIR: /home/mark/projects/build/_linux_debug/otiotest/x86_64-linux-gnu
-- Configuring done (0.4s)
-- Generating done (0.0s)
-- Build files have been written to: /home/mark/projects/build/_linux_debug/otiotest/x86_64-linux-gnu
cd /home/mark/projects/build/_linux_debug/otiotest/x86_64-linux-gnu && \
make -j8 --output-sync && \
make install
[ 33%] Building CXX object CMakeFiles/otiotest.dir/main.cpp.o
In file included from /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/serializableObjectWithMetadata.h:6,
from /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/effect.h:6,
from /home/mark/projects/demos/otiotest/otioschema.hpp:13,
from /home/mark/projects/demos/otiotest/main.cpp:12:
/home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/serializableObject.h:16:10: fatal error: ImathBox.h: No such file or directory
16 | #include "ImathBox.h"
| ^~~~~~~~~~~~
compilation terminated.
make[3]: *** [CMakeFiles/otiotest.dir/build.make:76: CMakeFiles/otiotest.dir/main.cpp.o] Error 1
make[3]: *** Waiting for unfinished jobs....
[ 66%] Building CXX object CMakeFiles/otiotest.dir/otioschema.cpp.o
In file included from /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/serializableObjectWithMetadata.h:6,
from /home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/effect.h:6,
from /home/mark/projects/demos/otiotest/otioschema.hpp:13,
from /home/mark/projects/demos/otiotest/otioschema.cpp:1:
/home/mark/projects/build/_linux_debug/install/x86_64-linux-gnu/include/opentimelineio/serializableObject.h:16:10: fatal error: ImathBox.h: No such file or directory
16 | #include "ImathBox.h"
| ^~~~~~~~~~~~
compilation terminated.
make[3]: *** [CMakeFiles/otiotest.dir/build.make:90: CMakeFiles/otiotest.dir/otioschema.cpp.o] Error 1
make[2]: *** [CMakeFiles/Makefile2:83: CMakeFiles/otiotest.dir/all] Error 2
make[1]: *** [Makefile:136: all] Error 2
make: *** [/home/mark/projects/buildtargets/demos/otiotest.mk:36: otiotest_x86_64-linux-gnu] Error 2
make: *** [Makefile:122: demos] Error 2
That makes sense, would you like to submit a PR?
I think I stumbled upon something quite interesting...
I try to integrate OTIO in a C++ project together with Qt and wrote myself a small build system wrapper (that invokes Cmake). OTIO just builds and installs fine. When trying to include the library / includepath into my project via
LIBS += -L/usr/local/lib -lopentimelineio
INCLUDEPATH += /usr/local/include
I get the same error telling me that ImathBox.h is missing and could not be found:
/usr/local/include/opentimelineio/serializableObject.h:15:10: fatal error: 'ImathBox.h' file not found
#include "ImathBox.h"
^~~~~~~~~~~~
1 warning and 1 error generated.
When explicitly setting the includepath in my .pro file, everything works as expected..
LIBS += -L/usr/local/lib -lopentimelineio
INCLUDEPATH += /usr/local/include
INCLUDEPATH += /usr/local/include/Imath
Oh, that's a very helpful observation. The proper fix is that OTIO itself should be including <Imath/ImathBox.h>, not the local path "ImathBox.h". I'm wondering if you might be able to test that and let us know if changing the include path also fixes the problem in your set up?
Hey @meshula, I try this tonight and probably submit a small PR if that works.
It seems like neither the cmake additions of @marklomas nor the fix to include <Imath/ImathBox.h> directly works out for me. When using <Imath/ImathBox.h> OTIO won't build, exiting with:
/Users/jan/_Projekte/_tests/HelloQt6/build/outdir/opentimelineio/src/opentimelineio/serializableObject.h:15:10: fatal error: 'Imath/ImathBox.h' file not found
#include <Imath/ImathBox.h>
btw: Whats quite interesting about this even in the log above:
composable.h uses it as <ImathBox.h> and this straight up just works atleast due to the build order of these files, it is used before serializableObject.h. Thats atleast what I understand. If I change this inside serializableObject.h to <ImathBox.h>, it gives me the same build error requiring me to add the Imath include directory specifically.