From fb423b3c49d21df851b1d4a91fddfe94d835155b Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (h)" Date: Sun, 4 Nov 2018 19:31:22 +0100 Subject: Help: sort conditional expressions below string-valued ones. Makes things yet clearer and simpler. Also correct remnant of "informational expression". --- Help/manual/cmake-generator-expressions.7.rst | 59 +++++++++++++-------------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst index 4f2036e..cbeb348 100644 --- a/Help/manual/cmake-generator-expressions.7.rst +++ b/Help/manual/cmake-generator-expressions.7.rst @@ -30,41 +30,14 @@ deviates from most of the CMake documentation in that it omits angular brackets ``<...>`` around placeholders like ``condition``, ``true_value``, ``string``, and so on. -.. _`Conditional Generator Expressions`: - -Conditional Generator Expressions -================================= - -Conditional generator expressions depend on a boolean condition -that must be ``0`` or ``1``. - -``$`` - Evaluates to ``true_value`` if ``condition`` is ``1``. - Otherwise evaluates to the empty string. - -``$`` - Evaluates to ``true_value`` if ``condition`` is ``1``. - Otherwise evaluates to ``false_value``. - -Typically, the ``condition`` is a -:ref:`boolean generator expression`. -For instance, - -.. code-block:: cmake - - $<$:DEBUG_MODE> - -expands to ``DEBUG_MODE`` when the ``Debug`` configuration is used, and -otherwise expands to the empty string. - .. _`Boolean Generator Expressions`: Boolean Generator Expressions ============================= Boolean expressions evaluate to either ``0`` or ``1``. -They are typically used to construct the condition in a -:ref:`conditional generator expression`. +They are typically used to construct the condition in a :ref:`conditional +generator expression`. Available boolean expressions are: @@ -239,7 +212,7 @@ introduce a helper variable to keep the code readable: set(prop "$") # helper variable $<$:-I$> -Available informational expressions are: +The following string-valued generator expressions are available: Escaped Characters ------------------ @@ -253,6 +226,32 @@ String literals to escape the special meaning a character would otherwise have: ``$`` A literal ``;``. Used to prevent list expansion on an argument with ``;``. +.. _`Conditional Generator Expressions`: + +Conditional Expressions +----------------------- + +Conditional generator expressions depend on a boolean condition +that must be ``0`` or ``1``. + +``$`` + Evaluates to ``true_string`` if ``condition`` is ``1``. + Otherwise evaluates to the empty string. + +``$`` + Evaluates to ``true_string`` if ``condition`` is ``1``. + Otherwise evaluates to ``false_string``. + +Typically, the ``condition`` is a :ref:`boolean generator expression +`. For instance, + +.. code-block:: cmake + + $<$:DEBUG_MODE> + +expands to ``DEBUG_MODE`` when the ``Debug`` configuration is used, and +otherwise expands to the empty string. + String Operations ----------------- -- cgit v0.12