summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2020-04-03 20:08:02 +0200
committerPatrick Steinhardt <ps@pks.im>2020-06-01 14:06:20 +0200
commit3956679c13a5005db128c52ce56eb1b4ced4df82 (patch)
treedcd0fa5ca26cb6367f40fc1b7338af8aaaa84565
parent2e7d457987eb19b5ef7c8659d843f2fe01a66506 (diff)
downloadlibgit2-3956679c13a5005db128c52ce56eb1b4ced4df82.tar.gz
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 ebabb88f2 (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()`.
-rw-r--r--CMakeLists.txt13
1 files changed, 2 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7d232f433..9b3f7cca1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,18 +11,9 @@
# Install:
# > cmake --build . --target install
-PROJECT(libgit2 C)
CMAKE_MINIMUM_REQUIRED(VERSION 3.5.1)
-CMAKE_POLICY(SET CMP0015 NEW)
-IF(POLICY CMP0051)
- CMAKE_POLICY(SET CMP0051 NEW)
-ENDIF()
-IF(POLICY CMP0042)
- CMAKE_POLICY(SET CMP0042 NEW)
-ENDIF()
-IF(POLICY CMP0054)
- CMAKE_POLICY(SET CMP0054 NEW)
-ENDIF()
+
+project(libgit2 C)
# Add find modules to the path
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${libgit2_SOURCE_DIR}/cmake/")