2 # enable @rpath in the install name for any shared library being built
3 # note: it is planned that a future version of CMake will enable this by default
4 set(CMAKE_MACOSX_RPATH 1)
6 # Always use full RPATH
7 # http://www.cmake.org/Wiki/CMake_RPATH_handling
8 # http://www.kitware.com/blog/home/post/510
10 # use, i.e. don't skip the full RPATH for the build tree
11 set(CMAKE_SKIP_BUILD_RPATH FALSE)
13 # when building, don't use the install RPATH already
14 # (but later on when installing)
15 set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
17 # add the automatically determined parts of the RPATH
18 # which point to directories outside the build tree to the install RPATH
19 set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
21 # the RPATH to be used when installing, but only if it's not a system directory
22 list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
23 if("${isSystemDir}" STREQUAL "-1")
24 set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
25 endif("${isSystemDir}" STREQUAL "-1")