From 3956679c13a5005db128c52ce56eb1b4ced4df82 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Fri, 3 Apr 2020 20:08:02 +0200 Subject: [PATCH] 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()`. --- CMakeLists.txt | 13 ++----------- 1 file 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/")