summaryrefslogtreecommitdiffstats
path: root/Help
diff options
context:
space:
mode:
Diffstat (limited to 'Help')
-rw-r--r--Help/command/execute_process.rst4
-rw-r--r--Help/command/list.rst57
-rw-r--r--Help/command/project.rst31
-rw-r--r--Help/manual/cmake-toolchains.7.rst8
-rw-r--r--Help/manual/cmake.1.rst9
-rw-r--r--Help/prop_dir/ADDITIONAL_MAKE_CLEAN_FILES.rst2
-rw-r--r--Help/variable/CMAKE_EXECUTE_PROCESS_COMMAND_ECHO.rst6
7 files changed, 65 insertions, 52 deletions
diff --git a/Help/command/execute_process.rst b/Help/command/execute_process.rst
index e6ad037..14f879d 100644
--- a/Help/command/execute_process.rst
+++ b/Help/command/execute_process.rst
@@ -80,7 +80,9 @@ Options:
``COMMAND_ECHO <where>``
The command being run will be echo'ed to ``<where>`` with ``<where>``
- being set to ``STDERR``|``STDOUT``|``NONE``.
+ being set to one of ``STDERR``, ``STDOUT`` or ``NONE``.
+ See the :variable:`CMAKE_EXECUTE_PROCESS_COMMAND_ECHO` variable for a way
+ to control the default behavior when this option is not present.
``ENCODING <name>``
On Windows, the encoding that is used to decode output from the process.
diff --git a/Help/command/list.rst b/Help/command/list.rst
index 4444af7..39e7e2a 100644
--- a/Help/command/list.rst
+++ b/Help/command/list.rst
@@ -207,84 +207,81 @@ but if duplicates are encountered, only the first instance is preserved.
[OUTPUT_VARIABLE <output variable>])
Transforms the list by applying an action to all or, by specifying a
-``<SELECTOR>``, to the selected elements of the list, storing result in-place
-or in the specified output variable.
+``<SELECTOR>``, to the selected elements of the list, storing the result
+in-place or in the specified output variable.
.. note::
- ``TRANSFORM`` sub-command does not change the number of elements of the
+ The ``TRANSFORM`` sub-command does not change the number of elements in the
list. If a ``<SELECTOR>`` is specified, only some elements will be changed,
- the other ones will remain same as before the transformation.
+ the other ones will remain the same as before the transformation.
-``<ACTION>`` specify the action to apply to the elements of list.
-The actions have exactly the same semantics as sub-commands of
-:command:`string` command.
-
-The ``<ACTION>`` may be one of:
+``<ACTION>`` specifies the action to apply to the elements of the list.
+The actions have exactly the same semantics as sub-commands of the
+:command:`string` command. ``<ACTION>`` must be one of the following:
``APPEND``, ``PREPEND``: Append, prepend specified value to each element of
the list.
-.. code-block:: cmake
+ .. code-block:: cmake
- list(TRANSFORM <list> <APPEND|PREPEND> <value> ...)
+ list(TRANSFORM <list> <APPEND|PREPEND> <value> ...)
``TOUPPER``, ``TOLOWER``: Convert each element of the list to upper, lower
characters.
-.. code-block:: cmake
+ .. code-block:: cmake
- list(TRANSFORM <list> <TOLOWER|TOUPPER> ...)
+ list(TRANSFORM <list> <TOLOWER|TOUPPER> ...)
``STRIP``: Remove leading and trailing spaces from each element of the
list.
-.. code-block:: cmake
+ .. code-block:: cmake
- list(TRANSFORM <list> STRIP ...)
+ list(TRANSFORM <list> STRIP ...)
``GENEX_STRIP``: Strip any
:manual:`generator expressions <cmake-generator-expressions(7)>` from each
element of the list.
-.. code-block:: cmake
+ .. code-block:: cmake
- list(TRANSFORM <list> GENEX_STRIP ...)
+ list(TRANSFORM <list> GENEX_STRIP ...)
``REPLACE``: Match the regular expression as many times as possible and
substitute the replacement expression for the match for each element
of the list
(Same semantic as ``REGEX REPLACE`` from :command:`string` command).
-.. code-block:: cmake
-
- list(TRANSFORM <list> REPLACE <regular_expression>
- <replace_expression> ...)
+ .. code-block:: cmake
-``<SELECTOR>`` select which elements of the list will be transformed. Only one
-type of selector can be specified at a time.
+ list(TRANSFORM <list> REPLACE <regular_expression>
+ <replace_expression> ...)
-The ``<SELECTOR>`` may be one of:
+``<SELECTOR>`` determines which elements of the list will be transformed.
+Only one type of selector can be specified at a time. When given,
+``<SELECTOR>`` must be one of the following:
``AT``: Specify a list of indexes.
-.. code-block:: cmake
+ .. code-block:: cmake
- list(TRANSFORM <list> <ACTION> AT <index> [<index> ...] ...)
+ list(TRANSFORM <list> <ACTION> AT <index> [<index> ...] ...)
``FOR``: Specify a range with, optionally, an increment used to iterate over
the range.
-.. code-block:: cmake
+ .. code-block:: cmake
- list(TRANSFORM <list> <ACTION> FOR <start> <stop> [<step>] ...)
+ list(TRANSFORM <list> <ACTION> FOR <start> <stop> [<step>] ...)
``REGEX``: Specify a regular expression. Only elements matching the regular
expression will be transformed.
-.. code-block:: cmake
+ .. code-block:: cmake
- list(TRANSFORM <list> <ACTION> REGEX <regular_expression> ...)
+ list(TRANSFORM <list> <ACTION> REGEX <regular_expression> ...)
Ordering
diff --git a/Help/command/project.rst b/Help/command/project.rst
index 41e1112..baf18be 100644
--- a/Help/command/project.rst
+++ b/Help/command/project.rst
@@ -31,14 +31,6 @@ Further variables are set by the optional arguments described in the following.
If any of these arguments is not used, then the corresponding variables are
set to the empty string.
-If the variable :variable:`CMAKE_PROJECT_INCLUDE_BEFORE` exists, the file
-pointed to by that variable will be included as the first step of the project
-command.
-
-If the variable :variable:`CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE`
-or :variable:`CMAKE_PROJECT_INCLUDE` exists, the file pointed to by that
-variable will be included as the last step of the project command.
-
Options
^^^^^^^
@@ -63,7 +55,7 @@ The options are:
* :variable:`PROJECT_VERSION_TWEAK`,
:variable:`<PROJECT-NAME>_VERSION_TWEAK`.
- When the :command:`project()` command is called from the top-level ``CMakeLists.txt``,
+ When the ``project()`` command is called from the top-level ``CMakeLists.txt``,
then the version is also stored in the variable :variable:`CMAKE_PROJECT_VERSION`.
``DESCRIPTION <project-description-string>``
@@ -76,7 +68,7 @@ The options are:
It is recommended that this description is a relatively short string,
usually no more than a few words.
- When the :command:`project()` command is called from the top-level ``CMakeLists.txt``,
+ When the ``project()`` command is called from the top-level ``CMakeLists.txt``,
then the description is also stored in the variable :variable:`CMAKE_PROJECT_DESCRIPTION`.
``HOMEPAGE_URL <url-string>``
@@ -87,7 +79,7 @@ The options are:
to ``<url-string>``, which should be the canonical home URL for the project.
- When the :command:`project()` command is called from the top-level ``CMakeLists.txt``,
+ When the ``project()`` command is called from the top-level ``CMakeLists.txt``,
then the URL also is stored in the variable :variable:`CMAKE_PROJECT_HOMEPAGE_URL`.
``LANGUAGES <language-name>...``
@@ -106,18 +98,31 @@ The options are:
The variables set through the ``VERSION``, ``DESCRIPTION`` and ``HOMEPAGE_URL``
options are intended for use as default values in package metadata and documentation.
+Code Injection
+^^^^^^^^^^^^^^
+
+If the :variable:`CMAKE_PROJECT_INCLUDE_BEFORE` variable is set, the file
+pointed to by that variable will be included as the first step of the
+``project()`` command.
+
+If the :variable:`CMAKE_PROJECT_INCLUDE` or
+:variable:`CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE` variables are set, the files
+they point to will be included as the last step of the ``project()`` command.
+If both are set, then :variable:`CMAKE_PROJECT_INCLUDE` will be included before
+:variable:`CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE`.
+
Usage
^^^^^
The top-level ``CMakeLists.txt`` file for a project must contain a
-literal, direct call to the :command:`project` command; loading one
+literal, direct call to the ``project()`` command; loading one
through the :command:`include` command is not sufficient. If no such
call exists, CMake will issue a warning and pretend there is a
``project(Project)`` at the top to enable the default languages
(``C`` and ``CXX``).
.. note::
- Call the :command:`project()` command near the top of the top-level
+ Call the ``project()`` command near the top of the top-level
``CMakeLists.txt``, but *after* calling :command:`cmake_minimum_required`.
It is important to establish version and policy settings before invoking
other commands whose behavior they may affect.
diff --git a/Help/manual/cmake-toolchains.7.rst b/Help/manual/cmake-toolchains.7.rst
index df4531b..7435d9a 100644
--- a/Help/manual/cmake-toolchains.7.rst
+++ b/Help/manual/cmake-toolchains.7.rst
@@ -101,6 +101,14 @@ values for the compilers.
The :variable:`CMAKE_CROSSCOMPILING` variable is set to true when CMake is
cross-compiling.
+Note that using the :variable:`CMAKE_SOURCE_DIR` or :variable:`CMAKE_BINARY_DIR`
+variables inside a toolchain file is typically undesirable. The toolchain
+file is used in contexts where these variables have different values when used
+in different places (e.g. as part of a call to :command:`try_compile`). In most
+cases, where there is a need to evaluate paths inside a toolchain file, the more
+appropriate variable to use would be :variable:`CMAKE_CURRENT_LIST_DIR`, since
+it always has an unambiguous, predictable value.
+
Cross Compiling for Linux
-------------------------
diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst
index fe32c51..7b5399d 100644
--- a/Help/manual/cmake.1.rst
+++ b/Help/manual/cmake.1.rst
@@ -290,7 +290,8 @@ following options:
value of ``1`` can be used to limit to a single job.
``--target <tgt>..., -t <tgt>...``
- Build ``<tgt>`` instead of default targets. May be specified multiple times.
+ Build ``<tgt>`` instead of the default target. Multiple targets may be
+ given, separated by spaces.
``--config <cfg>``
For multi-configuration tools, choose configuration ``<cfg>``.
@@ -333,16 +334,16 @@ The options are:
Project binary directory to install. This is required and must be first.
``--config <cfg>``
- For multi-configuration tools, choose configuration ``<cfg>``.
+ For multi-configuration generators, choose configuration ``<cfg>``.
``--component <comp>``
Component-based install. Only install component ``<comp>``.
``--prefix <prefix>``
- The installation prefix :variable:`CMAKE_INSTALL_PREFIX`.
+ Override the installation prefix, :variable:`CMAKE_INSTALL_PREFIX`.
``--strip``
- Strip before installing by setting ``CMAKE_INSTALL_DO_STRIP``.
+ Strip before installing.
``-v, --verbose``
Enable verbose output.
diff --git a/Help/prop_dir/ADDITIONAL_MAKE_CLEAN_FILES.rst b/Help/prop_dir/ADDITIONAL_MAKE_CLEAN_FILES.rst
index 893a298..b6f6160 100644
--- a/Help/prop_dir/ADDITIONAL_MAKE_CLEAN_FILES.rst
+++ b/Help/prop_dir/ADDITIONAL_MAKE_CLEAN_FILES.rst
@@ -13,5 +13,5 @@ part of the ``make clean`` target.
Arguments to :prop_dir:`ADDITIONAL_MAKE_CLEAN_FILES` may use
:manual:`generator expressions <cmake-generator-expressions(7)>`.
-This property only works for the the Makefile generators.
+This property only works for the Makefile generators.
It is ignored on other generators.
diff --git a/Help/variable/CMAKE_EXECUTE_PROCESS_COMMAND_ECHO.rst b/Help/variable/CMAKE_EXECUTE_PROCESS_COMMAND_ECHO.rst
index 4a3121c..76561d8 100644
--- a/Help/variable/CMAKE_EXECUTE_PROCESS_COMMAND_ECHO.rst
+++ b/Help/variable/CMAKE_EXECUTE_PROCESS_COMMAND_ECHO.rst
@@ -1,6 +1,6 @@
CMAKE_EXECUTE_PROCESS_COMMAND_ECHO
----------------------------------
-If this variable is set to ``STDERR``|``STDOUT``|``NONE`` then commands in
-:command:`execute_process` calls will be printed to either stderr or stdout
-or not at all.
+If this variable is set to ``STDERR``, ``STDOUT`` or ``NONE`` then commands
+in :command:`execute_process` calls will be printed to either stderr or
+stdout or not at all.