aboutsummaryrefslogtreecommitdiff
path: root/cmake/CMakeLists.txt
diff options
context:
space:
mode:
authorMizux <dev@mizux.net>2018-05-22 21:52:07 +0200
committerFeng Xiao <xfxyjwf@gmail.com>2018-05-22 12:52:07 -0700
commit7306f549bf913c301fb141796b24c5bb7b0ed53a (patch)
tree917a962e0809695edd994618d83073e9686f9575 /cmake/CMakeLists.txt
parentd39a73f2038194c415c482514242ffb5268e9d7e (diff)
downloadprotobuf-7306f549bf913c301fb141796b24c5bb7b0ed53a.tar.gz
protobuf-7306f549bf913c301fb141796b24c5bb7b0ed53a.tar.bz2
protobuf-7306f549bf913c301fb141796b24c5bb7b0ed53a.zip
CMake OSX rpath management (#4620)
* CMake: Add comment for CMP0048 * CMake: osx use @rpath/ as target's install name (CMP0042) On MacoS library should use @rpath/ as prefix path instead of absolute build path e.g. otool -L libprotobuf.dylib libprotobuf.dylib: @rpath/libprotobuf.dylib (...) ... * CMake: add rpath to target for LINUX and APPLE
Diffstat (limited to 'cmake/CMakeLists.txt')
-rw-r--r--cmake/CMakeLists.txt6
1 files changed, 5 insertions, 1 deletions
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index ada9dc25..ece39f7f 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -7,7 +7,11 @@ endif()
# CMake policies
cmake_policy(SET CMP0022 NEW)
-
+# On MacOS use @rpath/ for target's install name prefix path
+if (POLICY CMP0042)
+ cmake_policy(SET CMP0042 NEW)
+endif ()
+# Clear VERSION variables when no VERSION is given to project()
if(POLICY CMP0048)
cmake_policy(SET CMP0048 NEW)
endif()