Commit 94aa36ef4418f559e505150d73da523c4f9aee58

Edward Thomson 2018-02-02T17:56:15

cmake: test for CMP0051 instead of version check We can use policy checks to see if a policy exists in cmake, like CMP0051, instead of relying on the version.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4d5ad9d..e4d5f4b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -14,7 +14,7 @@
 PROJECT(libgit2 C)
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11)
 CMAKE_POLICY(SET CMP0015 NEW)
-IF (NOT CMAKE_VERSION VERSION_LESS 3.1)
+IF (POLICY CMP0051)
 	CMAKE_POLICY(SET CMP0051 NEW)
 ENDIF()