Skip to content

vcpkg.cmake - CMake Warning About Policy CMP0127 #25985

@tusharb86

Description

@tusharb86

Describe the bug
When using CMake versions 3.22 or higher, it warns about the policy CMP0127. The origination of this warning is due to the usage of cmake_dependent_option in the vcpkg.cmake file. This warning was mentioned in the PR that introduced the issue: #23322 (comment)

Environment
All

Expected behavior
This warning should be emitted for downstream users.

Failure logs
The link above includes an example failure. Re-pasting here for convenience:

CMake Warning (dev) at F:/vcpkg/downloads/tools/cmake-3.22.2-windows/cmake-3.22.2-windows-i386/share/cmake-3.22/Modules/CMakeDependentOption.cmake:84 (message):
  Policy CMP0127 is not set: cmake_dependent_option() supports full Condition
  Syntax.  Run "cmake --help-policy CMP0127" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
  F:/vcpkg/scripts/buildsystems/vcpkg.cmake:521 (cmake_dependent_option)
  F:/vcpkg/buildtrees/libwebsockets/x64-windows-rel/CMakeFiles/3.22.2/CMakeSystem.cmake:6 (include)
  F:/vcpkg/buildtrees/libwebsockets/x64-windows-rel/CMakeFiles/CMakeTmp/CMakeLists.txt:5 (project)
This warning is for project developers.  Use -Wno-dev to suppress it.

Metadata

Metadata

Assignees

Labels

category:vcpkg-bugThe issue is with the vcpkg system (including helper scripts in `scripts/cmake/`)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions