From: FantasqueX Date: Thu, 19 Sep 2024 16:53:18 +0000 (+0800) Subject: Explicitly set CMake policy 0169 to silence warning X-Git-Tag: 2.2.3~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d10c309d7d468b9b2ecfd8d5f1b063d6396af17;p=thirdparty%2Fzlib-ng.git Explicitly set CMake policy 0169 to silence warning 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 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 0d738c1d..fe83ceb9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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. diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index ca1d3ea9..abb1055c 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -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})