Skip to content

Commit fac07e2

Browse files
Accept NEW CMake policies up to CMake 3.14 (#4112)
Starting with CMake 3.27, deprecation warnings are issued when asking for policy settings for CMake 3.4 or earlier. The cmake_minimum_required() command accepts a version range, which allows NEW policy settings up to the upper end of that range to be used, but without raising the minimum CMake version above the bottom of that range. This means NEW policy settings will be used where available, without requiring them. This change updates the project's cmake_minimum_required() calls to use a version range to extend the upper policy version to 3.14 where it wasn't already at that version or higher. This prevents the deprecation warning from CMake 3.27, and gives breathing space before a future CMake release will start issuing similar deprecation warnings again.
1 parent 6d4b72d commit fac07e2

8 files changed

Lines changed: 8 additions & 8 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.1)
1+
cmake_minimum_required(VERSION 3.1...3.14)
22

33
##
44
## PROJECT

tests/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.13)
1+
cmake_minimum_required(VERSION 3.13...3.14)
22

33
option(JSON_Valgrind "Execute test suite with Valgrind." OFF)
44
option(JSON_FastTests "Skip expensive/slow tests." OFF)

tests/benchmarks/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.11)
1+
cmake_minimum_required(VERSION 3.11...3.14)
22
project(JSON_Benchmarks LANGUAGES CXX)
33

44
# set compiler flags

tests/cmake_add_subdirectory/project/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.1)
1+
cmake_minimum_required(VERSION 3.1...3.14)
22

33
project(DummyImport CXX)
44

tests/cmake_fetch_content/project/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.11)
1+
cmake_minimum_required(VERSION 3.11...3.14)
22

33
project(DummyImport CXX)
44

tests/cmake_import/project/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.1)
1+
cmake_minimum_required(VERSION 3.1...3.14)
22

33
project(DummyImport CXX)
44

tests/cmake_import_minver/project/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.1)
1+
cmake_minimum_required(VERSION 3.1...3.14)
22

33
project(DummyImportMinVer CXX)
44

tests/cmake_target_include_directories/project/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.1)
1+
cmake_minimum_required(VERSION 3.1...3.14)
22

33
project(DummyImport CXX)
44

0 commit comments

Comments
 (0)