option.rst 495 B

12345678910111213141516
  1. option
  2. ------
  3. Provide an option that the user can optionally select.
  4. .. code-block:: cmake
  5. option(<variable> "<help_text>" [value])
  6. Provides an option for the user to select as ``ON`` or ``OFF``.
  7. If no initial ``<value>`` is provided, ``OFF`` is used.
  8. If ``<variable>`` is already set as a normal variable
  9. then the command does nothing (see policy :policy:`CMP0077`).
  10. If you have options that depend on the values of other options, see
  11. the module help for :module:`CMakeDependentOption`.