diff --git a/.github/actions/quick_cmake/action.yml b/.github/actions/quick_cmake/action.yml index 2438cf06..5ca72003 100644 --- a/.github/actions/quick_cmake/action.yml +++ b/.github/actions/quick_cmake/action.yml @@ -1,5 +1,5 @@ name: Quick CMake config -description: "Runs CMake 3.10+ (if already setup)" +description: "Runs CMake 3.14+ (if already setup)" inputs: args: description: "Other arguments" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 63b72d04..4f510c01 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -265,36 +265,11 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Check CMake 3.10 + - name: Check CMake 3.14 uses: ./.github/actions/quick_cmake with: - cmake-version: "3.10" - if: success() || failure() - - - name: Check CMake 3.11 - uses: ./.github/actions/quick_cmake - with: - cmake-version: "3.11" - if: success() || failure() - - - name: Check CMake 3.12 - uses: ./.github/actions/quick_cmake - with: - cmake-version: "3.12" - if: success() || failure() - - - name: Check CMake 3.13 - uses: ./.github/actions/quick_cmake - with: - cmake-version: "3.13" - if: success() || failure() - - - name: Check CMake 3.14.7 - uses: ./.github/actions/quick_cmake - with: - cmake-version: "3.14.7" + cmake-version: "3.14" args: -DCLI11_SANITIZERS=ON -DCLI11_BUILD_EXAMPLES_JSON=ON - if: success() || failure() - name: Check CMake 3.15 uses: ./.github/actions/quick_cmake @@ -318,7 +293,6 @@ jobs: uses: ./.github/actions/quick_cmake with: cmake-version: "3.17" - if: success() || failure() - name: Check CMake 3.18 uses: ./.github/actions/quick_cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a9da704..8bd7a210 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.10...4.0) -# Note: this is a header only library. If you have an older CMake than 3.10, +cmake_minimum_required(VERSION 3.14...4.0) +# Note: this is a header only library. If you have an older CMake than 3.14, # just add the CLI11/include directory and that's all you need to do. set(VERSION_REGEX "#define CLI11_VERSION[ \t]+\"(.+)\"") @@ -39,16 +39,13 @@ endif() include(CMakeDependentOption) include(GNUInstallDirs) -if(NOT CMAKE_VERSION VERSION_LESS 3.11) - include(FetchContent) -endif() +include(FetchContent) list(APPEND force-libcxx "CMAKE_CXX_COMPILER_ID STREQUAL \"Clang\"") list(APPEND force-libcxx "CMAKE_SYSTEM_NAME STREQUAL \"Linux\"") list(APPEND force-libcxx "CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME") list(APPEND build-docs "CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME") -list(APPEND build-docs "NOT CMAKE_VERSION VERSION_LESS 3.11") list(APPEND build-docs "Doxygen_FOUND") # Necessary to support paths with spaces, see #457 diff --git a/book/code/CMakeLists.txt b/book/code/CMakeLists.txt index 769ba520..3113fc6b 100644 --- a/book/code/CMakeLists.txt +++ b/book/code/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 3.11...3.31) +cmake_minimum_required(VERSION 3.14...4.0) project(CLI11_Examples LANGUAGES CXX) -# Using CMake 3.11's ability to set imported interface targets +# Using CMake ability to set imported interface targets add_library(CLI11::CLI11 IMPORTED INTERFACE) target_include_directories(CLI11::CLI11 INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/../../include") target_compile_features(CLI11::CLI11 INTERFACE cxx_std_11) diff --git a/cmake/CLI11Warnings.cmake b/cmake/CLI11Warnings.cmake index 8b4b499d..7ca596f5 100644 --- a/cmake/CLI11Warnings.cmake +++ b/cmake/CLI11Warnings.cmake @@ -32,6 +32,4 @@ target_compile_options( $<$>:${unix-warnings} $<$:-Werror>>) -if(NOT CMAKE_VERSION VERSION_LESS 3.13) - target_link_options(CLI11_warnings INTERFACE $<$:-stdlib=libc++>) -endif() +target_link_options(CLI11_warnings INTERFACE $<$:-stdlib=libc++>) diff --git a/single-include/CMakeLists.txt b/single-include/CMakeLists.txt index f11032f9..01bc78e9 100644 --- a/single-include/CMakeLists.txt +++ b/single-include/CMakeLists.txt @@ -1,16 +1,9 @@ if(CLI11_SINGLE_FILE) # Single file test - if(CMAKE_VERSION VERSION_LESS 3.12) - find_package(PythonInterp REQUIRED) - add_executable(Python::Interpreter IMPORTED) - set_target_properties(Python::Interpreter PROPERTIES IMPORTED_LOCATION "${PYTHON_EXECUTABLE}" - VERSION "${PYTHON_VERSION_STRING}") - else() - find_package( - Python - COMPONENTS Interpreter - REQUIRED) - endif() + find_package( + Python + COMPONENTS Interpreter + REQUIRED) file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/single-include") add_custom_command( diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 870666c1..26f9b6e4 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,4 +1,4 @@ -if(CLI11_SANITIZERS AND ${CMAKE_VERSION} VERSION_GREATER "3.15.0") +if(CLI11_SANITIZERS AND ${CMAKE_VERSION} VERSION_GREATER "3.15") message(STATUS "Using arsenm/sanitizers-cmake") FetchContent_Declare( sanitizers @@ -320,7 +320,7 @@ if(CLI11_INSTALL_PACKAGE_TESTS) file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/find_package_tests") - if(MSVC AND ${CMAKE_VERSION} VERSION_GREATER 3.12.9) + if(MSVC) # Tests for other CMake projects including and using CLI11 using find_package add_test( NAME find-package-testsA diff --git a/tests/find_package_tests/CMakeLists.txt b/tests/find_package_tests/CMakeLists.txt index 6d5aa277..28c52ae2 100644 --- a/tests/find_package_tests/CMakeLists.txt +++ b/tests/find_package_tests/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.10...3.26) +cmake_minimum_required(VERSION 3.14...4.0) project(CLI11-find-package-test) diff --git a/tests/package_config_tests/CMakeLists.txt b/tests/package_config_tests/CMakeLists.txt index a775e8cf..62255724 100644 --- a/tests/package_config_tests/CMakeLists.txt +++ b/tests/package_config_tests/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.10...3.26) +cmake_minimum_required(VERSION 3.14...4.0) project(CLI11-package-config-test)