On Tuesday, September 10, 2013 04:03:08 PM Dan Kegel wrote: > On Tue, Sep 10, 2013 at 10:43 AM, Clinton Stimpson <clin...@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
Actually, you want either of these set_target_properties(foo PROPERTIES INSTALL_NAME_DIR "@rpath") or set_target_properties(foo PROPERTIES MACOSX_RPATH 1) There is no need to set it as a property on target x. > > > 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,@loader_path/.. x.c foo.so > ? (I know, I should download and build trunk, but I'm pathetically lazy.) > - Dan Yes, it'll work in 2.8.12 like this. set_target_properties(x PROPERTIES INSTALL_RPATH "@loader_path/..") Clint -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake