[CMake] Problem with CMAKE_INSTALL_RPATH_USE_LINK_PATH ?
Alexander Neundorf
a.neundorf-work at gmx.net
Wed Oct 22 15:33:14 EDT 2008
On Wednesday 22 October 2008, Roland Rasmussen wrote:
> 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)
What happens if you set CMAKE_BUILD_WITH_INSTALL_RPATH to TRUE ?
Then it will be built with the install RPATH and won't have to be changed when
installing.
But I think there may be special handling for /lib and /usr/lib, so that they
are never included in the RPATH since they are standard directories. (at
least they are in CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES, which is used for
something like this).
Alex
More information about the CMake
mailing list