glbinding icon indicating copy to clipboard operation
glbinding copied to clipboard

CMake >3.20 warns on missing policy

Open alexanderbock opened this issue 3 years ago • 2 comments
trafficstars

CMake Warning (dev) at ext/glbinding/CMakeLists.txt:47 (include):
  Policy CMP0120 is not set: The WriteCompilerDetectionHeader module is
  removed.  Run "cmake --help-policy CMP0120" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

This warning is for project developers.  Use -Wno-dev to suppress it.

Calling set_policy(CMP0120 NEW) in the root CMakelists.txt results in:

CMake Error at ext/glbinding/source/glbinding-aux/CMakeLists.txt:179 (file):
  file COPY cannot find
  "A:/<proj>/ext/glbinding/source/codegeneration/glbinding-aux_features.h":
  No such file or directory.

alexanderbock avatar Jul 19 '22 08:07 alexanderbock

Thanks for reporting. I had a quick look at the policy CMP0120 and conclude that the NEW behavior effectively breaks the build, as you report, too. In fact, our use case of this features header is now deprecated and discouraged for use by CMake.

The short-term approach will be to set the policy to OLD and migrate glbinding and our other projects to other dependencies to replace this features header.

scheibel avatar Jul 26 '22 12:07 scheibel

Bumped into this trying to bump cmake_minimum_required(VERSION 3.21)

nigels-com avatar Dec 14 '23 22:12 nigels-com