|
@@ -10,9 +10,17 @@ default values depend on specified conditions or other options. This helps
|
|
|
maintain a clean configuration interface by only displaying options that are
|
|
maintain a clean configuration interface by only displaying options that are
|
|
|
relevant to the current settings.
|
|
relevant to the current settings.
|
|
|
|
|
|
|
|
|
|
+Load this module in a CMake project with:
|
|
|
|
|
+
|
|
|
|
|
+.. code-block:: cmake
|
|
|
|
|
+
|
|
|
|
|
+ include(CMakeDependentOption)
|
|
|
|
|
+
|
|
|
Commands
|
|
Commands
|
|
|
^^^^^^^^
|
|
^^^^^^^^
|
|
|
|
|
|
|
|
|
|
+This module provides the following command:
|
|
|
|
|
+
|
|
|
.. command:: cmake_dependent_option
|
|
.. command:: cmake_dependent_option
|
|
|
|
|
|
|
|
Provides a boolean option that depends on a set of conditions:
|
|
Provides a boolean option that depends on a set of conditions:
|
|
@@ -21,9 +29,9 @@ Commands
|
|
|
|
|
|
|
|
cmake_dependent_option(<variable> <help> <value> <condition> <else-value>)
|
|
cmake_dependent_option(<variable> <help> <value> <condition> <else-value>)
|
|
|
|
|
|
|
|
- This macro creates a boolean ``<variable>`` and makes it available to the user
|
|
|
|
|
- in the GUI (such as :manual:`cmake-gui(1)` or :manual:`ccmake(1)`), if a set
|
|
|
|
|
- of conditions evaluates to boolean true.
|
|
|
|
|
|
|
+ This command creates a boolean ``<variable>`` and makes it available to the
|
|
|
|
|
+ user in the GUI (such as :manual:`cmake-gui(1)` or :manual:`ccmake(1)`), if
|
|
|
|
|
+ a set of conditions evaluates to boolean true.
|
|
|
|
|
|
|
|
The arguments are:
|
|
The arguments are:
|
|
|
|
|
|
|
@@ -83,7 +91,7 @@ Example: Basic Usage
|
|
|
Using this module in a project to conditionally set an option:
|
|
Using this module in a project to conditionally set an option:
|
|
|
|
|
|
|
|
.. code-block:: cmake
|
|
.. code-block:: cmake
|
|
|
- :caption: CMakeLists.txt
|
|
|
|
|
|
|
+ :caption: ``CMakeLists.txt``
|
|
|
|
|
|
|
|
include(CMakeDependentOption)
|
|
include(CMakeDependentOption)
|
|
|
|
|
|
|
@@ -96,7 +104,7 @@ Extending the previous example, this demonstrates how the module allows
|
|
|
user-configurable options based on a condition during the configuration phase:
|
|
user-configurable options based on a condition during the configuration phase:
|
|
|
|
|
|
|
|
.. code-block:: cmake
|
|
.. code-block:: cmake
|
|
|
- :caption: CMakeLists.txt
|
|
|
|
|
|
|
+ :caption: ``CMakeLists.txt``
|
|
|
|
|
|
|
|
include(CMakeDependentOption)
|
|
include(CMakeDependentOption)
|
|
|
|
|
|
|
@@ -151,7 +159,7 @@ runs, the previous value of ``USE_FOO`` is preserved so that when it becomes
|
|
|
available again, it retains its last set value.
|
|
available again, it retains its last set value.
|
|
|
|
|
|
|
|
.. code-block:: cmake
|
|
.. code-block:: cmake
|
|
|
- :caption: CMakeLists.txt
|
|
|
|
|
|
|
+ :caption: ``CMakeLists.txt``
|
|
|
|
|
|
|
|
include(CMakeDependentOption)
|
|
include(CMakeDependentOption)
|
|
|
|
|
|
|
@@ -168,7 +176,7 @@ in the GUI. The value of ``USE_FOO`` is preserved across configuration runs,
|
|
|
similar to the previous example.
|
|
similar to the previous example.
|
|
|
|
|
|
|
|
.. code-block:: cmake
|
|
.. code-block:: cmake
|
|
|
- :caption: CMakeLists.txt
|
|
|
|
|
|
|
+ :caption: ``CMakeLists.txt``
|
|
|
|
|
|
|
|
include(CMakeDependentOption)
|
|
include(CMakeDependentOption)
|
|
|
|
|
|
|
@@ -178,7 +186,7 @@ Another example demonstrates how an option can be conditionally available based
|
|
|
on the target system:
|
|
on the target system:
|
|
|
|
|
|
|
|
.. code-block:: cmake
|
|
.. code-block:: cmake
|
|
|
- :caption: CMakeLists.txt
|
|
|
|
|
|
|
+ :caption: ``CMakeLists.txt``
|
|
|
|
|
|
|
|
include(CMakeDependentOption)
|
|
include(CMakeDependentOption)
|
|
|
|
|
|