Skip to content

Commit

Permalink
Update cmake_policy in vcpkg
Browse files Browse the repository at this point in the history
Compatibility with versions of CMake older than 3.10 is deprecated.
  • Loading branch information
gwankyun committed Oct 15, 2024
1 parent 9558037 commit 3ed372b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions scripts/buildsystems/vcpkg.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ if(CMAKE_VERSION VERSION_LESS Z_VCPKG_CMAKE_REQUIRED_MINIMUM_VERSION)
message(FATAL_ERROR "vcpkg.cmake requires at least CMake ${Z_VCPKG_CMAKE_REQUIRED_MINIMUM_VERSION}.")
endif()
cmake_policy(PUSH)
cmake_policy(VERSION 3.7.2)
if(${CMAKE_VERSION} VERSION_LESS 3.31)
cmake_policy(VERSION 3.7.2)
else()
cmake_policy(VERSION 3.10)
endif()

include(CMakeDependentOption)

Expand Down Expand Up @@ -875,7 +879,11 @@ macro("${VCPKG_OVERRIDE_FIND_PACKAGE_NAME}" z_vcpkg_find_package_package_name)
endmacro()

cmake_policy(PUSH)
cmake_policy(VERSION 3.7.2)
if(${CMAKE_VERSION} VERSION_LESS 3.31)
cmake_policy(VERSION 3.7.2)
else()
cmake_policy(VERSION 3.10)
endif()

set(VCPKG_TOOLCHAIN ON)
set(Z_VCPKG_UNUSED "${CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION}")
Expand Down

0 comments on commit 3ed372b

Please sign in to comment.