From 26b47b6fb584da01524c334d9f3c8c5b88226e61 Mon Sep 17 00:00:00 2001 From: Raul Tambre Date: Sat, 18 Jul 2020 21:33:43 +0300 Subject: [PATCH] Bump tested CMake version to 3.18 Use the version range feature introduced in 3.12. On CMake <3.12 the extra dots are simply interpreted as extra version number separators. The fallback for ancient CMake versions is kept. --- CMakeLists.txt | 8 +++----- test/add-subdirectory-test/CMakeLists.txt | 2 +- test/compile-error-test/CMakeLists.txt | 2 +- test/find-package-test/CMakeLists.txt | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a5199e10..a45e7fc1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,10 +1,8 @@ -cmake_minimum_required(VERSION 3.1.0) +cmake_minimum_required(VERSION 3.1...3.18) -# Use newer policies if available, up to most recent tested version of CMake. -if(${CMAKE_VERSION} VERSION_LESS 3.11) +# Fallback for using newer policies on CMake <3.12. +if(${CMAKE_VERSION} VERSION_LESS 3.12) cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}) -else() - cmake_policy(VERSION 3.11) endif() # Determine if fmt is built as a subproject (using add_subdirectory) diff --git a/test/add-subdirectory-test/CMakeLists.txt b/test/add-subdirectory-test/CMakeLists.txt index db7054bd..9cc4b0e9 100644 --- a/test/add-subdirectory-test/CMakeLists.txt +++ b/test/add-subdirectory-test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1.0) +cmake_minimum_required(VERSION 3.1...3.18) project(fmt-test) diff --git a/test/compile-error-test/CMakeLists.txt b/test/compile-error-test/CMakeLists.txt index 75a0c5a5..8202f279 100644 --- a/test/compile-error-test/CMakeLists.txt +++ b/test/compile-error-test/CMakeLists.txt @@ -1,6 +1,6 @@ # Test if compile errors are produced where necessary. -cmake_minimum_required(VERSION 3.1.0) +cmake_minimum_required(VERSION 3.1...3.18) include(CheckCXXSourceCompiles) include(CheckCXXCompilerFlag) diff --git a/test/find-package-test/CMakeLists.txt b/test/find-package-test/CMakeLists.txt index 51357557..93d686e6 100644 --- a/test/find-package-test/CMakeLists.txt +++ b/test/find-package-test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1.0) +cmake_minimum_required(VERSION 3.1...3.18) project(fmt-test)