[CMake] Macro to turn list of librarys into list of dirs?
Alexander Neundorf
a.neundorf-work at gmx.net
Thu Jan 27 15:07:04 EST 2011
On Thursday 27 January 2011, Jeremy Selan wrote:
> Hello!
>
> I have a real newbie question here. It's possible this was already
> answered, but I tried searching the archives and could not find
> anything.
>
> I have an application that links to a few libraries, some of which are
> in the system install locations and some of which aren't.
> I would like the rpath for some of the targets, when installed, to
> include only the non-system installed paths.
>
> I played around with using INSTALL_RPATH_USE_LINK_PATH, which almost
> does what I need but also includes things in the system path. I then
> looked into filtering this rpath based on
> CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES, but based on other threads
> this appears to be ill advised.
The directories figured out by setting INSTALL_RPATH_USE_LINK_PATH to true are
filtered by CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES, i.e. all directories
listed there will be removed from the install RPATH.
/usr/local/lib is by default not part of
CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES.
I tried here and it works, adding some directory to
CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES makes cmake remove this directory
from the RPATH when installing an executable.
What directory stays in the RPATH which you don't want to have there ?
Also, when you look at the RPATH of a target in the build tree, i.e. not
installed, it will have the full RPATH. When doing "make install", the build
RPATH is removed and replaced with the install RPATH.
So you need to check the installed executable.
Alex
More information about the CMake
mailing list