diff options
author | Brad King <brad.king@kitware.com> | 2024-01-11 18:43:55 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2024-01-11 19:48:01 (GMT) |
commit | ad3c2c0b03457c4410e31bbc8daae3bf21be2653 (patch) | |
tree | 8078b7518d3bff7a5ddfe6dc9b05df33b94915be /Help/policy/CMP0126.rst | |
parent | c6d69d84dbdf3e2db70e6272a95d977c2c685ee2 (diff) | |
download | CMake-ad3c2c0b03457c4410e31bbc8daae3bf21be2653.zip CMake-ad3c2c0b03457c4410e31bbc8daae3bf21be2653.tar.gz CMake-ad3c2c0b03457c4410e31bbc8daae3bf21be2653.tar.bz2 |
Help: Normalize and consolidate standard policy advice paragraph
Every policy's documentation has a paragraph on what version of CMake
introduced it, how to set the policy, and whether CMake warns if the
policy is not set. The wording of this paragraph has diverged across
policies over time. Factor the paragraph out into a standard advice
document included by every policy.
Diffstat (limited to 'Help/policy/CMP0126.rst')
-rw-r--r-- | Help/policy/CMP0126.rst | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/Help/policy/CMP0126.rst b/Help/policy/CMP0126.rst index a389512..ca40709 100644 --- a/Help/policy/CMP0126.rst +++ b/Help/policy/CMP0126.rst @@ -24,14 +24,16 @@ regardless of the ``CMP0126`` policy setting. The :command:`option` command will *not* set the cache variable if a non-cache variable of the same name already exists and :policy:`CMP0077` is set to ``NEW``. -Policy ``CMP0126`` was introduced in CMake version 3.21. Use the -:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly -within a project. Use the :variable:`CMAKE_POLICY_DEFAULT_CMP0126 -<CMAKE_POLICY_DEFAULT_CMP\<NNNN\>>` variable to set the policy for -a third-party project in a subdirectory without modifying it. -Unlike many policies, CMake version |release| does *not* warn when the policy -is not set and simply uses ``OLD`` behavior. See documentation of the +.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.21 +.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn by default +.. include:: STANDARD_ADVICE.txt + +See documentation of the :variable:`CMAKE_POLICY_WARNING_CMP0126 <CMAKE_POLICY_WARNING_CMP<NNNN>>` variable to control the warning. +The :variable:`CMAKE_POLICY_DEFAULT_CMP0126 <CMAKE_POLICY_DEFAULT_CMP\<NNNN\>>` +variable may be used to set the policy for a third-party project in a +subdirectory without modifying it. + .. include:: DEPRECATED.txt |