cmake and RPATH

Brad King brad.king at kitware.com
Fri Feb 24 19:30:33 CET 2006


Benjamin Reed wrote:
> I don't have time to test at the moment, but how does this work on
> platforms like OSX (and I think HPUX?), which encode the path into
> shared libraries regardless of whether you ask for rpath or not?

I think HPUX works just like any other UNIX with rpath support but
perhaps with different flags.

On OSX there is no rpath but there is an "install_name" that may contain
a path as well as the name of the .dylib file.  By default the
install_name is set to the value of the -o option on the link line.  It
can be set explicitly using the -install_name option.

I've just committed changes to CMake to support install_name in the same 
way that RPATH is supported on other platforms.  There is a new target 
property INSTALL_NAME_DIR that sets the directory component of the 
install_name for use in the installed targets.  By default the targets 
get built with an install_name that points at the build tree location of 
shared libraries and then install_name_tool is used to remap these paths 
in the installed copies (at install time).  This will give the same 
build-tree and install-tree behavior as occurs with the RPATH support on 
the other platforms.  The install_name_tool remapping is the equivalent 
to relinking in the RPATH support.

-Brad


More information about the Kde-buildsystem mailing list