Skip to content

Commit 94aa36e

Browse files
committed
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 parent 8abd514 commit 94aa36e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
PROJECT(libgit2 C)
1515
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11)
1616
CMAKE_POLICY(SET CMP0015 NEW)
17-
IF (NOT CMAKE_VERSION VERSION_LESS 3.1)
17+
IF (POLICY CMP0051)
1818
CMAKE_POLICY(SET CMP0051 NEW)
1919
ENDIF()
2020

0 commit comments

Comments
 (0)