Build Directory & CTest: Force RPATH over RUNPATH
Hi,
I am aware of the great capabilities of RUNPATH
to install software artifacts compared to RPATH
, namely that LD_LIBRARY_PATH
takes precedence.
In newer CMake versions, whenever we speak about "RPATH" then actually "RUNPATH" is used if the platform supports it. This has a big drawback for the following situation: In development using superbuilds, we quite often pull dependencies on the fly. These dependencies might be newer(/different) than system-installed versions of the same dependent software. Everything works well for compilation & linkage.
But, when running software from the build path, e.g., with ctest
, the (potentially incompatible) system libs will take precedence due to RUNPATH.
Is there a simple way to:
- force
RPATH
instead ofRUNPATH
in modern CMake in the build directory? (preferred) or - a helper to set all transitive
LD_LIBRARY_PATH
s on targets for running withctest
?
Thank you for your help and/or ideas, Axel