In a project setup I am copying a number of shared library files into the 
executable directory (basically with a mechanism involving configure_file - 
because the "install" logic was simply too complicated for the project and for 
my limited brain capacity!).

On a Windows system this works nicely, but on a Linux system there is always 
some logic that puts the original shared library location into the executable's 
RUNPATH, with the effect that they are not found in the place where they are 
supposed to be found.

I tried to avoid this by using
set_target_properties(
    <imported targets>
    PROPERTIES
        CMAKE_SKIP_RPATH TRUE)However, any effect was not visible: the "old" 
path is still included in RUNPATH. Maybe I overlooked one more imported target, 
overriding the effect of above, or it does not work on imported targets at all. 
Anyway, it would be much easier if I could simply drop one specific path 
explicitly with some setting! Dropping all is again too much - because I need 
other entries for other libraries.

Is there such an option available?

Maybe a workaround would be to explicitly prepend "$ORIGIN" to the RUNPATH in 
the executable: In this way the shared libs would be found in the executable 
directory first and any other "wrong" paths would not hurt.

Many thanks and regards,
Cornelis Bockemühl
-- 

Powered by kitware.com/cmake

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit https://cmake.org/services

Visit other Kitware open-source projects at https://www.kitware.com/platforms

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

This mailing list is deprecated in favor of https://discourse.cmake.org

Reply via email to