[CMake] Installed project with shared libs

Brad King brad.king at kitware.com
Fri Feb 24 13:06:33 EST 2006


Sean McBride wrote:
> On 2006-02-23 18:21, Brad King said:
>>I'm actually in the middle of implementing this now.  You can in fact 
>>turn it off and make the system use DYLD_LIBRARY_PATH to find it.  The 
>>library is created with an "install_name" which is copied into targets 
>>that link to it.  This name can be a full path or just a name.
> 
> It can also be one of a couple of 'special forms': @executable_path and
> @loader_path.
> 
> Can/will cmake be able to support these forms?  For example, I'd like to
> be able to build vtk as dylibs and then place said dylibs in my
> application's bundle.  This means that the dylib's 'install_name' must
> be "@executable_path/Contents/Frameworks/".

This is possible in my current implementation (not yet committed).  You 
will be able to do something like

SET_TARGET_PROPERTIES(mySharedLib PROPERTIES
   INSTALL_NAME_DIR "@executable_path/some/relative/path"
)

and the installed library will get that install_name.

> I also suggest that when cmake builds dylibs it always use the '-
> headerpad_max_install_names' option so that the install_name can be
> easily changed after the fact, if need be.  See the 'install_name_tool'
> man page.

This is done in my working copy and will be included in the upcoming commit.

-Brad


More information about the CMake mailing list