[CMake] absolute rpath
Jörg Becker
news at elke-joerg.de
Fri Feb 22 10:39:56 EST 2008
On Wednesday, 20. February 2008 19:01:55 Alexander Neundorf wrote:
> Use:
> set_target_properties(hello PROPERTIES INSTALL_RPATH . )
>
This doesn't work, too. The problem may be, that I don't understand the path
expansion in cmake (or it is buggy). I tried the following things (with
set_target_properties its the same) using cmake 2.4.8:
set( CMAKE_INSTALL_RPATH "." ) -> rpath is set to source CMAKE_SOURCE_DIR
set( CMAKE_INSTALL_RPATH ".:." ) -> rpath is set to ".:"
set( CMAKE_INSTALL_RPATH "foo:." ) -> rpath is set to source
CMAKE_SOURCE_DIR/foo:.
I understand the first (normal expansion), but this avoids your suggestion.
The second one confuses me. Using ${output_directory) instead of foo (for
correct linking), the last one can be some workaround for my problem. But I
don't want to have my output directory in delivered executables. Also it's a
little bit confusing. Either all relative paths should be expanded or none. I
permute this is bug on multi-path strings.
> (I think usually this is not considered a good idea)
Yes, but this is not in my hands. One big problem of this solution is, that
the executable must be started from the directory, the executable lives in.
My preference would be an installer which sets the correct rpath (and provide
rpath . additionally until the installation process is accepted from all).
Unfortunately cpack doesn't provide this (currently?).
As I understand you in http://sourceware.org/ml/binutils/2008-01/msg00021.html
you are searching/waiting for a similar solution, too. A difference might be
that 'make install' (with set( CMAKE_INSTALL_RPATH ${output_dir} ) is ok for
my. But I can neither run 'make install' nor copy my installed files (with
rpath pointing to my path) on customer machines.
Have you found a solution for the rpath changing problem?
Jörg
More information about the CMake
mailing list