From 874efd4733e2bd6b9eee5ebfe6ea64c755c1de98 Mon Sep 17 00:00:00 2001 From: berrux_dev Date: Mon, 16 Nov 2026 21:01:53 +0100 Subject: [PATCH] Add mount-agnostic RTI RUNPATH so binaries load under any mount point The RTI Connext libraries live outside the tree (pipeline-root external/rti_connext_dds-7.7.0). CMake bakes their absolute path into the RUNPATH, which only resolves on the build host's mount - running the built binaries under another mount (e.g. /workspace) failed with 'libnddsc.so: cannot open shared object file'. Add a $ORIGIN-relative RUNPATH entry (5 levels up from any bin/ or lib/ artifact is the pipeline root) so the RTI libraries resolve regardless of the mount point. No LD_LIBRARY_PATH needed anymore. Verified: ddscore_unit_test runs with no env vars set. --- qt6-after/qt6-migrated-legatus/CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) 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)