From de4d4a1ff9459ccd1e034d70479f1cfd48fefe28 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christoph=20Gr=C3=BCninger?= <gruenich@dune-project.org>
Date: Wed, 1 Jul 2015 23:03:46 +0200
Subject: [PATCH] [CMake][Release] Fix @rpath for CMake older then 2.8.12.

Setting a policy must be guarded as older CMake version do not
know about the policy.
---
 cmake/modules/DuneMacros.cmake | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/cmake/modules/DuneMacros.cmake b/cmake/modules/DuneMacros.cmake
index abb335a53..9bcc835da 100644
--- a/cmake/modules/DuneMacros.cmake
+++ b/cmake/modules/DuneMacros.cmake
@@ -77,7 +77,10 @@
 #
 
 # Make CMake use rpath on OS X
-cmake_policy(SET CMP0042 NEW)
+if(POLICY CMP0042)
+  # this policy only needed for CMake older then 2.8.12
+  cmake_policy(SET CMP0042 NEW)
+endif()
 
 enable_language(C) # Enable C to skip CXX bindings for some tests.
 
-- 
GitLab