[CMake] Problem with CMAKE_INSTALL_RPATH_USE_LINK_PATH ?

Roland Rasmussen rasmussen74 at googlemail.com
Wed Oct 22 06:57:55 EDT 2008


Hi!

The way I read the documentation for CMAKE_INSTALL_RPATH_USE_LINK_PATH
is that if it is TRUE, then the link paths for an executable will be
put into the rpath when it is installed through the 'install' target.
Is that correct?

The problem is that it doesn't work as expected for me.

The situation is that I have an executable 'johndoe' which requires a
shared library, say libbar.so, which is found in the directory
/lib/foo, ie. outside the build directory. So what I expected is that
with

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

I would end up with an executable which has an rpath including /lib/foo.

But I don't. In fact, the 'install' target reports

-- Installing: /build/path/johndoe
-- Removed runtime path from "/install/path/johndoe"

and "readelf -d /install/path/johndoe" has no RPATH or RUNPATH entries.

If I am completely wrong, how do I then build an executable with the
library paths "rpath-fixed" ?

Thanks in advance.


Regards,
Roland


More information about the CMake mailing list