summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-03-31 12:46:15 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-03-31 12:46:29 (GMT)
commit2657454b595093813350329fd95c8b0f88d77281 (patch)
treed2bcb231f7ac9d27fe9bede55af4d573ff1e3b0d
parent6f132d6c91a55f1c16d39d9e0f3d3f000528fc63 (diff)
parent7a614977f9443146e8b423b6dc5a11a7c79862ce (diff)
downloadCMake-2657454b595093813350329fd95c8b0f88d77281.zip
CMake-2657454b595093813350329fd95c8b0f88d77281.tar.gz
CMake-2657454b595093813350329fd95c8b0f88d77281.tar.bz2
Merge topic 'CMakeDependentOption-doc-improvement'
7a614977f9 CMakeDependentOption: improve documentation Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Rui Oliveira <ruimail24@gmail.com> Merge-request: !7124
-rw-r--r--Modules/CMakeDependentOption.cmake19
1 files changed, 12 insertions, 7 deletions
diff --git a/Modules/CMakeDependentOption.cmake b/Modules/CMakeDependentOption.cmake
index b7c478f..ac0e262 100644
--- a/Modules/CMakeDependentOption.cmake
+++ b/Modules/CMakeDependentOption.cmake
@@ -16,13 +16,18 @@ conditions are true.
cmake_dependent_option(<option> "<help_text>" <value> <depends> <force>)
- Makes ``<option>`` available to the user if ``<depends>`` is true. When
- ``<option>`` is available, the given ``<help_text>`` and initial ``<value>``
- are used. If the ``<depends>`` condition is not true, ``<option>`` will not be
- presented and will always have the value given by ``<force>``. Any value set by
- the user is preserved for when the option is presented again. In case ``<depends>``
- is a :ref:`semicolon-separated list <CMake Language Lists>`, all elements must
- be true in order to initialize ``<option>`` with ``<value>``.
+ Makes ``<option>`` available to the user if the
+ :ref:`semicolon-separated list <CMake Language Lists>` of conditions in
+ ``<depends>`` are all true. Otherwise, a local variable named ``<option>``
+ is set to ``<force>``.
+
+ When ``<option>`` is available, the given ``<help_text>`` and initial
+ ``<value>`` are used. Otherwise, any value set by the user is preserved for
+ when ``<depends>`` is satisfied in the future.
+
+ Note that the ``<option>`` variable only has a value which satisfies the
+ ``<depends>`` condition within the scope of the caller because it is a local
+ variable.
Example invocation: