Address deprecated cmake version warning.

Use cmake_minimum_required(VERSION <min>...<policy_max>) syntax to set
the policy at the same time as the compatibile CMake version.
This commit is contained in:
Bradley Lowekamp 2024-11-26 09:12:49 -05:00 committed by Hans Kristian Rosbach
parent 2562fd1fb3
commit 11bef87c1c
3 changed files with 3 additions and 5 deletions

View File

@ -1,8 +1,6 @@
cmake_minimum_required(VERSION 3.5.1)
cmake_minimum_required(VERSION 3.5.1...3.29.0)
if(CMAKE_VERSION VERSION_LESS 3.12)
cmake_policy(VERSION ${CMAKE_VERSION})
else()
cmake_policy(VERSION 3.5.1...3.29.0)
endif()
message(STATUS "Using CMake version ${CMAKE_VERSION}")

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5.1)
cmake_minimum_required(VERSION 3.5.1...3.29.0)
project(zlib-ng-add-subdirecory-test C)

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5.1)
cmake_minimum_required(VERSION 3.5.1...3.29.0)
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
enable_language(CXX)