mirror of
https://github.com/CLIUtils/CLI11.git
synced 2025-05-04 06:13:53 +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:
parent
77722acb25
commit
f07a8cc6fb
4
.github/actions/quick_cmake/action.yml
vendored
4
.github/actions/quick_cmake/action.yml
vendored
@ -1,5 +1,5 @@
|
|||||||
name: Quick CMake config
|
name: Quick CMake config
|
||||||
description: "Runs CMake 3.4+ (if already setup)"
|
description: "Runs CMake 3.5+ (if already setup)"
|
||||||
inputs:
|
inputs:
|
||||||
args:
|
args:
|
||||||
description: "Other arguments"
|
description: "Other arguments"
|
||||||
@ -13,7 +13,7 @@ runs:
|
|||||||
using: composite
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
- name: CMake ${{ inputs.cmake-version }}
|
- name: CMake ${{ inputs.cmake-version }}
|
||||||
uses: jwlawson/actions-setup-cmake@v1.13
|
uses: jwlawson/actions-setup-cmake@v1.14
|
||||||
with:
|
with:
|
||||||
cmake-version: "${{ inputs.cmake-version }}"
|
cmake-version: "${{ inputs.cmake-version }}"
|
||||||
- run: |
|
- run: |
|
||||||
|
25
.github/workflows/tests.yml
vendored
25
.github/workflows/tests.yml
vendored
@ -145,11 +145,6 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Check CMake 3.4
|
|
||||||
with:
|
|
||||||
cmake-version: "3.4"
|
|
||||||
uses: ./.github/actions/quick_cmake
|
|
||||||
|
|
||||||
- name: Check CMake 3.5
|
- name: Check CMake 3.5
|
||||||
uses: ./.github/actions/quick_cmake
|
uses: ./.github/actions/quick_cmake
|
||||||
with:
|
with:
|
||||||
@ -265,22 +260,34 @@ jobs:
|
|||||||
cmake-version: "3.22"
|
cmake-version: "3.22"
|
||||||
if: success() || failure()
|
if: success() || failure()
|
||||||
|
|
||||||
- name: Check CMake 3.23
|
- name: Check CMake 3.23
|
||||||
uses: ./.github/actions/quick_cmake
|
uses: ./.github/actions/quick_cmake
|
||||||
with:
|
with:
|
||||||
cmake-version: "3.23"
|
cmake-version: "3.23"
|
||||||
if: success() || failure()
|
if: success() || failure()
|
||||||
|
|
||||||
- name: Check CMake 3.24 (full)
|
- name: Check CMake 3.24
|
||||||
uses: ./.github/actions/quick_cmake
|
uses: ./.github/actions/quick_cmake
|
||||||
with:
|
with:
|
||||||
cmake-version: "3.24"
|
cmake-version: "3.24"
|
||||||
args: -DCLI11_SANITIZERS=ON -DCLI11_BUILD_EXAMPLES_JSON=ON
|
|
||||||
if: success() || failure()
|
if: success() || failure()
|
||||||
|
|
||||||
- name: Check CMake 3.25 (full)
|
- name: Check CMake 3.25
|
||||||
uses: ./.github/actions/quick_cmake
|
uses: ./.github/actions/quick_cmake
|
||||||
with:
|
with:
|
||||||
cmake-version: "3.25"
|
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
|
args: -DCLI11_SANITIZERS=ON -DCLI11_BUILD_EXAMPLES_JSON=ON
|
||||||
if: success() || failure()
|
if: success() || failure()
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
cmake_minimum_required(VERSION 3.4)
|
cmake_minimum_required(VERSION 3.5)
|
||||||
# Note: this is a header only library. If you have an older CMake than 3.4,
|
# 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.
|
# 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).
|
# 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
|
# 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})
|
cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
|
||||||
else()
|
else()
|
||||||
cmake_policy(VERSION 3.25)
|
cmake_policy(VERSION 3.26)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(VERSION_REGEX "#define CLI11_VERSION[ \t]+\"(.+)\"")
|
set(VERSION_REGEX "#define CLI11_VERSION[ \t]+\"(.+)\"")
|
||||||
|
@ -178,7 +178,7 @@ To use, there are several methods:
|
|||||||
separately.
|
separately.
|
||||||
- All-in-one global header: Like above, but copying the file to a shared folder
|
- 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
|
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
|
- 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
|
repository as a git submodule, for example. With CMake, you can use
|
||||||
`add_subdirectory` and the `CLI11::CLI11` interface target when linking. If
|
`add_subdirectory` and the `CLI11::CLI11` interface target when linking. If
|
||||||
|
@ -24,7 +24,7 @@ include shown above.
|
|||||||
|
|
||||||
### CMake support for the full edition
|
### 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
|
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
|
`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
|
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
|
necessary `lib/cmake/CLI11/CLI11Config.cmake` files, so
|
||||||
`find_package(CLI11 CONFIG REQUIRED)` also works.
|
`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
|
### Running tests on the full edition
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user