mirror of
https://github.com/CLIUtils/CLI11.git
synced 2025-04-29 04:03:52 +00:00
feat: increase min CMake to 3.10 (#1084)
Close https://github.com/CLIUtils/CLI11/issues/1082. Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
This commit is contained in:
parent
a68a48b7f1
commit
d9473a486b
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.5+ (if already setup)"
|
||||
description: "Runs CMake 3.10+ (if already setup)"
|
||||
inputs:
|
||||
args:
|
||||
description: "Other arguments"
|
||||
|
40
.github/workflows/tests.yml
vendored
40
.github/workflows/tests.yml
vendored
@ -238,36 +238,6 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Check CMake 3.5
|
||||
uses: ./.github/actions/quick_cmake
|
||||
with:
|
||||
cmake-version: "3.5"
|
||||
if: success() || failure()
|
||||
|
||||
- name: Check CMake 3.6
|
||||
uses: ./.github/actions/quick_cmake
|
||||
with:
|
||||
cmake-version: "3.6"
|
||||
if: success() || failure()
|
||||
|
||||
- name: Check CMake 3.7
|
||||
uses: ./.github/actions/quick_cmake
|
||||
with:
|
||||
cmake-version: "3.7"
|
||||
if: success() || failure()
|
||||
|
||||
- name: Check CMake 3.8
|
||||
uses: ./.github/actions/quick_cmake
|
||||
with:
|
||||
cmake-version: "3.8"
|
||||
if: success() || failure()
|
||||
|
||||
- name: Check CMake 3.9
|
||||
uses: ./.github/actions/quick_cmake
|
||||
with:
|
||||
cmake-version: "3.9"
|
||||
if: success() || failure()
|
||||
|
||||
- name: Check CMake 3.10
|
||||
uses: ./.github/actions/quick_cmake
|
||||
with:
|
||||
@ -390,15 +360,21 @@ jobs:
|
||||
cmake-version: "3.28.X"
|
||||
args: -DCLI11_SANITIZERS=ON -DCLI11_BUILD_EXAMPLES_JSON=ON
|
||||
if: success() || failure()
|
||||
|
||||
|
||||
- name: Check CMake 3.29
|
||||
uses: ./.github/actions/quick_cmake
|
||||
with:
|
||||
cmake-version: "3.29"
|
||||
if: success() || failure()
|
||||
|
||||
|
||||
- name: Check CMake 3.30
|
||||
uses: ./.github/actions/quick_cmake
|
||||
with:
|
||||
cmake-version: "3.30"
|
||||
if: success() || failure()
|
||||
|
||||
- name: Check CMake 3.31
|
||||
uses: ./.github/actions/quick_cmake
|
||||
with:
|
||||
cmake-version: "3.31"
|
||||
if: success() || failure()
|
||||
|
@ -1,17 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
cmake_minimum_required(VERSION 3.10...3.31)
|
||||
# Note: this is a header only library. If you have an older CMake than 3.5,
|
||||
# just add the CLI11/include directory and that's all you need to do.
|
||||
|
||||
# Make sure users don't get warnings on a tested (3.5 to 3.30) version
|
||||
# of CMake. For most of the policies, the new version is better (hence the change).
|
||||
# We don't use the 3.5...3.30 syntax because of a bug in an older MSVC's
|
||||
# built-in and modified CMake 3.11
|
||||
if(${CMAKE_VERSION} VERSION_LESS 3.30)
|
||||
cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
|
||||
else()
|
||||
cmake_policy(VERSION 3.30)
|
||||
endif()
|
||||
|
||||
set(VERSION_REGEX "#define CLI11_VERSION[ \t]+\"(.+)\"")
|
||||
|
||||
# Read in the line containing the version
|
||||
@ -35,9 +25,7 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
|
||||
|
||||
find_package(Doxygen)
|
||||
|
||||
if(CMAKE_VERSION VERSION_LESS 3.10)
|
||||
message(STATUS "CMake 3.10+ adds Doxygen support. Update CMake to build documentation")
|
||||
elseif(NOT Doxygen_FOUND)
|
||||
if(NOT Doxygen_FOUND)
|
||||
message(STATUS "Doxygen not found, building docs has been disabled")
|
||||
endif()
|
||||
|
||||
|
@ -179,7 +179,7 @@ details are available at [installation][]:
|
||||
separately.
|
||||
- All-in-one global header: Like above, but copying the file to a shared folder
|
||||
location like `/opt/CLI11`. Then, the C++ include path has to be extended to
|
||||
point at this folder. With CMake 3.5+, use `include_directories(/opt/CLI11)`
|
||||
point at this folder. With CMake 3.10+, use `include_directories(/opt/CLI11)`
|
||||
- For other methods including using CMake, conan or vcpkg and some specific
|
||||
instructions for GCC 8 or WASI see [installation][].
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
cmake_minimum_required(VERSION 3.11)
|
||||
cmake_minimum_required(VERSION 3.11...3.31)
|
||||
|
||||
project(CLI11_Examples LANGUAGES CXX)
|
||||
|
||||
|
@ -33,21 +33,7 @@ target_include_directories(
|
||||
$<INSTALL_INTERFACE:include>)
|
||||
|
||||
if(CMAKE_CXX_STANDARD LESS 14)
|
||||
if(CMAKE_VERSION VERSION_LESS 3.8)
|
||||
# This might not be a complete list
|
||||
target_compile_features(
|
||||
CLI11
|
||||
INTERFACE cxx_lambdas
|
||||
cxx_nullptr
|
||||
cxx_override
|
||||
cxx_range_for
|
||||
cxx_right_angle_brackets
|
||||
cxx_strong_enums
|
||||
cxx_constexpr
|
||||
cxx_auto_type)
|
||||
else()
|
||||
target_compile_features(CLI11 INTERFACE cxx_std_11)
|
||||
endif()
|
||||
target_compile_features(CLI11 INTERFACE cxx_std_11)
|
||||
endif()
|
||||
|
||||
if(CLI11_INSTALL)
|
||||
|
Loading…
x
Reference in New Issue
Block a user