[CMake] CMAKE_INSTALL_RPATH_USE_LINK_PATH is broken?

Elizabeth Fischer rpf2116 at columbia.edu
Fri Jan 8 22:16:23 EST 2016


Hello,

I'm using cmake 3.4.1.  I'm trying to compile libraries & executables with
an RPATH.  To that end, I use the following settings:


SET(CMAKE_SKIP_BUILD_RPATH  FALSE)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)


I then link in a lot of libraries.  However, ONLY ONE of the libraries gets
picked up to be used in the RPATH sent to the linker.  I can manually set
CMAKE_INSTALL_RPATH (that works).  But CMAKE_INSTALL_RPATH_USE_LINK_PATH
seems to be broken.

Interestingly, the one library it's willing to auto-generate an RPATH for
is the same library, whether it comes first or last in the link command
line.  The link command generated by CMake is shown below; it's clear that
many libraries are being linked in, but only one rpath is being generated.

HELP!!!!?
--- Elizabeth

[ 30%] Linking CXX executable test_array

cd /Users/rpfische/git/spsparse/build/test &&
/Users/rpfische/macports/mpgompi-4.9.3/bin/cmake -E cmake_link_script
CMakeFiles/test_array.dir/link.txt --verbose=1

/Users/rpfische/macports/mpgompi-4.9.3/bin/g++   -g -Wl,-search_paths_first
-Wl,-headerpad_max_install_names
CMakeFiles/test_array.dir/test_array.cpp.o  -o test_array
/Users/rpfische/eb/software/gtest/1.7.0-GCC-4.9.3/lib/libgtest.a
/Users/rpfische/eb/software/gtest/1.7.0-GCC-4.9.3/lib/libgtest_main.a
/Users/rpfische/eb/software/netCDF/4.3.2-mpgompi-4.9.3/lib/libnetcdf.dylib
/Users/rpfische/eb/software/netCDF-C++4/ecdf914-mpgompi-4.9.3/lib/libnetcdf-cxx4.dylib
/Users/rpfische/eb/software/ibmisc/devel/lib/libibmisc.dylib
../slib/libspsparse.dylib
/Users/rpfische/eb/software/netCDF/4.3.2-mpgompi-4.9.3/lib/libnetcdf.dylib
/Users/rpfische/eb/software/netCDF-C++4/ecdf914-mpgompi-4.9.3/lib/libnetcdf-cxx4.dylib
/Users/rpfische/eb/software/ibmisc/devel/lib/libibmisc.dylib -Wl,-rpath
,/Users/rpfische/eb/software/ibmisc/devel/lib
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20160108/b9924a49/attachment.html>


More information about the CMake mailing list