Added in version 3.20.
The WriteCompilerDetectionHeader module is removed.
CMake versions 3.1 through 3.19 provide this module to generate a C++ compatibility layer by re-using information from CMake's table of preprocessor checks for cmake-compile-features(7). However:
cxx_std_11. Therefore no new granular feature checks will be added and projects will need to use other means to conditionally use new C++ features.WriteCompilerDetectionHeader was best used by manually generating its header locally with a recent version of CMake and then bundling it with the project source so that it could be used with older CMake versions.For reasons including the above, CMake 3.20 and above prefer to not provide the WriteCompilerDetectionHeader module. This policy provides compatibility for projects that have not been ported away from it. Projects using the module should be updated to stop using it. Alternatives include:
The OLD behavior of this policy is for inclusion of the deprecated WriteCompilerDetectionHeader module to work. The NEW behavior is for inclusion of the module to fail as if it does not exist.
This policy was introduced in CMake version 3.20. It may be set by cmake_policy() or cmake_minimum_required(). If it is not set, CMake warns, and uses OLD behavior.
Note
The OLD behavior of a policy is deprecated by definition and may be removed in a future version of CMake.
© 2000–2024 Kitware, Inc. and Contributors
Licensed under the BSD 3-clause License.
https://cmake.org/cmake/help/v3.31/policy/CMP0120.html