AcademySoftwareFoundation / xstudio

xSTUDIO is a modern, high performance and feature rich playback and review application designed for organisations and individuals in the post production, VFX and Animation industries.
Apache License 2.0
639 stars 83 forks source link

`Imath` dependency missing from various component target builds #59

Open nrusch opened 1 year ago

nrusch commented 1 year ago

When attempting to build xstudio from the v0.11.2 tag on CentOS 7, it appears there are some broken CMake recipes related to the lack of Imath inclusion.

CMake Command:

cmake \
        -D CMAKE_INSTALL_PREFIX=/path/to/install_prefix \
        -D CMAKE_EXE_LINKER_FLAGS=-Wl,--enable-new-dtags \
        -D CMAKE_SHARED_LINKER_FLAGS=-Wl,--enable-new-dtags \
        -D CMAKE_CXX_EXTENSIONS=OFF \
        -D CMAKE_CXX_FLAGS="-D_GLIBCXX_USE_CXX11_ABI=0" \
        -D CMAKE_INSTALL_RPATH_USE_LINK_PATH=ON \
        -D Python_ROOT_DIR=/path/to/python_root \  # This doesn't work right, but I will open a separate issue for it
        -D Qt5_DIR=/path/to/qt5_root \
        -D BUILD_DOCS=OFF \
        /path/to/source_dir

The Imath install is being located at build time by its bundled ImathConfig.cmake, which is discovered from the CMAKE_PREFIX_PATH environment variable.

The first error encountered is this:

[  5%] Building CXX object src/utility/src/CMakeFiles/utility_static.dir/container.cpp.o
cd /lumalocal/bonus/dev/rez-build/xstudio/dev/build/platform-linux/gcc-9.3.1/python-3.9/src/utility/src && /opt/rh/devtoolset-9/root/usr/bin/g++ -DBINARY_DIR=\"/lumalocal/bonus/dev/rez-build/xstudio/dev/build/platform-linux/gcc-9.3.1/python-3.9/bin\" -DFMT_LOCALE -DFMT_SHARED -DPROJECT_VERSION=\"0.1.0\" -DROOT_DIR=\"/lumalocal/bonus/dev/rez-build/xstudio/dev/src\" -DSPDLOG_COMPILED_LIB -DSPDLOG_SHARED_LIB -DTEST_RESOURCE=\"/lumalocal/bonus/dev/rez-build/xstudio/dev/src/test_resource\" -DXSTUDIO_GLOBAL_NAME=\"xStudio\" -DXSTUDIO_GLOBAL_VERSION=\"0.11.2\" -D__linux__ -Dtest_private=private -I/lumalocal/bonus/dev/rez-build/xstudio/dev/build/platform-linux/gcc-9.3.1/python-3.9/src/utility/src -I/lumalocal/bonus/dev/rez-build/xstudio/dev/src/src/utility/src -I/lumalocal/bonus/dev/rez-build/xstudio/dev/src/include -I/lumalocal/bonus/dev/rez-build/xstudio/dev/src/src/utility/src/src -I/lumalocal/bonus/dev/rez-build/xstudio/dev/src/src/utility/src/SYSTEM -I/lumalocal/bonus/dev/rez-build/xstudio/dev/src/extern/include -I/lumalocal/bonus/dev/rez-build/xstudio/dev/src/extern/reproc/reproc++/include -isystem /luma/dev/ruschn/rez-release/actor_framework/0.18.4/platform-linux/gcc-9.3.1/include -isystem /luma/dev/ruschn/rez-release/fmt/8.0.1/platform-linux/gcc-9.3.1/include -isystem /luma/dev/ruschn/rez-release/nlohmann_json/3.11.2/platform-linux/include -isystem /luma/dev/ruschn/rez-release/spdlog/1.9.2/platform-linux/gcc-9.3.1/include -D_GLIBCXX_USE_CXX11_ABI=0 -fpic -fmax-errors=5 -fdiagnostics-color=always -O3 -DNDEBUG -fdiagnostics-color=always -pthread -std=c++17 -MD -MT src/utility/src/CMakeFiles/utility_static.dir/container.cpp.o -MF CMakeFiles/utility_static.dir/container.cpp.o.d -o CMakeFiles/utility_static.dir/container.cpp.o -c /lumalocal/bonus/dev/rez-build/xstudio/dev/src/src/utility/src/container.cpp
In file included from /lumalocal/bonus/dev/rez-build/xstudio/dev/src/include/xstudio/utility/uuid.hpp:19,
                 from /lumalocal/bonus/dev/rez-build/xstudio/dev/src/include/xstudio/atoms.hpp:18,
                 from /lumalocal/bonus/dev/rez-build/xstudio/dev/src/include/xstudio/utility/container.hpp:18,
                 from /lumalocal/bonus/dev/rez-build/xstudio/dev/src/src/utility/src/container.cpp:5:
/lumalocal/bonus/dev/rez-build/xstudio/dev/src/include/xstudio/utility/json_store.hpp:14:10: fatal error: Imath/ImathBox.h: No such file or directory
   14 | #include <Imath/ImathBox.h>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.

This same issue affects quite a few of the component object builds:

In general, the fact that find_package calls are localized and repeated within each dependent object's build definition, instead of performed once at the top level of the project, makes resolving these issues much more repetitive and error-prone than it needs to be.

Also, components that are dependencies of other components should include things like the Imath include directories/libraries in their public include directories/link libraries, so that builds of dependent targets will pull them in automatically.

I'm currently hacking my way through these to get the project to build, but it seems like a re-work of the dependency discovery/resolution might be in order.

Versions