Commit 1f9b4970c5227909aedd79249eae16585712343f

Patrick Steinhardt 2019-10-11T07:44:10

Merge pull request #5260 from pks-t/pks/cmake3 cmake: update minimum CMake version to v3.5.1

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8e8ee3b..3c44775 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,7 +12,7 @@
 # > cmake --build . --target install
 
 PROJECT(libgit2 C)
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11)
+CMAKE_MINIMUM_REQUIRED(VERSION 3.5.1)
 CMAKE_POLICY(SET CMP0015 NEW)
 IF(POLICY CMP0051)
 	CMAKE_POLICY(SET CMP0051 NEW)
@@ -335,10 +335,5 @@ IF(BUILD_FUZZERS)
 	ADD_SUBDIRECTORY(fuzzers)
 ENDIF()
 
-IF(CMAKE_VERSION VERSION_GREATER 3)
-	FEATURE_SUMMARY(WHAT ENABLED_FEATURES DESCRIPTION "Enabled features:")
-	FEATURE_SUMMARY(WHAT DISABLED_FEATURES DESCRIPTION "Disabled features:")
-ELSE()
-	PRINT_ENABLED_FEATURES()
-	PRINT_DISABLED_FEATURES()
-ENDIF()
+FEATURE_SUMMARY(WHAT ENABLED_FEATURES DESCRIPTION "Enabled features:")
+FEATURE_SUMMARY(WHAT DISABLED_FEATURES DESCRIPTION "Disabled features:")
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index a805649..9d2b022 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -333,16 +333,8 @@ SET_TARGET_PROPERTIES(git2internal PROPERTIES C_STANDARD 90)
 IDE_SPLIT_SOURCES(git2internal)
 LIST(APPEND LIBGIT2_OBJECTS $<TARGET_OBJECTS:git2internal>)
 
-IF (${CMAKE_VERSION} VERSION_LESS 2.8.12)
-	INCLUDE_DIRECTORIES(${LIBGIT2_INCLUDES})
-	INCLUDE_DIRECTORIES(SYSTEM ${LIBGIT2_SYSTEM_INCLUDES})
-ELSE()
-	TARGET_INCLUDE_DIRECTORIES(git2internal
-	    PRIVATE ${LIBGIT2_INCLUDES}
-	    PUBLIC ${libgit2_SOURCE_DIR}/include)
-	TARGET_INCLUDE_DIRECTORIES(git2internal
-	    SYSTEM PRIVATE ${LIBGIT2_SYSTEM_INCLUDES})
-ENDIF()
+TARGET_INCLUDE_DIRECTORIES(git2internal PRIVATE ${LIBGIT2_INCLUDES} PUBLIC ${libgit2_SOURCE_DIR}/include)
+TARGET_INCLUDE_DIRECTORIES(git2internal SYSTEM PRIVATE ${LIBGIT2_SYSTEM_INCLUDES})
 
 SET(LIBGIT2_OBJECTS ${LIBGIT2_OBJECTS} PARENT_SCOPE)
 SET(LIBGIT2_INCLUDES ${LIBGIT2_INCLUDES} PARENT_SCOPE)
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index c7fe8e1..16bad0f 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -42,12 +42,7 @@ ADD_EXECUTABLE(libgit2_clar ${SRC_CLAR} ${SRC_TEST} ${LIBGIT2_OBJECTS})
 SET_TARGET_PROPERTIES(libgit2_clar PROPERTIES C_STANDARD 90)
 SET_TARGET_PROPERTIES(libgit2_clar PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${libgit2_BINARY_DIR})
 
-IF (${CMAKE_VERSION} VERSION_LESS 2.8.12)
-	# Already handled by a global INCLUDE_DIRECTORY()
-ELSE()
-	TARGET_INCLUDE_DIRECTORIES(libgit2_clar PRIVATE ../src PUBLIC ../include)
-ENDIF()
-
+TARGET_INCLUDE_DIRECTORIES(libgit2_clar PRIVATE ../src PUBLIC ../include)
 TARGET_LINK_LIBRARIES(libgit2_clar ${LIBGIT2_LIBS})
 IDE_SPLIT_SOURCES(libgit2_clar)