CMakeDependentOption: Update documentation

This updates the module documentation to be more synced with other
modules. Also, this module on the first glance doesn't do what most
people might think. Because when condition evaluates to false, internal
cache remains with the same value, and a local variable is created with
the value provided in the last argument.

- Command arguments described separately and their placeholders renamed
  to more intuitive names.
- More examples added, starting with a very basic syntax usage to more
  complex ones, each described in more details.
- Each example has include() added to be more clear that this is a
  module command.
This commit is contained in:
Peter Kokot
2025-03-31 02:36:55 +02:00
parent 5978c57c20
commit 67055f5b3a
3 changed files with 174 additions and 30 deletions

View File

@@ -16,3 +16,9 @@ the module help for :module:`CMakeDependentOption`.
In CMake project mode, a boolean cache variable is created with the option
value. In CMake script mode, a boolean variable is set with the option value.
See Also
^^^^^^^^
* The :module:`CMakeDependentOption` module to specify dependent boolean options
based on a set of conditions.