summaryrefslogtreecommitdiffstats
path: root/Help/command
diff options
context:
space:
mode:
Diffstat (limited to 'Help/command')
-rw-r--r--Help/command/FIND_XXX.txt4
-rw-r--r--Help/command/add_custom_command.rst8
-rw-r--r--Help/command/add_custom_target.rst4
-rw-r--r--Help/command/configure_file.rst26
-rw-r--r--Help/command/file.rst40
-rw-r--r--Help/command/project.rst16
6 files changed, 84 insertions, 14 deletions
diff --git a/Help/command/FIND_XXX.txt b/Help/command/FIND_XXX.txt
index 97eecfc..aae1c38 100644
--- a/Help/command/FIND_XXX.txt
+++ b/Help/command/FIND_XXX.txt
@@ -11,8 +11,8 @@ The general signature is:
|FIND_XXX| (
<VAR>
name | |NAMES|
- [HINTS path1 [path2 ... ENV var]]
- [PATHS path1 [path2 ... ENV var]]
+ [HINTS [path | ENV var]... ]
+ [PATHS [path | ENV var]... ]
[PATH_SUFFIXES suffix1 [suffix2 ...]]
[DOC "cache documentation string"]
[REQUIRED]
diff --git a/Help/command/add_custom_command.rst b/Help/command/add_custom_command.rst
index 183bb72..c0b9593 100644
--- a/Help/command/add_custom_command.rst
+++ b/Help/command/add_custom_command.rst
@@ -80,8 +80,10 @@ The options are:
:prop_sf:`GENERATED` files during ``make clean``.
.. versionadded:: 3.20
- Arguments to ``BYPRODUCTS`` may use
+ Arguments to ``BYPRODUCTS`` may use a restricted set of
:manual:`generator expressions <cmake-generator-expressions(7)>`.
+ :ref:`Target-dependent expressions <Target-Dependent Queries>` are not
+ permitted.
``COMMAND``
Specify the command-line(s) to execute at build time.
@@ -235,8 +237,10 @@ The options are:
source file property.
.. versionadded:: 3.20
- Arguments to ``OUTPUT`` may use
+ Arguments to ``OUTPUT`` may use a restricted set of
:manual:`generator expressions <cmake-generator-expressions(7)>`.
+ :ref:`Target-dependent expressions <Target-Dependent Queries>` are not
+ permitted.
``USES_TERMINAL``
.. versionadded:: 3.2
diff --git a/Help/command/add_custom_target.rst b/Help/command/add_custom_target.rst
index 22d3f29..def23fa 100644
--- a/Help/command/add_custom_target.rst
+++ b/Help/command/add_custom_target.rst
@@ -55,8 +55,10 @@ The options are:
:prop_sf:`GENERATED` files during ``make clean``.
.. versionadded:: 3.20
- Arguments to ``BYPRODUCTS`` may use
+ Arguments to ``BYPRODUCTS`` may use a restricted set of
:manual:`generator expressions <cmake-generator-expressions(7)>`.
+ :ref:`Target-dependent expressions <Target-Dependent Queries>` are not
+ permitted.
``COMMAND``
Specify the command-line(s) to execute at build time.
diff --git a/Help/command/configure_file.rst b/Help/command/configure_file.rst
index d00f08b..086668c 100644
--- a/Help/command/configure_file.rst
+++ b/Help/command/configure_file.rst
@@ -36,8 +36,30 @@ or
depending on whether ``VAR`` is set in CMake to any value not considered
a false constant by the :command:`if` command. The "..." content on the
line after the variable name, if any, is processed as above.
-Input file lines of the form ``#cmakedefine01 VAR`` will be replaced with
-either ``#define VAR 1`` or ``#define VAR 0`` similarly.
+
+Unlike lines of the form ``#cmakedefine VAR ...``, in lines of the form
+``#cmakedefine01 VAR``, ``VAR`` itself will expand to ``VAR 0`` or ``VAR 1``
+rather than being assigned the value ``...``. Therefore, input lines of the form
+
+.. code-block:: c
+
+ #cmakedefine01 VAR
+
+will be replaced with either
+
+.. code-block:: c
+
+ #define VAR 0
+
+or
+
+.. code-block:: c
+
+ #define VAR 1
+
+Input lines of the form ``#cmakedefine01 VAR ...`` will expand
+as ``#cmakedefine01 VAR ... 0`` or ``#cmakedefine01 VAR ... 0``,
+which may lead to undefined behavior.
.. versionadded:: 3.10
The result lines (with the exception of the ``#undef`` comments) can be
diff --git a/Help/command/file.rst b/Help/command/file.rst
index 24e43e9..2b445c5 100644
--- a/Help/command/file.rst
+++ b/Help/command/file.rst
@@ -38,7 +38,8 @@ Synopsis
`Filesystem`_
file({`GLOB`_ | `GLOB_RECURSE`_} <out-var> [...] [<globbing-expr>...])
- file(`RENAME`_ <oldname> <newname>)
+ file(`RENAME`_ <oldname> <newname> [...])
+ file(`COPY_FILE`_ <oldname> <newname> [...])
file({`REMOVE`_ | `REMOVE_RECURSE`_ } [<files>...])
file(`MAKE_DIRECTORY`_ [<dir>...])
file({`COPY`_ | `INSTALL`_} <file>... DESTINATION <dir> [...])
@@ -675,11 +676,46 @@ Examples of recursive globbing include::
.. code-block:: cmake
- file(RENAME <oldname> <newname>)
+ file(RENAME <oldname> <newname>
+ [RESULT <result>]
+ [NO_REPLACE])
Move a file or directory within a filesystem from ``<oldname>`` to
``<newname>``, replacing the destination atomically.
+The options are:
+
+``RESULT <result>``
+ Set ``<result>`` variable to ``0`` on success or an error message otherwise.
+ If ``RESULT`` is not specified and the operation fails, an error is emitted.
+
+``NO_REPLACE``
+ If the ``<newname>`` path already exists, do not replace it.
+ If ``RESULT <result>`` is used, the result variable will be
+ set to ``NO_REPLACE``. Otherwise, an error is emitted.
+
+.. _COPY_FILE:
+
+.. code-block:: cmake
+
+ file(COPY_FILE <oldname> <newname>
+ [RESULT <result>]
+ [ONLY_IF_DIFFERENT])
+
+Copy a file from ``<oldname>`` to ``<newname>``. Directories are not
+supported. Symlinks are ignored and ``<oldfile>``'s content is read and
+written to ``<newname>`` as a new file.
+
+The options are:
+
+``RESULT <result>``
+ Set ``<result>`` variable to ``0`` on success or an error message otherwise.
+ If ``RESULT`` is not specified and the operation fails, an error is emitted.
+
+``ONLY_IF_DIFFERENT``
+ If the ``<newname>`` path already exists, do not replace it if it is the
+ same as ``<oldname>``. Otherwise, an error is emitted.
+
.. _REMOVE:
.. _REMOVE_RECURSE:
diff --git a/Help/command/project.rst b/Help/command/project.rst
index 6c931b6..8a6bc1e 100644
--- a/Help/command/project.rst
+++ b/Help/command/project.rst
@@ -20,12 +20,18 @@ Sets the name of the project, and stores it in the variable
``CMakeLists.txt`` also stores the project name in the
variable :variable:`CMAKE_PROJECT_NAME`.
-Also sets the variables
+Also sets the variables:
-* :variable:`PROJECT_SOURCE_DIR`,
- :variable:`<PROJECT-NAME>_SOURCE_DIR`
-* :variable:`PROJECT_BINARY_DIR`,
- :variable:`<PROJECT-NAME>_BINARY_DIR`
+:variable:`PROJECT_SOURCE_DIR`, :variable:`<PROJECT-NAME>_SOURCE_DIR`
+ Absolute path to the source directory for the project.
+
+:variable:`PROJECT_BINARY_DIR`, :variable:`<PROJECT-NAME>_BINARY_DIR`
+ Absolute path to the binary directory for the project.
+
+:variable:`PROJECT_IS_TOP_LEVEL`, :variable:`<PROJECT-NAME>_IS_TOP_LEVEL`
+ .. versionadded:: 3.21
+
+ Boolean value indicating whether the project is top-level.
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