[cmake-developers] rpaths on Mac

Brad King brad.king at kitware.com
Mon Nov 21 13:53:23 EST 2011


On 11/17/2011 5:26 PM, Clinton Stimpson wrote:
> To get the desired behavior, we can automate
>    set(CMAKE_INSTALL_NAME_DIR "@rpath")
> I think it would be nice to have it be @rpath even in the build tree, but I
> don't see that as a requirement.  It could help avoid install name changes at
> install time, or allow people to copy the libraries.
>
>>
>>> Would that have undesirable side effects?
>>
>> Since the original RPATH support in CMake pre-dated the feature on OS X
>> we implemented INSTALL_NAME_DIR instead.  We need to investigate how the
>> two features would/should interact.
>
> We still need a separate INSTALL_NAME_DIR setting and RPATH setting.
> But from what I can tell, INSTALL_NAME_DIR can be fixed to @rpath.
[snip]
> Any idea what the switch can be called?

Instead of an explicit switch perhaps we can simply inspect INSTALL_NAME_DIR.
If it is "@rpath" then we activate the RPATH features for the target.  The
OS X binutils require install_name to start in "@rpath/" to tell dyld to use
the rpath anyway.

-Brad



More information about the cmake-developers mailing list