diff options
Diffstat (limited to 'Help')
-rw-r--r-- | Help/command/option.rst | 4 | ||||
-rw-r--r-- | Help/manual/cmake-policies.7.rst | 1 | ||||
-rw-r--r-- | Help/policy/CMP0077.rst | 16 | ||||
-rw-r--r-- | Help/release/dev/option-normal-variable.rst | 5 |
4 files changed, 25 insertions, 1 deletions
diff --git a/Help/command/option.rst b/Help/command/option.rst index 91cd0a7..4fabb87 100644 --- a/Help/command/option.rst +++ b/Help/command/option.rst @@ -9,7 +9,9 @@ Provides an option that the user can optionally select. [initial value]) Provide an option for the user to select as ``ON`` or ``OFF``. If no -initial value is provided, ``OFF`` is used. +initial value is provided, ``OFF`` is used. If the option is already +set as a normal variable then the command does nothing +(see policy :policy:`CMP0077`). If you have options that depend on the values of other options, see the module help for :module:`CMakeDependentOption`. diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst index 6179a7c..b2eeb3a 100644 --- a/Help/manual/cmake-policies.7.rst +++ b/Help/manual/cmake-policies.7.rst @@ -57,6 +57,7 @@ Policies Introduced by CMake 3.13 .. toctree:: :maxdepth: 1 + CMP0077: option() honors normal variables. </policy/CMP0077> CMP0076: target_sources() command converts relative paths to absolute. </policy/CMP0076> Policies Introduced by CMake 3.12 diff --git a/Help/policy/CMP0077.rst b/Help/policy/CMP0077.rst new file mode 100644 index 0000000..8efe198 --- /dev/null +++ b/Help/policy/CMP0077.rst @@ -0,0 +1,16 @@ +CMP0077 +------- + +:command:`option` honors normal variables. + +The ``OLD`` behavior for this policy is to clear any existing normal variables +with the same name. The ``NEW`` behavior for this policy is to not create +a cache entry or modify any existing normal variables if a normal variable +with the same name already exists. + +This policy was introduced in CMake version 3.13. CMake version +|release| warns when the policy is not set and uses ``OLD`` behavior. +Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` +explicitly. + +.. include:: DEPRECATED.txt diff --git a/Help/release/dev/option-normal-variable.rst b/Help/release/dev/option-normal-variable.rst new file mode 100644 index 0000000..19b9a64 --- /dev/null +++ b/Help/release/dev/option-normal-variable.rst @@ -0,0 +1,5 @@ +option-normal-variable +---------------------- + +* The :command:`option` command now honors existing normal variables instead + of replacing them with a cache entry. See policy :policy:`CMP0077`. |