]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Require CMake 3.10 (#885)
authorGregor Jasny <gregor.jasny@logmein.com>
Tue, 6 Jul 2021 10:49:08 +0000 (12:49 +0200)
committerGitHub <noreply@github.com>
Tue, 6 Jul 2021 10:49:08 +0000 (12:49 +0200)
Fixes #884.

CMakeLists.txt
cmake/CcachePackConfig.cmake
cmake/CodeAnalysis.cmake
test/CMakeLists.txt

index 8824a5b1ecf8914a0e595e3d38eb17159fab0d42..dd1e76e6108a317ab7215507f724720acb2e75b8 100644 (file)
@@ -1,8 +1,4 @@
-cmake_minimum_required(VERSION 3.4.3)
-
-if(POLICY CMP0067)
-  cmake_policy(SET CMP0067 NEW)
-endif()
+cmake_minimum_required(VERSION 3.10)
 
 project(ccache LANGUAGES C CXX)
 if(MSVC)
@@ -76,12 +72,9 @@ include(StandardWarnings)
 include(CIBuildType)
 include(DefaultBuildType)
 
-if(NOT ${CMAKE_VERSION} VERSION_LESS "3.9")
-  cmake_policy(SET CMP0069 NEW)
-  option(ENABLE_IPO "Enable interprocedural (link time, LTO) optimization" OFF)
-  if(ENABLE_IPO)
-    set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
-  endif()
+option(ENABLE_IPO "Enable interprocedural (link time, LTO) optimization" OFF)
+if(ENABLE_IPO)
+  set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
 endif()
 
 #
index a35949da5224d8240d13193ff5c8ab15eb65b43e..c41aeca998c618f59fcdc7b12f3a37746ac9b721 100644 (file)
@@ -1,10 +1,6 @@
 # Note: This is part of CMakeLists.txt file, not to be confused with
 # CPackConfig.cmake.
 
-if(${CMAKE_VERSION} VERSION_LESS "3.9")
-  set(CPACK_PACKAGE_DESCRIPTION "${CMAKE_PROJECT_DESCRIPTION}")
-endif()
-
 # From CcacheVersion.cmake.
 set(CPACK_PACKAGE_VERSION ${CCACHE_VERSION})
 
index 1380fab0b5c7b196a62e9128b2c47c5a120faa66..0d3cf024a6fb3465d5f703a18f1acf093daf84da 100644 (file)
@@ -1,38 +1,30 @@
 option(ENABLE_CPPCHECK "Enable static analysis with Cppcheck" OFF)
 if(ENABLE_CPPCHECK)
-  if(${CMAKE_VERSION} VERSION_LESS "3.10")
-    message(WARNING "Cppcheck requires CMake 3.10")
+  find_program(CPPCHECK_EXE cppcheck)
+  mark_as_advanced(CPPCHECK_EXE) # Don't show in CMake UIs
+  if(CPPCHECK_EXE)
+    set(CMAKE_CXX_CPPCHECK
+        ${CPPCHECK_EXE}
+        --suppressions-list=${CMAKE_SOURCE_DIR}/misc/cppcheck-suppressions.txt
+        --inline-suppr
+        -q
+        --enable=all
+        --force
+        --std=c++14
+        -I ${CMAKE_SOURCE_DIR}
+        --template="cppcheck: warning: {id}:{file}:{line}: {message}"
+        -i src/third_party)
   else()
-    find_program(CPPCHECK_EXE cppcheck)
-    mark_as_advanced(CPPCHECK_EXE) # Don't show in CMake UIs
-    if(CPPCHECK_EXE)
-      set(CMAKE_CXX_CPPCHECK
-          ${CPPCHECK_EXE}
-          --suppressions-list=${CMAKE_SOURCE_DIR}/misc/cppcheck-suppressions.txt
-          --inline-suppr
-          -q
-          --enable=all
-          --force
-          --std=c++14
-          -I ${CMAKE_SOURCE_DIR}
-          --template="cppcheck: warning: {id}:{file}:{line}: {message}"
-          -i src/third_party)
-    else()
-      message(WARNING "Cppcheck requested but executable not found")
-    endif()
+    message(WARNING "Cppcheck requested but executable not found")
   endif()
 endif()
 
 option(ENABLE_CLANG_TIDY "Enable static analysis with Clang-Tidy" OFF)
 if(ENABLE_CLANG_TIDY)
-  if(${CMAKE_VERSION} VERSION_LESS "3.6")
-    message(WARNING "Clang-Tidy requires CMake 3.6")
+  find_program(CLANGTIDY clang-tidy)
+  if(CLANGTIDY)
+    set(CMAKE_CXX_CLANG_TIDY ${CLANGTIDY})
   else()
-    find_program(CLANGTIDY clang-tidy)
-    if(CLANGTIDY)
-      set(CMAKE_CXX_CLANG_TIDY ${CLANGTIDY})
-    else()
-      message(SEND_ERROR "Clang-Tidy requested but executable not found")
-    endif()
+    message(SEND_ERROR "Clang-Tidy requested but executable not found")
   endif()
 endif()
index 3dd1a36bd187199d59f5d834baa603162706644d..3e28a03e032bf6ffc7bcc2b34712948dce10d8e4 100644 (file)
@@ -7,21 +7,8 @@ function(addtest name)
   set_tests_properties(
     "test.${name}"
     PROPERTIES
-    ENVIRONMENT "CCACHE=$<TARGET_FILE:ccache>;EXIT_IF_SKIPPED=true")
-
-  if(${CMAKE_VERSION} VERSION_LESS "3.9")
-    # Older CMake versions treat skipped tests as errors. Therefore, resort to
-    # parsing output for those cases (exit code is not considered). Skipped
-    # tests will appear as "Passed".
-    set_tests_properties(
-      "test.${name}"
-      PROPERTIES
-      PASS_REGULAR_EXPRESSION "PASSED|Passed|Skipped"
-      FAIL_REGULAR_EXPRESSION "[Ww]arning|[Ff]ail|[Er]rror")
-  else()
-    set_tests_properties("test.${name}" PROPERTIES SKIP_RETURN_CODE 125)
-  endif()
-
+    ENVIRONMENT "CCACHE=$<TARGET_FILE:ccache>;EXIT_IF_SKIPPED=true"
+    SKIP_RETURN_CODE 125)
 endfunction()
 
 if(${CMAKE_VERSION} VERSION_LESS "3.15")