Explicitly use (new) default OS X rpath policy if present.
- CMake 3.0+ prefers the use of @rpath, and CMake 3.2+ produces a
developer warning if this policy is not set, thus if present we
explicitly specify the new default behaviour.
- http://www.cmake.org/cmake/help/v3.2/policy/CMP0042.html
- Also remove unnecessary check for presence of cmake_policy(), as it
exists in all versions of CMake >= 2.8 (our minimum required version).
Change-Id: Iacbf8186bee4bf07d8a53068fd528cd6237c5efb
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4ab2e31..e33a43e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -32,9 +32,10 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0)
CMAKE_POLICY(VERSION 2.8)
-IF (COMMAND cmake_policy)
- CMAKE_POLICY(SET CMP0003 NEW)
-ENDIF (COMMAND cmake_policy)
+CMAKE_POLICY(SET CMP0003 NEW)
+IF (POLICY CMP0042)
+ CMAKE_POLICY(SET CMP0042 NEW)
+ENDIF()
PROJECT(CERES C CXX)