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
5 changed files with 28 additions and 20 deletions

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]+\"(.+)\"")