[CMake] Use CMAKE_MACOSX_RPATH to link a library outside build tree
Clinton Stimpson
clinton at elemtech.com
Mon Aug 24 10:22:13 EDT 2015
On Sunday, August 23, 2015 04:46:17 AM Oleg Zhylin via CMake wrote:
> Hi All,
> I still need help with 0015708: Use CMAKE_MACOSX_RPATH to link a library
> outside build tree - MantisBT. Could you please suggest are there any CMake
> mechanisms to ensure a library outside build tree on mac is linked with
> either @rpath and using hard-coded path on build machine? Either option
> would actually help.
> | |
> | | | | | |
> | 0015708: Use CMAKE_MACOSX_RPATH to link a library outside build tree -
> | MantisBTThis issue is Mac OS X specific. I would like to link a library
> | lib_xxx that sits outside my build tree at some arbitrary location. It
> | will be at the same location in all systems. |
> |
> | View on www.cmake.org | Preview by Yahoo |
> |
> | |
>
> WBR ovz
There is no CMake mechanism to control references when linking with external
libraries. If you still want to do this, you'll need to edit the references
in your binaries after linking.
You'll be much better off if you modify the external libraries.
For @rpath, use a command like this:
<install_name_tool -id @rpath/libwupienginemac.dylib
/path/to/libwupienginemac.dylib>
or
For absolute path
<install_name_tool -id /path/to/libwupienginemac.dylib
/path/to/libwupienginemac.dylib>
If those external libraries have additional dependencies using
@executable_path, you may also need to use "install_name_tool -change ..."
Clint
More information about the CMake
mailing list