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:
Henry Schreiner
2024-11-15 08:40:46 -05:00
committed by GitHub
parent a68a48b7f1
commit d9473a486b
6 changed files with 14 additions and 64 deletions

View File

@@ -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()