Commit 3956679c by Patrick Steinhardt

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 ebabb88f (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()`.
parent 2e7d4579
......@@ -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/")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment