Commit 6416b91ffeb6863ce331f9370f817b08b260689d

Edward Thomson 2018-02-02T17:58:44

cmake: enable policy CMP0042 Enable CMake policy CMP0042, if supported: > CMake 2.8.12 and newer has support for using ``@rpath`` in a target's > install name. This was enabled by setting the target property > ``MACOSX_RPATH``. The ``@rpath`` in an install name is a more > flexible and powerful mechanism than ``@executable_path`` or > ``@loader_path`` for locating shared libraries.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e4d5f4b..a2a8a74 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,6 +17,9 @@ CMAKE_POLICY(SET CMP0015 NEW)
 IF (POLICY CMP0051)
 	CMAKE_POLICY(SET CMP0051 NEW)
 ENDIF()
+IF (POLICY CMP0042)
+	CMAKE_POLICY(SET CMP0042 NEW)
+ENDIF()
 
 # Add find modules to the path
 SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${libgit2_SOURCE_DIR}/cmake/Modules/")