[CMake] rpath trouble on macosx: cmake 2.8.9 ignores INSTALL_NAME_DIR and INSTALL_RPATH?

Dan Kegel dank at kegel.com
Tue Sep 10 19:03:08 EDT 2013


On Tue, Sep 10, 2013 at 10:43 AM, Clinton Stimpson <clinton at elemtech.com> wrote:
> Using the INSTALL_RPATH property doesn't work correctly unless you use CMake
> 2.8.12 with the target property MACOSX_RPATH=1.

Done, example http://kegel.com/macosx/rpath/demo2/CMakeLists.txt

> If you want it to work with the older version of CMake, then you need to set
> the -Wl,-rpath linker flag yourself using the LINK_FLAGS target property.

Done, example http://kegel.com/macosx/rpath/demo3/CMakeLists.txt

Next question: will cmake support relative rpaths, as in the example at
http://kegel.com/macosx/rpath/demo4/demo4.txt ?
i.e.
  gcc -shared foo.c -install_name @rpath/lib/foo.so -o foo.so
  gcc -Wl,-rpath, at loader_path/.. x.c foo.so
?  (I know, I should download and build trunk, but I'm pathetically lazy.)
- Dan


More information about the CMake mailing list