[CMake] Is INSTALL_RPATH Meant to be Relative to CMAKE_INSTALL_PREFIX?

David Narvaez david.narvaez at computer.org
Tue Feb 5 15:02:36 EST 2013


On Tue, Feb 5, 2013 at 1:15 PM, Alexander Neundorf
<a.neundorf-work at gmx.net> wrote:
> I know this was the case at some point in I think the frameworks branch of
> kdelibs, but this was wrong, and I think it has been fixed.
> Or where did you see this ?

I'm currently using KDE 4.10 RC 2 and, as far as I understand (I'm not
a CMake expert), the situation is as follows:

1. LIB_INSTALL_DIR is set to "lib"
2. FindKDE4Internal.cmake is called
3. There's a call to _set_fancy(LIB_INSTALL_DIR ...) which would have
set the LIB_INSTALL_DIR path to an absolute path, but this variable
was already set so it is not overridden
4. There's another call to set(INSTALL_RPATH "${LIB_INSTALL_DIR}")
which, at that point, is relative
5. Library's RPATH eventually contains a relative path

> The install rpath must be an absolute path, or if you want it to be
> relative
> to the location of the ELF file, use $ORIGIN to refer to this location,
> e.g
> $ORIGIN/../lib/

I see, so what would you recommend from the workflow above? Set
LIB_INSTALL_DIR to a prefixed path? Add checks in
FindKDE4Internal.cmake before setting  INSTALL_RPATH?

Thanks for your answer.

David E. Narváez


More information about the CMake mailing list