]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Explicitly set CMake policy 0169 to silence warning
authorFantasqueX <fantasquex@gmail.com>
Thu, 19 Sep 2024 16:53:18 +0000 (00:53 +0800)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Fri, 27 Sep 2024 14:21:00 +0000 (16:21 +0200)
The recommended `FetchContent_MakeAvailable()` is introduced in CMake
3.14 which is greater than `cmake_minimum_required()`.

CMake policy will effects subdirectories.

The `cmake_minimum_required(VERSION)` command implicitly calls
`cmake_policy(VERSION)`.

Closes https://github.com/zlib-ng/zlib-ng/issues/1788

CMakeLists.txt
test/CMakeLists.txt

index 0d738c1dbf16cd64fe6c019185b90f9758480a15..fe83ceb9b63b3c1178db9bb067b039b70661d690 100644 (file)
@@ -6,6 +6,10 @@ else()
 endif()
 message(STATUS "Using CMake version ${CMAKE_VERSION}")
 
+if(POLICY CMP0169)
+    cmake_policy(SET CMP0169 OLD) # CMake 3.30: call FetchContent_Populate() with just the name of a dependency
+endif()
+
 # If not specified on the command line, enable C11 as the default
 # Configuration items that affect the global compiler environment standards
 # should be issued before the "project" command.
index ca1d3ea94229dfc5e726cd693da77baafc4206a7..abb1055c5b7ed01be29c97a60bc4a8548f06eb31 100644 (file)
@@ -1,5 +1,3 @@
-cmake_minimum_required(VERSION 3.5.1)
-
 macro(configure_test_executable target)
     target_include_directories(${target} PRIVATE ${PROJECT_BINARY_DIR} ${PROJECT_SOURCE_DIR})
     set_target_properties(${target} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})