diff options
author | Clinton Stimpson <clinton@elemtech.com> | 2013-04-27 04:04:44 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-06-03 13:42:05 (GMT) |
commit | 94e7fef2268ba9d31bd31834f05f6d0c2ffe5a18 (patch) | |
tree | 4676709c61c7f1d8352f5e9729bb875cb2816e34 /Modules/Platform/Darwin.cmake | |
parent | cbe3f2072bdd181660bc4f9174a73febd3ed5230 (diff) | |
download | CMake-94e7fef2268ba9d31bd31834f05f6d0c2ffe5a18.zip CMake-94e7fef2268ba9d31bd31834f05f6d0c2ffe5a18.tar.gz CMake-94e7fef2268ba9d31bd31834f05f6d0c2ffe5a18.tar.bz2 |
OS X: Add RPATH support for Mac.
RPATH support is activated on targets that have the MACOSX_RPATH
property turned on.
For install time, it is also useful to set INSTALL_RPATH to help
find dependent libraries with an @rpath in their install name.
Also adding detection of rpath conflicts when using frameworks.
Diffstat (limited to 'Modules/Platform/Darwin.cmake')
-rw-r--r-- | Modules/Platform/Darwin.cmake | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake index 6e5d449..f0652b9 100644 --- a/Modules/Platform/Darwin.cmake +++ b/Modules/Platform/Darwin.cmake @@ -30,6 +30,11 @@ set(CMAKE_SHARED_MODULE_SUFFIX ".so") set(CMAKE_MODULE_EXISTS 1) set(CMAKE_DL_LIBS "") +# Enable rpath support for 10.5 and greater where it is known to work. +if("${DARWIN_MAJOR_VERSION}" GREATER 8) + set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,") +endif() + set(CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG "-compatibility_version ") set(CMAKE_C_OSX_CURRENT_VERSION_FLAG "-current_version ") set(CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG "${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}") |