summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorJoachim Wuttke (o) <j.wuttke@fz-juelich.de>2018-10-10 07:39:17 (GMT)
committerCraig Scott <craig.scott@crascit.com>2018-10-18 20:25:34 (GMT)
commitfc7ee1ca459c3b231aa1fb64aeeaee590c019513 (patch)
tree77525a7817e1d2be7cb55c91ff0357bc9e284fc4 /Modules
parent74b3eacdc755bc056aac65bf5c0b45aa02d097d4 (diff)
downloadCMake-fc7ee1ca459c3b231aa1fb64aeeaee590c019513.zip
CMake-fc7ee1ca459c3b231aa1fb64aeeaee590c019513.tar.gz
CMake-fc7ee1ca459c3b231aa1fb64aeeaee590c019513.tar.bz2
Help: Override pygments CMakeLexer to support <..> and [..]
* The code snippets in the docs consist of CMake code mixed with syntax definition punctuation like < > [ ] ... Therefore a pure CMake lexer is inadequate. Here it is replaced by a CMake syntax definition parser. * Fixed syntax definition snippets in FindPkgConfig.cmake to make best use of syntax highlighting. This source file is the hardest to support because it contains comparison operators <= = >=, which need special attention to avoid confusion with the placeholder indicators <...>. * Fixed syntax in execute_process.rst (there were unbalanced brackets). * Disabled syntax highlighting for long string examples in cmake-language.7.rst. * No highlighting of removed syntax in CMP0049 * To inspect the outcome of this patch, see e.g. the pages * manual/cmake-buildsystem.7.html * module/ExternalProject.html * module/FindPkgConfig.html which are particularly rich in complex code snippets.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/ExternalProject.cmake24
-rw-r--r--Modules/FindPkgConfig.cmake26
2 files changed, 34 insertions, 16 deletions
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index f987d2d..eb4f9fa 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -16,7 +16,9 @@ External Project Definition
The ``ExternalProject_Add()`` function creates a custom target to drive
download, update/patch, configure, build, install and test steps of an
- external project::
+ external project:
+
+ .. code-block:: cmake
ExternalProject_Add(<name> [<option>...])
@@ -608,7 +610,9 @@ External Project Definition
appended to them by following them with as many ``COMMAND ...`` options
as needed
(:manual:`generator expressions <cmake-generator-expressions(7)>` are
- supported). For example::
+ supported). For example:
+
+ .. code-block:: cmake
ExternalProject_Add(example
... # Download options, etc.
@@ -627,7 +631,9 @@ Obtaining Project Properties
.. command:: ExternalProject_Get_Property
The ``ExternalProject_Get_Property()`` function retrieves external project
- target properties::
+ target properties:
+
+ .. code-block:: cmake
ExternalProject_Get_Property(<name> <prop1> [<prop2>...])
@@ -655,7 +661,9 @@ control needed to implement such step-level capabilities.
The ``ExternalProject_Add_Step()`` function specifies an additional custom
step for an external project defined by an earlier call to
- :command:`ExternalProject_Add`::
+ :command:`ExternalProject_Add`:
+
+ .. code-block:: cmake
ExternalProject_Add_Step(<name> <step> [<option>...])
@@ -722,7 +730,9 @@ control needed to implement such step-level capabilities.
The ``ExternalProject_Add_StepTargets()`` function generates targets for the
steps listed. The name of each created target will be of the form
- ``<name>-<step>``::
+ ``<name>-<step>``:
+
+ .. code-block:: cmake
ExternalProject_Add_StepTargets(<name> [NO_DEPENDS] <step1> [<step2>...])
@@ -773,7 +783,9 @@ control needed to implement such step-level capabilities.
The ``ExternalProject_Add_StepDependencies()`` function can be used to add
dependencies to a step. The dependencies added must be targets CMake already
knows about (these can be ordinary executable or library targets, custom
- targets or even step targets of another external project)::
+ targets or even step targets of another external project):
+
+ .. code-block:: cmake
ExternalProject_Add_StepDependencies(<name> <step> <target1> [<target2>...])
diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake
index a451ba5..a45aef2 100644
--- a/Modules/FindPkgConfig.cmake
+++ b/Modules/FindPkgConfig.cmake
@@ -88,7 +88,9 @@ endmacro()
.. command:: pkg_get_variable
Retrieves the value of a pkg-config variable ``varName`` and stores it in the
- result variable ``resultVar`` in the calling scope. ::
+ result variable ``resultVar`` in the calling scope.
+
+ .. code-block:: cmake
pkg_get_variable(<resultVar> <moduleName> <varName>)
@@ -514,7 +516,9 @@ endmacro()
.. command:: pkg_check_modules
Checks for all the given modules, setting a variety of result variables in
- the calling scope. ::
+ the calling scope.
+
+ .. code-block:: cmake
pkg_check_modules(<prefix>
[REQUIRED] [QUIET]
@@ -552,10 +556,10 @@ endmacro()
- ``foo>=3.1`` matches any version from 3.1 or later.
- ``foo=1.2.3`` requires that foo must be exactly version 1.2.3.
- The following variables may be set upon return. Two sets of values exist,
- one for the common case (``<XXX> = <prefix>``) and another for the
- information ``pkg-config`` provides when it is called with the ``--static``
- option (``<XXX> = <prefix>_STATIC``)
+ The following variables may be set upon return. Two sets of values exist:
+ One for the common case (``<XXX> = <prefix>``) and another for the
+ information ``pkg-config`` provides when called with the ``--static``
+ option (``<XXX> = <prefix>_STATIC``).
``<XXX>_FOUND``
set to 1 if module(s) exist
@@ -582,7 +586,7 @@ endmacro()
There are some special variables whose prefix depends on the number of
``<moduleSpec>`` given. When there is only one ``<moduleSpec>``,
``<YYY>`` will simply be ``<prefix>``, but if two or more ``<moduleSpec>``
- items are given, ``<YYY>`` will be ``<prefix>_<moduleName>``
+ items are given, ``<YYY>`` will be ``<prefix>_<moduleName>``.
``<YYY>_VERSION``
version of the module
@@ -593,7 +597,7 @@ endmacro()
``<YYY>_LIBDIR``
lib directory of the module
- Examples
+ Examples:
.. code-block:: cmake
@@ -653,7 +657,9 @@ endmacro()
The behavior of this command is the same as :command:`pkg_check_modules`,
except that rather than checking for all the specified modules, it searches
- for just the first successful match. ::
+ for just the first successful match.
+
+ .. code-block:: cmake
pkg_search_module(<prefix>
[REQUIRED] [QUIET]
@@ -662,7 +668,7 @@ endmacro()
[IMPORTED_TARGET [GLOBAL]]
<moduleSpec> [<moduleSpec>...])
- Examples
+ Example:
.. code-block:: cmake