From 4f4d5a9b3a0d5288570d40c35ec4895f9542e97f Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (o)" Date: Thu, 25 Oct 2018 13:55:30 +0200 Subject: Help: Apply syntax highlighting to cmake-generator-expressions.7 --- Help/manual/cmake-generator-expressions.7.rst | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst index 76fd3d9..0826ce0 100644 --- a/Help/manual/cmake-generator-expressions.7.rst +++ b/Help/manual/cmake-generator-expressions.7.rst @@ -31,7 +31,9 @@ Logical Expressions Logical expressions are used to create conditional output. The basic expressions are the ``0`` and ``1`` expressions. Because other logical expressions evaluate to either ``0`` or ``1``, they can be composed to -create conditional output:: +create conditional output: + +.. code-block:: cmake $<$:DEBUG_MODE> @@ -151,14 +153,18 @@ Informational Expressions ========================= These expressions expand to some information. The information may be used -directly, eg:: +directly, eg: + +.. code-block:: cmake include_directories(/usr/include/$/) expands to ``/usr/include/GNU/`` or ``/usr/include/Clang/`` etc, depending on the Id of the compiler. -These expressions may also may be combined with logical expressions:: +These expressions may also may be combined with logical expressions: + +.. code-block:: cmake $<$,4.2.0>:OLD_COMPILER> @@ -246,18 +252,24 @@ Output Expressions These expressions generate output, in some cases depending on an input. These expressions may be combined with other expressions for information or logical -comparison:: +comparison: + +.. code-block:: cmake -I$, -I> generates a string of the entries in the :prop_tgt:`INCLUDE_DIRECTORIES` target property with each entry preceded by ``-I``. Note that a more-complete use in this situation would require first checking if the INCLUDE_DIRECTORIES -property is non-empty:: +property is non-empty: + +.. code-block:: cmake $<$:-I$> -where ``${prop}`` refers to a helper variable:: +where ``${prop}`` refers to a helper variable: + +.. code-block:: cmake set(prop "$") -- cgit v0.12 From 14edbe7e7bee52ff753dc73a9d731d2b27a8ee9d Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (o)" Date: Thu, 25 Oct 2018 14:00:34 +0200 Subject: Help: Syntax highlighting for long strings in cmake-language.7 --- Help/manual/cmake-language.7.rst | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/Help/manual/cmake-language.7.rst b/Help/manual/cmake-language.7.rst index 8740d97..630a86b 100644 --- a/Help/manual/cmake-language.7.rst +++ b/Help/manual/cmake-language.7.rst @@ -257,27 +257,31 @@ invocation as exactly one argument. .. No code-block syntax highlighting in the following example (escape \" not supported by our cmake.py) -For example:: +For example: - message("This is a quoted argument containing multiple lines. - This is always one argument even though it contains a ; character. - Both \\-escape sequences and ${variable} references are evaluated. - The text does not end on an escaped double-quote like \". - It does end in an unescaped double quote. - ") +.. code-block:: cmake + + message("This is a quoted argument containing multiple lines. + This is always one argument even though it contains a ; character. + Both \\-escape sequences and ${variable} references are evaluated. + The text does not end on an escaped double-quote like \". + It does end in an unescaped double quote. + ") .. No code-block syntax highlighting in the following example (for conformity with the two above examples) The final ``\`` on any line ending in an odd number of backslashes is treated as a line continuation and ignored along with the -immediately following newline character. For example:: +immediately following newline character. For example: + +.. code-block:: cmake - message("\ - This is the first line of a quoted argument. \ - In fact it is the only line but since it is long \ - the source code uses line continuation.\ - ") + message("\ + This is the first line of a quoted argument. \ + In fact it is the only line but since it is long \ + the source code uses line continuation.\ + ") .. note:: CMake versions prior to 3.0 do not support continuation with ``\``. -- cgit v0.12