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

[vcpkg scripts] CMake Deprecation warning for policies <3.10 #42065

Open
nickelpro opened this issue Nov 9, 2024 · 1 comment
Open

[vcpkg scripts] CMake Deprecation warning for policies <3.10 #42065

nickelpro opened this issue Nov 9, 2024 · 1 comment
Assignees
Labels
category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly

Comments

@nickelpro
Copy link
Contributor

Describe the bug
vcpkg sets the cmake policy version to 3.7.2 on lines 40 and 878 of scripts/buildsystems/vcpkg.cmake

CMake 3.31 has deprecated policy versions <3.10 and will be removing them in the future, the correct mechanism here is to add a max version to the cmake_policy() call to indicate that vcpkg doesn't actually rely on these deprecated policy behaviors. Ideally this would be set to a modern version of CMake, but it is sufficient to set it to 3.10, ie cmake_policy(VERSION 3.7.2...3.10)

This is unrelated to the policy 0174 issue in #41999.

Full Disclosure: I'm a Kitware employee, happy to answer questions

Environment

  • OS: N/A
  • Compiler: N/A
  • CMake Version: 3.31

To Reproduce
Steps to reproduce the behavior:

  1. ./vcpkg install zlib
  2. See error

Expected behavior
No warnings for deprecated cmake_policy() levels

Failure logs

CMake Deprecation Warning at build/Debug/_deps/vcpkg-src/scripts/buildsystems/vcpkg.cmake:40 (cmake_policy):
  Compatibility with CMake < 3.10 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.
Call Stack (most recent call first):
  build/Debug/CMakeFiles/3.31.0/CMakeSystem.cmake:6 (include)
  CMakeLists.txt:5 (project)

...

CMake Deprecation Warning at build/Debug/_deps/vcpkg-src/scripts/buildsystems/vcpkg.cmake:878 (cmake_policy):
  Compatibility with CMake < 3.10 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.
Call Stack (most recent call first):
  build/Debug/CMakeFiles/3.31.0/CMakeSystem.cmake:6 (include)
  CMakeLists.txt:5 (project)
@nickelpro
Copy link
Contributor Author

Derp, this is already PR'd here: #41574

Keeping this open just to say, "We released 3.31, this warning shows up now"

@FrankXie05 FrankXie05 added the category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly label Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly
Projects
None yet
Development

No branches or pull requests

2 participants