1
0
mirror of https://github.com/CLIUtils/CLI11.git synced 2025-05-03 05:53:52 +00:00

fix: increase min CMake to 3.5 (#898)

CMake 3.27 will start warning if this is older than 3.5.

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
This commit is contained in:
Henry Schreiner 2023-06-28 16:24:27 -04:00 committed by GitHub
parent 77722acb25
commit f07a8cc6fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 28 additions and 20 deletions

View File

@ -1,5 +1,5 @@
name: Quick CMake config
description: "Runs CMake 3.4+ (if already setup)"
description: "Runs CMake 3.5+ (if already setup)"
inputs:
args:
description: "Other arguments"
@ -13,7 +13,7 @@ runs:
using: composite
steps:
- name: CMake ${{ inputs.cmake-version }}
uses: jwlawson/actions-setup-cmake@v1.13
uses: jwlawson/actions-setup-cmake@v1.14
with:
cmake-version: "${{ inputs.cmake-version }}"
- run: |

View File

@ -145,11 +145,6 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Check CMake 3.4
with:
cmake-version: "3.4"
uses: ./.github/actions/quick_cmake
- name: Check CMake 3.5
uses: ./.github/actions/quick_cmake
with:
@ -265,22 +260,34 @@ jobs:
cmake-version: "3.22"
if: success() || failure()
- name: Check CMake 3.23
- name: Check CMake 3.23
uses: ./.github/actions/quick_cmake
with:
cmake-version: "3.23"
if: success() || failure()
- name: Check CMake 3.24 (full)
- name: Check CMake 3.24
uses: ./.github/actions/quick_cmake
with:
cmake-version: "3.24"
args: -DCLI11_SANITIZERS=ON -DCLI11_BUILD_EXAMPLES_JSON=ON
if: success() || failure()
- name: Check CMake 3.25 (full)
- name: Check CMake 3.25
uses: ./.github/actions/quick_cmake
with:
cmake-version: "3.25"
if: success() || failure()
- name: Check CMake 3.26 (full)
uses: ./.github/actions/quick_cmake
with:
cmake-version: "3.26"
args: -DCLI11_SANITIZERS=ON -DCLI11_BUILD_EXAMPLES_JSON=ON
if: success() || failure()
- name: Check CMake 3.27 (full)
uses: ./.github/actions/quick_cmake
with:
cmake-version: "3.27"
args: -DCLI11_SANITIZERS=ON -DCLI11_BUILD_EXAMPLES_JSON=ON
if: success() || failure()

View File

@ -1,15 +1,15 @@
cmake_minimum_required(VERSION 3.4)
# Note: this is a header only library. If you have an older CMake than 3.4,
cmake_minimum_required(VERSION 3.5)
# 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.4 to 3.24) version
# Make sure users don't get warnings on a tested (3.5 to 3.26) version
# of CMake. For most of the policies, the new version is better (hence the change).
# We don't use the 3.4...3.24 syntax because of a bug in an older MSVC's
# We don't use the 3.5...3.26 syntax because of a bug in an older MSVC's
# built-in and modified CMake 3.11
if(${CMAKE_VERSION} VERSION_LESS 3.25)
if(${CMAKE_VERSION} VERSION_LESS 3.26)
cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
else()
cmake_policy(VERSION 3.25)
cmake_policy(VERSION 3.26)
endif()
set(VERSION_REGEX "#define CLI11_VERSION[ \t]+\"(.+)\"")

View File

@ -178,7 +178,7 @@ To use, there are several methods:
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, use `include_directories(/opt/CLI11)`
point at this folder. With CMake 3.5+, use `include_directories(/opt/CLI11)`
- Local headers and target: Use `CLI/*.hpp` files. You could check out the
repository as a git submodule, for example. With CMake, you can use
`add_subdirectory` and the `CLI11::CLI11` interface target when linking. If

View File

@ -24,7 +24,7 @@ include shown above.
### CMake support for the full edition
If you use CMake 3.4+ for your project (highly recommended), CLI11 comes with a
If you use CMake 3.5+ for your project (highly recommended), CLI11 comes with a
powerful CMakeLists.txt file that was designed to also be used with
`add_subproject`. You can add the repository to your code (preferably as a git
submodule), then add the following line to your project (assuming your folder is
@ -43,7 +43,8 @@ You can also configure and optionally install CLI11, and CMake will create the
necessary `lib/cmake/CLI11/CLI11Config.cmake` files, so
`find_package(CLI11 CONFIG REQUIRED)` also works.
If you use conan.io, CLI11 supports that too.
If you use conan.io, CLI11 supports that too. CLI11 also supports Meson and
pkg-config if you are not using CMake.
### Running tests on the full edition