[cmake-developers] Remove RPATH on install

Ruslan Baratov ruslan_baratov at yahoo.com
Wed Sep 28 16:09:40 EDT 2016


Hi,

I want to link the library to all executables in project so I'm adding 
`<libname> -Wl,-rpath,<libdir>` to CMAKE_EXE_LINKER_FLAGS. That works 
fine however after install step this RPATH was not removed and full path 
to <libdir> remains as part of executable in LC_RPATH. As far as I 
understand there is no such variable for now in CMake that holds the 
list of RPATH directories that need to be removed on install step. If it 
is true what about adding new one, like CMAKE_INSTALL_DELETE_RPATH? Just 
for the record <libdir> is not a part of CMAKE_INSTALL_PREFIX or 
CMAKE_BINARY_DIR.

Ruslo


More information about the cmake-developers mailing list