[CMake] INSTALL_NAME_DIR ignored in add_library?

Vittorio Giovara vittorio.giovara at gmail.com
Mon Jun 10 20:27:49 EDT 2013


Hi, I'm trying to modify the install_name path of a library created with
add_library(SHARED) on MacOS, using Unix Makefiles, cmake 2.8.10.2 and
2.8.11.

I've tried setting the global variable
  set(CMAKE_INSTALL_NAME_DIR "@executable_path/../Frameworks/")
I've tried editing the target properties with
  set_target_properties(aname PROPERTIES INSTALL_NAME_DIR
"@executable_path/../Frameworks/")
and also tried manually editing the link flags with
  set_target_properties(aname PROPERTIES LINK_FLAGS "-install_name
@executable_path/../Frameworks/libaname.dylib")

However NONE of these methods worked! In the link line there is always an
-install_name command that just outputs the name of the library. I've dug
around a lot before resorting to the mailing list and found this old
threads like http://www.cmake.org/pipermail/cmake/2011-April/043826.html or
http://www.cmake.org/pipermail/cmake/2010-August/038959.html and and a few
patches that are supposedly working like
http://robotcub-hackers.2198711.n2.nabble.com/CMake-RPATH-in-OS-X-td7578206.htmlso
I don't understand what's wrong.

I've even doublechecked with get_target_property and the INSTALL_NAME_DIR
is correctly initialized.
So I'm completely out of options, any help is appreciated.
Vittorio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130611/40936f44/attachment.htm>


More information about the CMake mailing list