mirror of
https://github.com/CLIUtils/CLI11.git
synced 2026-01-19 04:52:08 +00:00
chore: require CMake 3.14+ (#1182)
3.15 is a good minimum these days, and what pybind11, etc. now use. (Edit: we are using some really old docker containers, so let's do 3.14+ for now). --------- Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
This commit is contained in:
2
.github/actions/quick_cmake/action.yml
vendored
2
.github/actions/quick_cmake/action.yml
vendored
@@ -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"
|
||||
|
||||
30
.github/workflows/tests.yml
vendored
30
.github/workflows/tests.yml
vendored
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -32,6 +32,4 @@ target_compile_options(
|
||||
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:${unix-warnings}
|
||||
$<$<BOOL:${CLI11_WARNINGS_AS_ERRORS}>:-Werror>>)
|
||||
|
||||
if(NOT CMAKE_VERSION VERSION_LESS 3.13)
|
||||
target_link_options(CLI11_warnings INTERFACE $<$<BOOL:${CLI11_FORCE_LIBCXX}>:-stdlib=libc++>)
|
||||
endif()
|
||||
target_link_options(CLI11_warnings INTERFACE $<$<BOOL:${CLI11_FORCE_LIBCXX}>:-stdlib=libc++>)
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user