Skip to content

Commit 8f28706

Browse files
committed
feat: increase min CMake to 3.10
Signed-off-by: Henry Schreiner <[email protected]>
1 parent a68a48b commit 8f28706

File tree

6 files changed

+14
-64
lines changed

6 files changed

+14
-64
lines changed

.github/actions/quick_cmake/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Quick CMake config
2-
description: "Runs CMake 3.5+ (if already setup)"
2+
description: "Runs CMake 3.10+ (if already setup)"
33
inputs:
44
args:
55
description: "Other arguments"

.github/workflows/tests.yml

Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -238,36 +238,6 @@ jobs:
238238
steps:
239239
- uses: actions/checkout@v4
240240

241-
- name: Check CMake 3.5
242-
uses: ./.github/actions/quick_cmake
243-
with:
244-
cmake-version: "3.5"
245-
if: success() || failure()
246-
247-
- name: Check CMake 3.6
248-
uses: ./.github/actions/quick_cmake
249-
with:
250-
cmake-version: "3.6"
251-
if: success() || failure()
252-
253-
- name: Check CMake 3.7
254-
uses: ./.github/actions/quick_cmake
255-
with:
256-
cmake-version: "3.7"
257-
if: success() || failure()
258-
259-
- name: Check CMake 3.8
260-
uses: ./.github/actions/quick_cmake
261-
with:
262-
cmake-version: "3.8"
263-
if: success() || failure()
264-
265-
- name: Check CMake 3.9
266-
uses: ./.github/actions/quick_cmake
267-
with:
268-
cmake-version: "3.9"
269-
if: success() || failure()
270-
271241
- name: Check CMake 3.10
272242
uses: ./.github/actions/quick_cmake
273243
with:
@@ -390,15 +360,21 @@ jobs:
390360
cmake-version: "3.28.X"
391361
args: -DCLI11_SANITIZERS=ON -DCLI11_BUILD_EXAMPLES_JSON=ON
392362
if: success() || failure()
393-
363+
394364
- name: Check CMake 3.29
395365
uses: ./.github/actions/quick_cmake
396366
with:
397367
cmake-version: "3.29"
398368
if: success() || failure()
399-
369+
400370
- name: Check CMake 3.30
401371
uses: ./.github/actions/quick_cmake
402372
with:
403373
cmake-version: "3.30"
404374
if: success() || failure()
375+
376+
- name: Check CMake 3.31
377+
uses: ./.github/actions/quick_cmake
378+
with:
379+
cmake-version: "3.31"
380+
if: success() || failure()

CMakeLists.txt

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,7 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.10...3.31)
22
# Note: this is a header only library. If you have an older CMake than 3.5,
33
# just add the CLI11/include directory and that's all you need to do.
44

5-
# Make sure users don't get warnings on a tested (3.5 to 3.30) version
6-
# of CMake. For most of the policies, the new version is better (hence the change).
7-
# We don't use the 3.5...3.30 syntax because of a bug in an older MSVC's
8-
# built-in and modified CMake 3.11
9-
if(${CMAKE_VERSION} VERSION_LESS 3.30)
10-
cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
11-
else()
12-
cmake_policy(VERSION 3.30)
13-
endif()
14-
155
set(VERSION_REGEX "#define CLI11_VERSION[ \t]+\"(.+)\"")
166

177
# Read in the line containing the version
@@ -35,9 +25,7 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
3525

3626
find_package(Doxygen)
3727

38-
if(CMAKE_VERSION VERSION_LESS 3.10)
39-
message(STATUS "CMake 3.10+ adds Doxygen support. Update CMake to build documentation")
40-
elseif(NOT Doxygen_FOUND)
28+
if(NOT Doxygen_FOUND)
4129
message(STATUS "Doxygen not found, building docs has been disabled")
4230
endif()
4331

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ details are available at [installation][]:
179179
separately.
180180
- All-in-one global header: Like above, but copying the file to a shared folder
181181
location like `/opt/CLI11`. Then, the C++ include path has to be extended to
182-
point at this folder. With CMake 3.5+, use `include_directories(/opt/CLI11)`
182+
point at this folder. With CMake 3.10+, use `include_directories(/opt/CLI11)`
183183
- For other methods including using CMake, conan or vcpkg and some specific
184184
instructions for GCC 8 or WASI see [installation][].
185185

book/code/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.11)
1+
cmake_minimum_required(VERSION 3.11...3.31)
22

33
project(CLI11_Examples LANGUAGES CXX)
44

src/CMakeLists.txt

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,7 @@ target_include_directories(
3333
$<INSTALL_INTERFACE:include>)
3434

3535
if(CMAKE_CXX_STANDARD LESS 14)
36-
if(CMAKE_VERSION VERSION_LESS 3.8)
37-
# This might not be a complete list
38-
target_compile_features(
39-
CLI11
40-
INTERFACE cxx_lambdas
41-
cxx_nullptr
42-
cxx_override
43-
cxx_range_for
44-
cxx_right_angle_brackets
45-
cxx_strong_enums
46-
cxx_constexpr
47-
cxx_auto_type)
48-
else()
49-
target_compile_features(CLI11 INTERFACE cxx_std_11)
50-
endif()
36+
target_compile_features(CLI11 INTERFACE cxx_std_11)
5137
endif()
5238

5339
if(CLI11_INSTALL)

0 commit comments

Comments
 (0)