Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cmake_policy in vcpkg #41574

Merged
merged 17 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scripts/buildsystems/vcpkg.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ 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)
cmake_policy(VERSION 3.16)

include(CMakeDependentOption)

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

cmake_policy(PUSH)
cmake_policy(VERSION 3.7.2)
cmake_policy(VERSION 3.16)

set(VCPKG_TOOLCHAIN ON)
set(Z_VCPKG_UNUSED "${CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION}")
Expand Down
12 changes: 6 additions & 6 deletions scripts/test_ports/cmake-user/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ set(cmake_commands "")
if("cmake-current" IN_LIST FEATURES)
list(APPEND cmake_commands "${CMAKE_COMMAND}")
endif()
if("cmake-3-7" IN_LIST FEATURES)
set(cmake_version 3.7.2)
if("cmake-old" IN_LIST FEATURES)
set(cmake_version 3.16.3)
string(REGEX REPLACE "([^.]*[.][^.]*).*" "\\1" cmake_major_minor "${cmake_version}")
if(VCPKG_HOST_IS_WINDOWS)
set(name "cmake-${cmake_version}-win32-x86")
vcpkg_download_distfile(legacy_cmake_archive
FILENAME "${name}.zip"
URLS "https://github.com/Kitware/CMake/releases/download/v${cmake_version}/${name}.zip"
"https://cmake.org/files/v${cmake_major_minor}/${name}.zip"
SHA512 c359a22e2e688da1513db195280d6e8987bc8d570a0c543f1b1dfc8572fe4fd6c23d951ec5d5eae640fcca3bef3ae469083511474796ade8c6319d8bc4e4b38d
SHA512 4c955f075ea164a118cd813070f9b4548f0e41547ca933812ce383396e94f119d4acba5f925ab3611fc68acb58c03b50353c26a0bf6f44fc343e71689a0d477e
)
set(cmake_bin_dir "/bin")
elseif(VCPKG_HOST_IS_OSX)
Expand All @@ -22,7 +22,7 @@ if("cmake-3-7" IN_LIST FEATURES)
FILENAME "${name}.tar.gz"
URLS "https://github.com/Kitware/CMake/releases/download/v${cmake_version}/${name}.tar.gz"
"https://cmake.org/files/v${cmake_major_minor}/${name}.tar.gz"
SHA512 8e41608f4dd998020acf2bd1b0dab4aec37b3ea9e228f2c4a457cd1c0339d94db38a0548b4b07a9e3605f9beb11a3f6737a72813586c4ad5f730d74038a14c2b
SHA512 3e59e2406f4e088b60922fbf23e92e1be3bb34c00f919625210fd93c059b5e6785afa40d3a501f36b281cde29de592f2ccffade6fa3980d0cf31dc845483184f
)
set(cmake_bin_dir "/CMake.app/Contents/bin")
elseif(VCPKG_HOST_IS_LINUX)
Expand All @@ -31,11 +31,11 @@ if("cmake-3-7" IN_LIST FEATURES)
FILENAME "${name}.tar.gz"
URLS "https://github.com/Kitware/CMake/releases/download/v${cmake_version}/${name}.tar.gz"
"https://cmake.org/files/v${cmake_major_minor}/${name}.tar.gz"
SHA512 459909fcfb9c74993c3d4ab9db4e31ea940515b670db44d039de611d813099895e695467cc8da24824315486e38e2f3e246aa92d6236c51103822ec8a39e3168
SHA512 03be16ad06fcabe40a36d0a510fdb58f5612108aed70cef7f68879d82b9e04ad62a9d0c30f3406df618ec219c74fc27b4be533d970bc60ac22333951d6cabe1a
)
set(cmake_bin_dir "/bin")
else()
message(FATAL_ERROR "Unable to test feature 'cmake-3-7' for '${HOST_TRIPLET}' host.")
message(FATAL_ERROR "Unable to test feature 'cmake-old' for '${HOST_TRIPLET}' host.")
endif()

vcpkg_extract_source_archive(legacy_cmake
Expand Down
6 changes: 3 additions & 3 deletions scripts/test_ports/cmake-user/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
"name": "cmake-user",
"default-features": false,
"features": [
"cmake-3-7"
"cmake-old"
],
"platform": "x64 & (windows | linux | osx) & !uwp"
}
]
},
"cmake-3-7": {
"description": "Run the tests with CMake 3.7"
"cmake-old": {
"description": "Run the tests with the oldest supported version of CMake"
},
"cmake-current": {
"description": "Run the tests with vcpkg's current version of CMake"
Expand Down