1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-18 08:51:52 +08:00
Files
CMake/Help/command/option.rst
Peter Kokot f70f972562 CMakeDependentOption: Sync documentation
- Added intro code block with include() showing how to load this module.
- Used "command" instead of "macro".
- Removed duplicate mention of CMakeDependentOption module in the
  option() documentation.
- Synced captions in examples.
2025-05-12 21:10:29 +02:00

22 lines
662 B
ReStructuredText

option
------
Provide a boolean option that the user can optionally select.
.. code-block:: cmake
option(<variable> "<help_text>" [value])
If no initial ``<value>`` is provided, boolean ``OFF`` is the default value.
If ``<variable>`` is already set as a normal or cache variable,
then the command does nothing (see policy :policy:`CMP0077`).
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 boolean options that
depend on the values of other options or a set of conditions.