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.
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/")