diff --git a/qt6-after/qt6-migrated-legatus/CMakeLists.txt b/qt6-after/qt6-migrated-legatus/CMakeLists.txt index 09a100ea6..4dab76df0 100755 --- a/qt6-after/qt6-migrated-legatus/CMakeLists.txt +++ b/qt6-after/qt6-migrated-legatus/CMakeLists.txt @@ -46,6 +46,15 @@ include(CTest) # Set RPATH to find libraries in build directory SET(CMAKE_BUILD_RPATH "${CMAKE_BINARY_DIR}/lib") +# The RTI Connext libraries live outside the tree (pipeline-root +# external/rti_connext_dds-7.7.0). The absolute path CMake bakes into the +# RUNPATH only resolves on the mount of the build host, so also add a +# $ORIGIN-relative entry (5 levels up from any bin/ or lib/ artifact is +# the pipeline root) so the binaries load under any mount point +# (e.g. /workspace) without LD_LIBRARY_PATH. +SET(CMAKE_BUILD_RPATH + "${CMAKE_BUILD_RPATH};" + "$ORIGIN/../../../../../external/rti_connext_dds-7.7.0/resource/app/lib/x64Linux4gcc8.5.0") SET(CMAKE_INSTALL_RPATH "${CMAKE_BINARY_DIR}/lib") SET(CMAKE_BUILD_RPATH_USE_ORIGIN ON)