Skip to content

Commit 3956679

Browse files
committed
cmake: remove policies
The `CMAKE_MINIUM_REQUIRE()` function not only sets up the minimum required CMake version of a project, but it will also at the same time set the CMake policy version. In effect this means that all policies that have been introduced before the minimum CMake version will be enabled automatically. When updating our minimum required version ebabb88 (cmake: update minimum CMake version to v3.5.1, 2019-10-10), we didn't remove any of the policies we've been manually enabling. The newest CMake policy we've been enabling is CMP0054, which was introduced back in CMake v3.1. As a result, we can now just remove all manual calls to `CMAKE_POLICY()`.
1 parent 2e7d457 commit 3956679

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

CMakeLists.txt

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,9 @@
1111
# Install:
1212
# > cmake --build . --target install
1313

14-
PROJECT(libgit2 C)
1514
CMAKE_MINIMUM_REQUIRED(VERSION 3.5.1)
16-
CMAKE_POLICY(SET CMP0015 NEW)
17-
IF(POLICY CMP0051)
18-
CMAKE_POLICY(SET CMP0051 NEW)
19-
ENDIF()
20-
IF(POLICY CMP0042)
21-
CMAKE_POLICY(SET CMP0042 NEW)
22-
ENDIF()
23-
IF(POLICY CMP0054)
24-
CMAKE_POLICY(SET CMP0054 NEW)
25-
ENDIF()
15+
16+
project(libgit2 C)
2617

2718
# Add find modules to the path
2819
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${libgit2_SOURCE_DIR}/cmake/")

0 commit comments

Comments
 (0)