summaryrefslogtreecommitdiff
path: root/Help
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2021-10-08 09:20:10 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2021-10-08 09:20:10 +0900
commitf58f7a233a9b66287e1a0fad0d149e3202a098b4 (patch)
treecc0cea82fae3f153df9299b27650e17c58da1125 /Help
parent46f8b5215bbbfcf4bc0caed1daf52b678fd2b976 (diff)
downloadcmake-f58f7a233a9b66287e1a0fad0d149e3202a098b4.tar.gz
cmake-f58f7a233a9b66287e1a0fad0d149e3202a098b4.tar.bz2
cmake-f58f7a233a9b66287e1a0fad0d149e3202a098b4.zip
Imported Upstream version 3.18.0upstream/3.18.0
Diffstat (limited to 'Help')
-rw-r--r--Help/command/DEVICE_LINK_OPTIONS.txt11
-rw-r--r--Help/command/FIND_XXX.txt13
-rw-r--r--Help/command/add_compile_options.rst3
-rw-r--r--Help/command/add_executable.rst22
-rw-r--r--Help/command/add_library.rst9
-rw-r--r--Help/command/add_link_options.rst2
-rw-r--r--Help/command/add_test.rst5
-rw-r--r--Help/command/cmake_language.rst99
-rw-r--r--Help/command/ctest_test.rst4
-rw-r--r--Help/command/execute_process.rst13
-rw-r--r--Help/command/file.rst139
-rw-r--r--Help/command/find_package.rst36
-rw-r--r--Help/command/function.rst4
-rw-r--r--Help/command/get_property.rst21
-rw-r--r--Help/command/get_source_file_property.rst32
-rw-r--r--Help/command/get_target_property.rst10
-rw-r--r--Help/command/install.rst76
-rw-r--r--Help/command/list.rst7
-rw-r--r--Help/command/macro.rst4
-rw-r--r--Help/command/option.rst2
-rw-r--r--Help/command/separate_arguments.rst2
-rw-r--r--Help/command/set_property.rst29
-rw-r--r--Help/command/set_source_files_properties.rst28
-rw-r--r--Help/command/source_group.rst6
-rw-r--r--Help/command/string.rst21
-rw-r--r--Help/command/target_compile_options.rst2
-rw-r--r--Help/command/target_link_options.rst2
-rw-r--r--Help/command/target_precompile_headers.rst2
-rw-r--r--Help/cpack_gen/archive.rst65
-rw-r--r--Help/cpack_gen/cygwin.rst5
-rw-r--r--Help/cpack_gen/deb.rst6
-rw-r--r--Help/cpack_gen/freebsd.rst5
-rw-r--r--Help/cpack_gen/ifw.rst177
-rw-r--r--Help/cpack_gen/nsis.rst4
-rw-r--r--Help/cpack_gen/rpm.rst28
-rw-r--r--Help/dev/review.rst86
-rw-r--r--Help/dev/source.rst162
-rw-r--r--Help/dev/testing.rst2
-rw-r--r--Help/envvar/ASM_DIALECTFLAGS.rst2
-rw-r--r--Help/envvar/CCMAKE_COLORS.rst34
-rw-r--r--Help/envvar/CFLAGS.rst2
-rw-r--r--Help/envvar/CMAKE_PREFIX_PATH.rst17
-rw-r--r--Help/envvar/CSFLAGS.rst2
-rw-r--r--Help/envvar/CUDAFLAGS.rst2
-rw-r--r--Help/envvar/CXXFLAGS.rst2
-rw-r--r--Help/envvar/FFLAGS.rst2
-rw-r--r--Help/envvar/RCFLAGS.rst2
-rw-r--r--Help/guide/tutorial/Step5/MathFunctions/MakeTable.cxx25
-rw-r--r--Help/guide/tutorial/Step6/MathFunctions/CMakeLists.txt12
-rw-r--r--Help/guide/tutorial/index.rst10
-rw-r--r--Help/guide/user-interaction/index.rst5
-rw-r--r--Help/manual/cmake-commands.7.rst1
-rw-r--r--Help/manual/cmake-env-variables.7.rst15
-rw-r--r--Help/manual/cmake-file-api.7.rst20
-rw-r--r--Help/manual/cmake-generator-expressions.7.rst195
-rw-r--r--Help/manual/cmake-modules.7.rst1
-rw-r--r--Help/manual/cmake-policies.7.rst13
-rw-r--r--Help/manual/cmake-properties.7.rst12
-rw-r--r--Help/manual/cmake-variables.7.rst5
-rw-r--r--Help/manual/cmake.1.rst23
-rw-r--r--Help/manual/ctest.1.rst24
-rw-r--r--Help/module/CheckLinkerFlag.rst1
-rw-r--r--Help/policy/CMP0103.rst22
-rw-r--r--Help/policy/CMP0104.rst56
-rw-r--r--Help/policy/CMP0105.rst19
-rw-r--r--Help/policy/CMP0106.rst19
-rw-r--r--Help/policy/CMP0107.rst19
-rw-r--r--Help/policy/CMP0108.rst19
-rw-r--r--Help/prop_dir/LINK_OPTIONS.rst2
-rw-r--r--Help/prop_sf/COMPILE_OPTIONS.rst21
-rw-r--r--Help/prop_sf/Fortran_FORMAT.rst10
-rw-r--r--Help/prop_sf/Fortran_PREPROCESS.rst17
-rw-r--r--Help/prop_sf/OBJECT_OUTPUTS.rst3
-rw-r--r--Help/prop_sf/UNITY_GROUP.rst5
-rw-r--r--Help/prop_sf/VS_SETTINGS.rst18
-rw-r--r--Help/prop_test/DEPENDS.rst12
-rw-r--r--Help/prop_test/REQUIRED_FILES.rst33
-rw-r--r--Help/prop_tgt/ALIAS_GLOBAL.rst17
-rw-r--r--Help/prop_tgt/AUTOMOC_PATH_PREFIX.rst5
-rw-r--r--Help/prop_tgt/CONFIG_POSTFIX.rst3
-rw-r--r--Help/prop_tgt/CUDA_ARCHITECTURES.rst40
-rw-r--r--Help/prop_tgt/CUDA_STANDARD.rst2
-rw-r--r--Help/prop_tgt/C_STANDARD.rst4
-rw-r--r--Help/prop_tgt/EXCLUDE_FROM_ALL.rst12
-rw-r--r--Help/prop_tgt/FRAMEWORK_MULTI_CONFIG_POSTFIX_CONFIG.rst26
-rw-r--r--Help/prop_tgt/Fortran_PREPROCESS.rst23
-rw-r--r--Help/prop_tgt/IMPORTED_GLOBAL.rst16
-rw-r--r--Help/prop_tgt/INSTALL_RPATH.rst4
-rw-r--r--Help/prop_tgt/LINK_OPTIONS.rst12
-rw-r--r--Help/prop_tgt/PCH_WARN_INVALID.rst10
-rw-r--r--Help/prop_tgt/UNITY_BUILD.rst24
-rw-r--r--Help/prop_tgt/UNITY_BUILD_MODE.rst58
-rw-r--r--Help/prop_tgt/VS_PLATFORM_TOOLSET.rst10
-rw-r--r--Help/prop_tgt/VS_SOLUTION_DEPLOY.rst27
-rw-r--r--Help/prop_tgt/VS_SOURCE_SETTINGS_tool.rst19
-rw-r--r--Help/release/3.10.rst2
-rw-r--r--Help/release/3.16.rst16
-rw-r--r--Help/release/3.17.rst9
-rw-r--r--Help/release/3.18.rst320
-rw-r--r--Help/release/index.rst1
-rw-r--r--Help/variable/CMAKE_AUTOMOC_PATH_PREFIX.rst2
-rw-r--r--Help/variable/CMAKE_CUDA_ARCHITECTURES.rst17
-rw-r--r--Help/variable/CMAKE_FRAMEWORK_MULTI_CONFIG_POSTFIX_CONFIG.rst8
-rw-r--r--Help/variable/CMAKE_Fortran_PREPROCESS.rst8
-rw-r--r--Help/variable/CMAKE_LANG_FLAGS_INIT.rst6
-rw-r--r--Help/variable/CMAKE_PCH_WARN_INVALID.rst5
-rw-r--r--Help/variable/CMAKE_SYSTEM_PREFIX_PATH.rst34
-rw-r--r--Help/variable/CTEST_NIGHTLY_START_TIME.rst8
-rw-r--r--Help/variable/CTEST_RESOURCE_SPEC_FILE.rst10
-rw-r--r--Help/variable/PROJECT_SOURCE_DIR.rst8
110 files changed, 2231 insertions, 381 deletions
diff --git a/Help/command/DEVICE_LINK_OPTIONS.txt b/Help/command/DEVICE_LINK_OPTIONS.txt
new file mode 100644
index 000000000..3f0226fdc
--- /dev/null
+++ b/Help/command/DEVICE_LINK_OPTIONS.txt
@@ -0,0 +1,11 @@
+
+When a device link step is involved, which is controlled by
+:prop_tgt:`CUDA_SEPARABLE_COMPILATION` and
+:prop_tgt:`CUDA_RESOLVE_DEVICE_SYMBOLS` properties and policy :policy:`CMP0105`,
+the raw options will be delivered to the host and device link steps (wrapped in
+``-Xcompiler`` or equivalent for device link). Options wrapped with
+``$<DEVICE_LINK:...>``
+:manual:`generator expression <cmake-generator-expressions(7)>` will be used
+only for the device link step. Options wrapped with ``$<HOST_LINK:...>``
+:manual:`generator expression <cmake-generator-expressions(7)>` will be used
+only for the host link step.
diff --git a/Help/command/FIND_XXX.txt b/Help/command/FIND_XXX.txt
index 42bf52b08..4a62c5b5b 100644
--- a/Help/command/FIND_XXX.txt
+++ b/Help/command/FIND_XXX.txt
@@ -15,6 +15,7 @@ The general signature is:
[PATHS path1 [path2 ... ENV var]]
[PATH_SUFFIXES suffix1 [suffix2 ...]]
[DOC "cache documentation string"]
+ [REQUIRED]
[NO_DEFAULT_PATH]
[NO_PACKAGE_ROOT_PATH]
[NO_CMAKE_PATH]
@@ -31,8 +32,9 @@ A cache entry named by ``<VAR>`` is created to store the result
of this command.
If the |SEARCH_XXX| is found the result is stored in the variable
and the search will not be repeated unless the variable is cleared.
-If nothing is found, the result will be
-``<VAR>-NOTFOUND``, and the search will be attempted again the
+If nothing is found, the result will be ``<VAR>-NOTFOUND``.
+The ``REQUIRED`` option stops processing with an error message if nothing
+is found, otherwise the search will be attempted again the
next time |FIND_XXX| is invoked with the same variable.
Options include:
@@ -57,6 +59,9 @@ Options include:
``DOC``
Specify the documentation string for the ``<VAR>`` cache entry.
+``REQUIRED``
+ Stop processing with an error message if nothing is found.
+
If ``NO_DEFAULT_PATH`` is specified, then no additional paths are
added to the search.
If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows:
@@ -138,6 +143,10 @@ If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows:
* |CMAKE_SYSTEM_XXX_PATH|
* |CMAKE_SYSTEM_XXX_MAC_PATH|
+ The platform paths that these variables contain are locations that
+ typically include installed software. An example being ``/usr/local`` for
+ UNIX based platforms.
+
7. Search the paths specified by the PATHS option
or in the short-hand version of the command.
These are typically hard-coded guesses.
diff --git a/Help/command/add_compile_options.rst b/Help/command/add_compile_options.rst
index 43805c3a9..36f403c8a 100644
--- a/Help/command/add_compile_options.rst
+++ b/Help/command/add_compile_options.rst
@@ -46,3 +46,6 @@ to use the more specific commands :command:`add_compile_definitions`
and :command:`include_directories`.
The command :command:`target_compile_options` adds target-specific options.
+
+The source file property :prop_sf:`COMPILE_OPTIONS` adds options to one
+source file.
diff --git a/Help/command/add_executable.rst b/Help/command/add_executable.rst
index 0a7d7e151..e073228de 100644
--- a/Help/command/add_executable.rst
+++ b/Help/command/add_executable.rst
@@ -1,8 +1,15 @@
add_executable
--------------
+.. only:: html
+
+ .. contents::
+
Add an executable to the project using the specified source files.
+Normal Executables
+^^^^^^^^^^^^^^^^^^
+
.. code-block:: cmake
add_executable(<name> [WIN32] [MACOSX_BUNDLE]
@@ -45,7 +52,8 @@ See also :prop_sf:`HEADER_FILE_ONLY` on what to do if some sources are
pre-processed, and you want to have the original sources reachable from
within IDE.
---------------------------------------------------------------------------
+Imported Executables
+^^^^^^^^^^^^^^^^^^^^
.. code-block:: cmake
@@ -65,7 +73,8 @@ whose names begin in ``IMPORTED_``. The most important such property is
the main executable file on disk. See documentation of the ``IMPORTED_*``
properties for more information.
---------------------------------------------------------------------------
+Alias Executables
+^^^^^^^^^^^^^^^^^
.. code-block:: cmake
@@ -74,8 +83,13 @@ properties for more information.
Creates an :ref:`Alias Target <Alias Targets>`, such that ``<name>`` can
be used to refer to ``<target>`` in subsequent commands. The ``<name>``
does not appear in the generated buildsystem as a make target. The
-``<target>`` may not be a non-``GLOBAL``
-:ref:`Imported Target <Imported Targets>` or an ``ALIAS``.
+``<target>`` may not be an ``ALIAS``.
+
+An ``ALIAS`` to a non-``GLOBAL`` :ref:`Imported Target <Imported Targets>`
+has scope in the directory in which the alias is created and below.
+The :prop_tgt:`ALIAS_GLOBAL` target property can be used to check if the
+alias is global or not.
+
``ALIAS`` targets can be used as targets to read properties
from, executables for custom commands and custom targets. They can also be
tested for existence with the regular :command:`if(TARGET)` subcommand.
diff --git a/Help/command/add_library.rst b/Help/command/add_library.rst
index 7274e4474..01c415a92 100644
--- a/Help/command/add_library.rst
+++ b/Help/command/add_library.rst
@@ -139,8 +139,13 @@ Alias Libraries
Creates an :ref:`Alias Target <Alias Targets>`, such that ``<name>`` can be
used to refer to ``<target>`` in subsequent commands. The ``<name>`` does
not appear in the generated buildsystem as a make target. The ``<target>``
-may not be a non-``GLOBAL`` :ref:`Imported Target <Imported Targets>` or an
-``ALIAS``.
+may not be an ``ALIAS``.
+
+An ``ALIAS`` to a non-``GLOBAL`` :ref:`Imported Target <Imported Targets>`
+has scope in the directory in which the alias is created and below.
+The :prop_tgt:`ALIAS_GLOBAL` target property can be used to check if the
+alias is global or not.
+
``ALIAS`` targets can be used as linkable targets and as targets to
read properties from. They can also be tested for existence with the
regular :command:`if(TARGET)` subcommand. The ``<name>`` may not be used
diff --git a/Help/command/add_link_options.rst b/Help/command/add_link_options.rst
index a83005b06..faa4afb24 100644
--- a/Help/command/add_link_options.rst
+++ b/Help/command/add_link_options.rst
@@ -26,6 +26,8 @@ the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.
+.. include:: DEVICE_LINK_OPTIONS.txt
+
.. include:: OPTIONS_SHELL.txt
.. include:: LINK_OPTIONS_LINKER.txt
diff --git a/Help/command/add_test.rst b/Help/command/add_test.rst
index a77ba37cc..c0677d2b0 100644
--- a/Help/command/add_test.rst
+++ b/Help/command/add_test.rst
@@ -10,8 +10,9 @@ Add a test to the project to be run by :manual:`ctest(1)`.
[WORKING_DIRECTORY <dir>]
[COMMAND_EXPAND_LISTS])
-Adds a test called ``<name>``. The test name may not contain spaces,
-quotes, or other characters special in CMake syntax. The options are:
+Adds a test called ``<name>``. The test name may contain arbitrary
+characters except for double-quotes. However, if it contains spaces
+or semicolons it must be enclosed in double-quotes. The options are:
``COMMAND``
Specify the test command-line. If ``<command>`` specifies an
diff --git a/Help/command/cmake_language.rst b/Help/command/cmake_language.rst
new file mode 100644
index 000000000..09880975f
--- /dev/null
+++ b/Help/command/cmake_language.rst
@@ -0,0 +1,99 @@
+cmake_language
+--------------
+
+Call meta-operations on CMake commands.
+
+Synopsis
+^^^^^^^^
+
+.. parsed-literal::
+
+ cmake_language(`CALL`_ <command> [<args>...])
+ cmake_language(`EVAL`_ CODE <code>...)
+
+Introduction
+^^^^^^^^^^^^
+
+This command will call meta-operations on built-in CMake commands or
+those created via the :command:`macro` or :command:`function` commands.
+
+``cmake_language`` does not introduce a new variable or policy scope.
+
+Calling Commands
+^^^^^^^^^^^^^^^^
+
+.. _CALL:
+
+.. code-block:: cmake
+
+ cmake_language(CALL <command> [<args>...])
+
+Calls the named ``<command>`` with the given arguments (if any).
+For example, the code:
+
+.. code-block:: cmake
+
+ set(message_command "message")
+ cmake_language(CALL ${message_command} STATUS "Hello World!")
+
+is equivalent to
+
+.. code-block:: cmake
+
+ message(STATUS "Hello World!")
+
+.. note::
+ To ensure consistency of the code, the following commands are not allowed:
+
+ * ``if`` / ``elseif`` / ``else`` / ``endif``
+ * ``while`` / ``endwhile``
+ * ``foreach`` / ``endforeach``
+ * ``function`` / ``endfunction``
+ * ``macro`` / ``endmacro``
+
+Evaluating Code
+^^^^^^^^^^^^^^^
+
+.. _EVAL:
+
+.. code-block:: cmake
+
+ cmake_language(EVAL CODE <code>...)
+
+Evaluates the ``<code>...`` as CMake code.
+
+For example, the code:
+
+.. code-block:: cmake
+
+ set(A TRUE)
+ set(B TRUE)
+ set(C TRUE)
+ set(condition "(A AND B) OR C")
+
+ cmake_language(EVAL CODE "
+ if (${condition})
+ message(STATUS TRUE)
+ else()
+ message(STATUS FALSE)
+ endif()"
+ )
+
+is equivalent to
+
+.. code-block:: cmake
+
+ set(A TRUE)
+ set(B TRUE)
+ set(C TRUE)
+ set(condition "(A AND B) OR C")
+
+ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/eval.cmake "
+ if (${condition})
+ message(STATUS TRUE)
+ else()
+ message(STATUS FALSE)
+ endif()"
+ )
+
+ include(${CMAKE_CURRENT_BINARY_DIR}/eval.cmake)
diff --git a/Help/command/ctest_test.rst b/Help/command/ctest_test.rst
index 5c67b2c70..3589296ad 100644
--- a/Help/command/ctest_test.rst
+++ b/Help/command/ctest_test.rst
@@ -20,6 +20,7 @@ Perform the :ref:`CTest Test Step` as a :ref:`Dashboard Client`.
[RESOURCE_SPEC_FILE <file>]
[TEST_LOAD <threshold>]
[SCHEDULE_RANDOM <ON|OFF>]
+ [STOP_ON_FAILURE]
[STOP_TIME <time-of-day>]
[RETURN_VALUE <result-var>]
[CAPTURE_CMAKE_ERROR <result-var>]
@@ -119,6 +120,9 @@ The options are:
Launch tests in a random order. This may be useful for detecting
implicit test dependencies.
+``STOP_ON_FAILURE``
+ Stop the execution of the tests once one has failed.
+
``STOP_TIME <time-of-day>``
Specify a time of day at which the tests should all stop running.
diff --git a/Help/command/execute_process.rst b/Help/command/execute_process.rst
index 14f879d03..b32025fd4 100644
--- a/Help/command/execute_process.rst
+++ b/Help/command/execute_process.rst
@@ -21,7 +21,9 @@ Execute one or more child processes.
[COMMAND_ECHO <where>]
[OUTPUT_STRIP_TRAILING_WHITESPACE]
[ERROR_STRIP_TRAILING_WHITESPACE]
- [ENCODING <name>])
+ [ENCODING <name>]
+ [ECHO_OUTPUT_VARIABLE]
+ [ECHO_ERROR_VARIABLE])
Runs the given sequence of one or more commands.
@@ -105,6 +107,15 @@ Options:
for this encoding. In CMake 3.11.0, ``UTF-8`` was added for consistency with
the `UTF-8 RFC <https://www.ietf.org/rfc/rfc3629>`_ naming convention.
+``ECHO_OUTPUT_VARIABLE``, ``ECHO_ERROR_VARIABLE``
+ The standard output or standard error will not be exclusively redirected to
+ the configured variables.
+
+ The output will be duplicated, it will be sent into the configured variables
+ and also on standard output or standard error.
+
+ This is analogous to the ``tee`` Unix command.
+
If more than one ``OUTPUT_*`` or ``ERROR_*`` option is given for the
same pipe the precedence is not specified.
If no ``OUTPUT_*`` or ``ERROR_*`` options are given the output will
diff --git a/Help/command/file.rst b/Help/command/file.rst
index df7d8bad9..e7bc8d288 100644
--- a/Help/command/file.rst
+++ b/Help/command/file.rst
@@ -19,6 +19,7 @@ Synopsis
file({`WRITE`_ | `APPEND`_} <filename> <content>...)
file({`TOUCH`_ | `TOUCH_NOCREATE`_} [<file>...])
file(`GENERATE`_ OUTPUT <output-file> [...])
+ file(`CONFIGURE`_ OUTPUT <output-file> CONTENT <content> [...])
`Filesystem`_
file({`GLOB`_ | `GLOB_RECURSE`_} <out-var> [...] [<globbing-expr>...])
@@ -41,6 +42,10 @@ Synopsis
`Locking`_
file(`LOCK`_ <path> [...])
+ `Archiving`_
+ file(`ARCHIVE_CREATE`_ OUTPUT <archive> PATHS <paths>... [...])
+ file(`ARCHIVE_EXTRACT`_ INPUT <archive> [...])
+
Reading
^^^^^^^
@@ -54,7 +59,9 @@ Reading
Read content from a file called ``<filename>`` and store it in a
``<variable>``. Optionally start from the given ``<offset>`` and
read at most ``<max-in>`` bytes. The ``HEX`` option causes data to
-be converted to a hexadecimal representation (useful for binary data).
+be converted to a hexadecimal representation (useful for binary data). If the
+``HEX`` option is specified, letters in the output (``a`` through ``f``) are in
+lowercase.
.. _STRINGS:
@@ -395,8 +402,8 @@ dependency resolution:
Determines the path to the tool to use for dependency resolution. This is the
actual path to ``objdump``, ``dumpbin``, or ``otool``.
- If this variable is not specified, it is determined automatically by system
- introspection.
+ If this variable is not specified, it is determined by the value of
+ ``CMAKE_OBJDUMP`` if set, else by system introspection.
Writing
^^^^^^^
@@ -482,6 +489,44 @@ generation phase. The output file will not yet have been written when the
``file(GENERATE)`` command returns, it is written only after processing all
of a project's ``CMakeLists.txt`` files.
+.. _CONFIGURE:
+
+.. code-block:: cmake
+
+ file(CONFIGURE OUTPUT output-file
+ CONTENT content
+ [ESCAPE_QUOTES] [@ONLY]
+ [NEWLINE_STYLE [UNIX|DOS|WIN32|LF|CRLF] ])
+
+Generate an output file using the input given by ``CONTENT`` and substitute
+variable values referenced as ``@VAR@`` or ``${VAR}`` contained therein. The
+substitution rules behave the same as the :command:`configure_file` command.
+In order to match :command:`configure_file`'s behavior, generator expressions
+are not supported for both ``OUTPUT`` and ``CONTENT``.
+
+The arguments are:
+
+``OUTPUT <output-file>``
+ Specify the output file name to generate. A relative path is treated with
+ respect to the value of :variable:`CMAKE_CURRENT_BINARY_DIR`.
+ ``<output-file>`` does not support generator expressions.
+
+``CONTENT <content>``
+ Use the content given explicitly as input.
+ ``<content>`` does not support generator expressions.
+
+``ESCAPE_QUOTES``
+ Escape any substituted quotes with backslashes (C-style).
+
+``@ONLY``
+ Restrict variable replacement to references of the form ``@VAR@``.
+ This is useful for configuring scripts that use ``${VAR}`` syntax.
+
+``NEWLINE_STYLE <style>``
+ Specify the newline style for the output file. Specify
+ ``UNIX`` or ``LF`` for ``\n`` newlines, or specify
+ ``DOS``, ``WIN32``, or ``CRLF`` for ``\r\n`` newlines.
+
Filesystem
^^^^^^^^^^
@@ -790,6 +835,18 @@ Options to both ``DOWNLOAD`` and ``UPLOAD`` are:
If neither ``NETRC`` option is given CMake will check variables
``CMAKE_NETRC`` and ``CMAKE_NETRC_FILE``, respectively.
+``TLS_VERIFY <ON|OFF>``
+ Specify whether to verify the server certificate for ``https://`` URLs.
+ The default is to *not* verify.
+
+``TLS_CAINFO <file>``
+ Specify a custom Certificate Authority file for ``https://`` URLs.
+
+For ``https://`` URLs CMake must be built with OpenSSL support. ``TLS/SSL``
+certificates are not checked by default. Set ``TLS_VERIFY`` to ``ON`` to
+check certificates. If neither ``TLS`` option is given CMake will check
+variables ``CMAKE_TLS_VERIFY`` and ``CMAKE_TLS_CAINFO``, respectively.
+
Additional options to ``DOWNLOAD`` are:
``EXPECTED_HASH ALGO=<value>``
@@ -801,19 +858,6 @@ Additional options to ``DOWNLOAD`` are:
``EXPECTED_MD5 <value>``
Historical short-hand for ``EXPECTED_HASH MD5=<value>``.
-``TLS_VERIFY <ON|OFF>``
- Specify whether to verify the server certificate for ``https://`` URLs.
- The default is to *not* verify.
-
-``TLS_CAINFO <file>``
- Specify a custom Certificate Authority file for ``https://`` URLs.
-
-For ``https://`` URLs CMake must be built with OpenSSL support. ``TLS/SSL``
-certificates are not checked by default. Set ``TLS_VERIFY`` to ``ON`` to
-check certificates and/or use ``EXPECTED_HASH`` to verify downloaded content.
-If neither ``TLS`` option is given CMake will check variables
-``CMAKE_TLS_VERIFY`` and ``CMAKE_TLS_CAINFO``, respectively.
-
Locking
^^^^^^^
@@ -846,3 +890,66 @@ child directory or file.
Trying to lock file twice is not allowed. Any intermediate directories and
file itself will be created if they not exist. ``GUARD`` and ``TIMEOUT``
options ignored on ``RELEASE`` operation.
+
+Archiving
+^^^^^^^^^
+
+.. _ARCHIVE_CREATE:
+
+.. code-block:: cmake
+
+ file(ARCHIVE_CREATE OUTPUT <archive>
+ PATHS <paths>...
+ [FORMAT <format>]
+ [COMPRESSION <compression>]
+ [MTIME <mtime>]
+ [VERBOSE])
+
+Creates the specified ``<archive>`` file with the files and directories
+listed in ``<paths>``. Note that ``<paths>`` must list actual files or
+directories, wildcards are not supported.
+
+Use the ``FORMAT`` option to specify the archive format. Supported values
+for ``<format>`` are ``7zip``, ``gnutar``, ``pax``, ``paxr``, ``raw`` and
+``zip``. If ``FORMAT`` is not given, the default format is ``paxr``.
+
+Some archive formats allow the type of compression to be specified.
+The ``7zip`` and ``zip`` archive formats already imply a specific type of
+compression. The other formats use no compression by default, but can be
+directed to do so with the ``COMPRESSION`` option. Valid values for
+``<compression>`` are ``None``, ``BZip2``, ``GZip``, ``XZ``, and ``Zstd``.
+
+.. note::
+ With ``FORMAT`` set to ``raw`` only one file will be compressed with the
+ compression type specified by ``COMPRESSION``.
+
+The ``VERBOSE`` option enables verbose output for the archive operation.
+
+To specify the modification time recorded in tarball entries, use
+the ``MTIME`` option.
+
+.. _ARCHIVE_EXTRACT:
+
+.. code-block:: cmake
+
+ file(ARCHIVE_EXTRACT INPUT <archive>
+ [DESTINATION <dir>]
+ [PATTERNS <patterns>...]
+ [LIST_ONLY]
+ [VERBOSE])
+
+Extracts or lists the content of the specified ``<archive>``.
+
+The directory where the content of the archive will be extracted to can
+be specified using the ``DESTINATION`` option. If the directory does not
+exist, it will be created. If ``DESTINATION`` is not given, the current
+binary directory will be used.
+
+If required, you may select which files and directories to list or extract
+from the archive using the specified ``<patterns>``. Wildcards are supported.
+If the ``PATTERNS`` option is not given, the entire archive will be listed or
+extracted.
+
+``LIST_ONLY`` will list the files in the archive rather than extract them.
+
+With ``VERBOSE``, the command will produce verbose output.
diff --git a/Help/command/find_package.rst b/Help/command/find_package.rst
index 64a16f321..857de7832 100644
--- a/Help/command/find_package.rst
+++ b/Help/command/find_package.rst
@@ -59,7 +59,7 @@ for finding the package, checking the version, and producing any needed
messages. Some find-modules provide limited or no support for versioning;
check the module documentation.
-If the ``MODULE`` option is not specfied in the above signature,
+If the ``MODULE`` option is not specified in the above signature,
CMake first searches for the package using Module mode. Then, if the
package is not found, it searches again using Config mode. A user
may set the variable :variable:`CMAKE_FIND_PACKAGE_PREFER_CONFIG` to
@@ -302,23 +302,23 @@ enabled.
are intended to be used on the command line with a ``-DVAR=value``.
The values are interpreted as :ref:`semicolon-separated lists <CMake Language Lists>`.
This can be skipped if ``NO_CMAKE_PATH`` is passed or by setting the
- :variable:`CMAKE_FIND_USE_CMAKE_PATH` to ``FALSE``::
+ :variable:`CMAKE_FIND_USE_CMAKE_PATH` to ``FALSE``:
- CMAKE_PREFIX_PATH
- CMAKE_FRAMEWORK_PATH
- CMAKE_APPBUNDLE_PATH
+ * :variable:`CMAKE_PREFIX_PATH`
+ * :variable:`CMAKE_FRAMEWORK_PATH`
+ * :variable:`CMAKE_APPBUNDLE_PATH`
3. Search paths specified in cmake-specific environment variables.
These are intended to be set in the user's shell configuration,
and therefore use the host's native path separator
(``;`` on Windows and ``:`` on UNIX).
This can be skipped if ``NO_CMAKE_ENVIRONMENT_PATH`` is passed or by setting
- the :variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH` to ``FALSE``::
+ the :variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH` to ``FALSE``:
- <PackageName>_DIR
- CMAKE_PREFIX_PATH
- CMAKE_FRAMEWORK_PATH
- CMAKE_APPBUNDLE_PATH
+ * ``<PackageName>_DIR``
+ * :envvar:`CMAKE_PREFIX_PATH`
+ * ``CMAKE_FRAMEWORK_PATH``
+ * ``CMAKE_APPBUNDLE_PATH``
4. Search paths specified by the ``HINTS`` option. These should be paths
computed by system introspection, such as a hint provided by the
@@ -329,9 +329,9 @@ enabled.
skipped if ``NO_SYSTEM_ENVIRONMENT_PATH`` is passed or by setting the
:variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH` to ``FALSE``. Path entries
ending in ``/bin`` or ``/sbin`` are automatically converted to their
- parent directories::
+ parent directories:
- PATH
+ * ``PATH``
6. Search paths stored in the CMake :ref:`User Package Registry`.
This can be skipped if ``NO_CMAKE_PACKAGE_REGISTRY`` is passed or by
@@ -345,11 +345,15 @@ enabled.
7. Search cmake variables defined in the Platform files for the
current system. This can be skipped if ``NO_CMAKE_SYSTEM_PATH`` is
passed or by setting the :variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH`
- to ``FALSE``::
+ to ``FALSE``:
- CMAKE_SYSTEM_PREFIX_PATH
- CMAKE_SYSTEM_FRAMEWORK_PATH
- CMAKE_SYSTEM_APPBUNDLE_PATH
+ * :variable:`CMAKE_SYSTEM_PREFIX_PATH`
+ * :variable:`CMAKE_SYSTEM_FRAMEWORK_PATH`
+ * :variable:`CMAKE_SYSTEM_APPBUNDLE_PATH`
+
+ The platform paths that these variables contain are locations that
+ typically include installed software. An example being ``/usr/local`` for
+ UNIX based platforms.
8. Search paths stored in the CMake :ref:`System Package Registry`.
This can be skipped if ``NO_CMAKE_SYSTEM_PACKAGE_REGISTRY`` is passed
diff --git a/Help/command/function.rst b/Help/command/function.rst
index 53ba75481..7a9b90754 100644
--- a/Help/command/function.rst
+++ b/Help/command/function.rst
@@ -44,11 +44,15 @@ can be invoked through any of
foo()
Foo()
FOO()
+ cmake_language(CALL foo)
and so on. However, it is strongly recommended to stay with the
case chosen in the function definition. Typically functions use
all-lowercase names.
+The :command:`cmake_language(CALL ...)` command can also be used to
+invoke the function.
+
Arguments
^^^^^^^^^
diff --git a/Help/command/get_property.rst b/Help/command/get_property.rst
index c0f9b460a..06025183e 100644
--- a/Help/command/get_property.rst
+++ b/Help/command/get_property.rst
@@ -10,6 +10,7 @@ Get a property.
DIRECTORY [<dir>] |
TARGET <target> |
SOURCE <source> |
+ [DIRECTORY <dir> | TARGET_DIRECTORY <target>] |
INSTALL <file> |
TEST <test> |
CACHE <entry> |
@@ -30,18 +31,36 @@ It must be one of the following:
Scope defaults to the current directory but another
directory (already processed by CMake) may be named by the
full or relative path ``<dir>``.
+ See also the :command:`get_directory_property` command.
``TARGET``
Scope must name one existing target.
+ See also the :command:`get_target_property` command.
``SOURCE``
- Scope must name one source file.
+ Scope must name one source file. By default, the source file's property
+ will be read from the current source directory's scope, but this can be
+ overridden with one of the following sub-options:
+
+ ``DIRECTORY <dir>``
+ The source file property will be read from the ``<dir>`` directory's
+ scope. CMake must already know about that source directory, either by
+ having added it through a call to :command:`add_subdirectory` or ``<dir>``
+ being the top level source directory. Relative paths are treated as
+ relative to the current source directory.
+
+ ``TARGET_DIRECTORY <target>``
+ The source file property will be read from the directory scope in which
+ ``<target>`` was created (``<target>`` must therefore already exist).
+
+ See also the :command:`get_source_file_property` command.
``INSTALL``
Scope must name one installed file path.
``TEST``
Scope must name one existing test.
+ See also the :command:`get_test_property` command.
``CACHE``
Scope must name one cache entry.
diff --git a/Help/command/get_source_file_property.rst b/Help/command/get_source_file_property.rst
index decec1916..76ed776c0 100644
--- a/Help/command/get_source_file_property.rst
+++ b/Help/command/get_source_file_property.rst
@@ -5,15 +5,33 @@ Get a property for a source file.
.. code-block:: cmake
- get_source_file_property(VAR file property)
+ get_source_file_property(<variable> <file>
+ [DIRECTORY <dir> | TARGET_DIRECTORY <target>]
+ <property>)
Gets a property from a source file. The value of the property is
-stored in the variable ``VAR``. If the source property is not found, the
-behavior depends on whether it has been defined to be an ``INHERITED`` property
-or not (see :command:`define_property`). Non-inherited properties will set
-``VAR`` to "NOTFOUND", whereas inherited properties will search the relevant
-parent scope as described for the :command:`define_property` command and
-if still unable to find the property, ``VAR`` will be set to an empty string.
+stored in the specified ``<variable>``. If the source property is not found,
+the behavior depends on whether it has been defined to be an ``INHERITED``
+property or not (see :command:`define_property`). Non-inherited properties
+will set ``variable`` to ``NOTFOUND``, whereas inherited properties will search
+the relevant parent scope as described for the :command:`define_property`
+command and if still unable to find the property, ``variable`` will be set to
+an empty string.
+
+By default, the source file's property will be read from the current source
+directory's scope, but this can be overridden with one of the following
+sub-options:
+
+``DIRECTORY <dir>``
+ The source file property will be read from the ``<dir>`` directory's
+ scope. CMake must already know about that source directory, either by
+ having added it through a call to :command:`add_subdirectory` or ``<dir>``
+ being the top level source directory. Relative paths are treated as
+ relative to the current source directory.
+
+``TARGET_DIRECTORY <target>``
+ The source file property will be read from the directory scope in which
+ ``<target>`` was created (``<target>`` must therefore already exist).
Use :command:`set_source_files_properties` to set property values. Source
file properties usually control how the file is built. One property that is
diff --git a/Help/command/get_target_property.rst b/Help/command/get_target_property.rst
index 11e07eabe..985b1ff68 100644
--- a/Help/command/get_target_property.rst
+++ b/Help/command/get_target_property.rst
@@ -5,15 +5,15 @@ Get a property from a target.
.. code-block:: cmake
- get_target_property(VAR target property)
+ get_target_property(<VAR> target property)
Get a property from a target. The value of the property is stored in
-the variable ``VAR``. If the target property is not found, the behavior
+the variable ``<VAR>``. If the target property is not found, the behavior
depends on whether it has been defined to be an ``INHERITED`` property
or not (see :command:`define_property`). Non-inherited properties will
-set ``VAR`` to ``NOTFOUND``, whereas inherited properties will search the
-relevant parent scope as described for the :command:`define_property`
-command and if still unable to find the property, ``VAR`` will be set to
+set ``<VAR>`` to ``<VAR>-NOTFOUND``, whereas inherited properties will search
+the relevant parent scope as described for the :command:`define_property`
+command and if still unable to find the property, ``<VAR>`` will be set to
an empty string.
Use :command:`set_target_properties` to set target property values.
diff --git a/Help/command/install.rst b/Help/command/install.rst
index 5affc5b99..c8df7d92f 100644
--- a/Help/command/install.rst
+++ b/Help/command/install.rst
@@ -18,10 +18,12 @@ Synopsis
Introduction
^^^^^^^^^^^^
-This command generates installation rules for a project. Rules
-specified by calls to this command within a source directory are
-executed in order during installation. The order across directories
-is not defined.
+This command generates installation rules for a project. Install rules
+specified by calls to the ``install()`` command within a source directory
+are executed in order during installation. Install rules in subdirectories
+added by calls to the :command:`add_subdirectory` command are interleaved
+with those in the parent directory to run in the order declared (see
+policy :policy:`CMP0082`).
There are multiple signatures for this command. Some of them define
installation options for files and targets. Options common to
@@ -30,13 +32,20 @@ signatures that specify them. The common options are:
``DESTINATION``
Specify the directory on disk to which a file will be installed.
- If a full path (with a leading slash or drive letter) is given
- it is used directly. If a relative path is given it is interpreted
- relative to the value of the :variable:`CMAKE_INSTALL_PREFIX` variable.
+ Arguments can be relative or absolute paths.
+
+ If a relative path is given it is interpreted relative to the value
+ of the :variable:`CMAKE_INSTALL_PREFIX` variable.
The prefix can be relocated at install time using the ``DESTDIR``
mechanism explained in the :variable:`CMAKE_INSTALL_PREFIX` variable
documentation.
+ If an absolute path (with a leading slash or drive letter) is given
+ it is used verbatim.
+
+ As absolute paths are not supported by :manual:`cpack <cpack(1)>` installer
+ generators, it is preferable to use relative paths throughout.
+
``PERMISSIONS``
Specify permissions for installed files. Valid permissions are
``OWNER_READ``, ``OWNER_WRITE``, ``OWNER_EXECUTE``, ``GROUP_READ``,
@@ -119,31 +128,38 @@ Installing Targets
)
The ``TARGETS`` form specifies rules for installing targets from a
-project. There are several kinds of target files that may be installed:
+project. There are several kinds of target :ref:`Output Artifacts`
+that may be installed:
``ARCHIVE``
- Static libraries are treated as ``ARCHIVE`` targets, except those
- marked with the ``FRAMEWORK`` property on macOS (see ``FRAMEWORK``
- below.) For DLL platforms (all Windows-based systems including
- Cygwin), the DLL import library is treated as an ``ARCHIVE`` target.
- On AIX, the linker import file created for executables with
- :prop_tgt:`ENABLE_EXPORTS` is treated as an ``ARCHIVE`` target.
+ Target artifacts of this kind include:
+
+ * *Static libraries*
+ (except on macOS when marked as ``FRAMEWORK``, see below);
+ * *DLL import libraries*
+ (on all Windows-based systems including Cygwin; they have extension
+ ``.lib``, in contrast to the ``.dll`` libraries that go to ``RUNTIME``);
+ * On AIX, the *linker import file* created for executables with
+ :prop_tgt:`ENABLE_EXPORTS` enabled.
``LIBRARY``
- Module libraries are always treated as ``LIBRARY`` targets. For non-
- DLL platforms shared libraries are treated as ``LIBRARY`` targets,
- except those marked with the ``FRAMEWORK`` property on macOS (see
- ``FRAMEWORK`` below.)
+ Target artifacts of this kind include:
+
+ * *Shared libraries*, except
+
+ - DLLs (these go to ``RUNTIME``, see below),
+ - on macOS when marked as ``FRAMEWORK`` (see below).
``RUNTIME``
- Executables are treated as ``RUNTIME`` objects, except those marked
- with the ``MACOSX_BUNDLE`` property on macOS (see ``BUNDLE`` below.)
- For DLL platforms (all Windows-based systems including Cygwin), the
- DLL part of a shared library is treated as a ``RUNTIME`` target.
+ Target artifacts of this kind include:
+
+ * *Executables*
+ (except on macOS when marked as ``MACOSX_BUNDLE``, see ``BUNDLE`` below);
+ * DLLs (on all Windows-based systems including Cygwin; note that the
+ accompanying import libraries are of kind ``ARCHIVE``).
``OBJECTS``
- Object libraries (a simple group of object files) are always treated
- as ``OBJECTS`` targets.
+ Object files associated with *object libraries*.
``FRAMEWORK``
Both static and shared libraries marked with the ``FRAMEWORK``
@@ -630,6 +646,13 @@ present, causes the contents of the properties matching
``(IMPORTED_)?LINK_INTERFACE_LIBRARIES(_<CONFIG>)?`` to be exported, when
policy :policy:`CMP0022` is ``NEW``.
+.. note::
+ The installed ``<export-name>.cmake`` file may come with additional
+ per-configuration ``<export-name>-*.cmake`` files to be loaded by
+ globbing. Do not use an export name that is the same as the package
+ name in combination with installing a ``<package-name>-config.cmake``
+ file or the latter may be incorrectly matched by the glob and loaded.
+
When a ``COMPONENT`` option is given, the listed ``<component>`` implicitly
depends on all components mentioned in the export set. The exported
``<name>.cmake`` file will require each of the exported components to be
@@ -684,6 +707,11 @@ executable from the installation tree using the imported target name
Generated Installation Script
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. note::
+
+ Use of this feature is not recommended. Please consider using the
+ ``--install`` argument of :manual:`cmake(1)` instead.
+
The ``install()`` command generates a file, ``cmake_install.cmake``, inside
the build directory, which is used internally by the generated install target
and by CPack. You can also invoke this script manually with ``cmake -P``. This
diff --git a/Help/command/list.rst b/Help/command/list.rst
index 50bf417bf..4d339a03c 100644
--- a/Help/command/list.rst
+++ b/Help/command/list.rst
@@ -308,6 +308,13 @@ The ``<compare>`` option should be one of:
* ``STRING``: Sorts a list of strings alphabetically. This is the
default behavior if the ``COMPARE`` option is not given.
* ``FILE_BASENAME``: Sorts a list of pathnames of files by their basenames.
+* ``NATURAL``: Sorts a list of strings using natural order
+ (see ``strverscmp(3)`` manual), i.e. such that contiguous digits
+ are compared as whole numbers.
+ For example: the following list `10.0 1.1 2.1 8.0 2.0 3.1`
+ will be sorted as `1.1 2.0 2.1 3.1 8.0 10.0` if the ``NATURAL``
+ comparison is selected where it will be sorted as
+ `1.1 10.0 2.0 2.1 3.1 8.0` with the ``STRING`` comparison.
Use the ``CASE`` keyword to select a case sensitive or case insensitive
sort mode. The ``<case>`` option should be one of:
diff --git a/Help/command/macro.rst b/Help/command/macro.rst
index 008d049c8..797a90d8f 100644
--- a/Help/command/macro.rst
+++ b/Help/command/macro.rst
@@ -42,11 +42,15 @@ can be invoked through any of
foo()
Foo()
FOO()
+ cmake_language(CALL foo)
and so on. However, it is strongly recommended to stay with the
case chosen in the macro definition. Typically macros use
all-lowercase names.
+The :command:`cmake_language(CALL ...)` command can also be used to
+invoke the macro.
+
Arguments
^^^^^^^^^
diff --git a/Help/command/option.rst b/Help/command/option.rst
index 8956307c5..02b8dac90 100644
--- a/Help/command/option.rst
+++ b/Help/command/option.rst
@@ -9,7 +9,7 @@ Provide an option that the user can optionally select.
Provides an option for the user to select as ``ON`` or ``OFF``.
If no initial ``<value>`` is provided, ``OFF`` is used.
-If ``<variable>`` is already set as a normal variable
+If ``<variable>`` is already set as a normal or cache variable,
then the command does nothing (see policy :policy:`CMP0077`).
If you have options that depend on the values of other options, see
diff --git a/Help/command/separate_arguments.rst b/Help/command/separate_arguments.rst
index fbca859f2..ab3d5c1f7 100644
--- a/Help/command/separate_arguments.rst
+++ b/Help/command/separate_arguments.rst
@@ -19,7 +19,7 @@ They are specified by the ``<mode>`` argument which must
be one of the following keywords:
``UNIX_COMMAND``
- Arguments are separated by by unquoted whitespace.
+ Arguments are separated by unquoted whitespace.
Both single-quote and double-quote pairs are respected.
A backslash escapes the next literal character (``\"`` is ``"``);
there are no special escapes (``\n`` is just ``n``).
diff --git a/Help/command/set_property.rst b/Help/command/set_property.rst
index ec08c8f99..93c2d9cf2 100644
--- a/Help/command/set_property.rst
+++ b/Help/command/set_property.rst
@@ -8,12 +8,14 @@ Set a named property in a given scope.
set_property(<GLOBAL |
DIRECTORY [<dir>] |
TARGET [<target1> ...] |
- SOURCE [<src1> ...] |
+ SOURCE [<src1> ...]
+ [DIRECTORY <dirs> ...] |
+ [TARGET_DIRECTORY <targets> ...]
INSTALL [<file1> ...] |
TEST [<test1> ...] |
CACHE [<entry1> ...] >
[APPEND] [APPEND_STRING]
- PROPERTY <name> [value1 ...])
+ PROPERTY <name> [<value1> ...])
Sets one property on zero or more objects of a scope.
@@ -33,9 +35,23 @@ It must be one of the following:
See also the :command:`set_target_properties` command.
``SOURCE``
- Scope may name zero or more source files. Note that source
- file properties are visible only to targets added in the same
- directory (``CMakeLists.txt``).
+ Scope may name zero or more source files. By default, source file properties
+ are only visible to targets added in the same directory (``CMakeLists.txt``).
+ Visibility can be set in other directory scopes using one or both of the
+ following sub-options:
+
+ ``DIRECTORY <dirs>...``
+ The source file property will be set in each of the ``<dirs>``
+ directories' scopes. CMake must already know about each of these
+ source directories, either by having added them through a call to
+ :command:`add_subdirectory` or it being the top level source directory.
+ Relative paths are treated as relative to the current source directory.
+
+ ``TARGET_DIRECTORY <targets>...``
+ The source file property will be set in each of the directory scopes
+ where any of the specified ``<targets>`` were created (the ``<targets>``
+ must therefore already exist).
+
See also the :command:`set_source_files_properties` command.
``INSTALL``
@@ -66,7 +82,8 @@ the property to set. Remaining arguments are used to compose the
property value in the form of a semicolon-separated list.
If the ``APPEND`` option is given the list is appended to any existing
-property value. If the ``APPEND_STRING`` option is given the string is
+property value (except that empty values are ignored and not appended).
+If the ``APPEND_STRING`` option is given the string is
appended to any existing property value as string, i.e. it results in a
longer string and not a list of strings. When using ``APPEND`` or
``APPEND_STRING`` with a property defined to support ``INHERITED``
diff --git a/Help/command/set_source_files_properties.rst b/Help/command/set_source_files_properties.rst
index ab95d7094..9558b4036 100644
--- a/Help/command/set_source_files_properties.rst
+++ b/Help/command/set_source_files_properties.rst
@@ -5,15 +5,33 @@ Source files can have properties that affect how they are built.
.. code-block:: cmake
- set_source_files_properties([file1 [file2 [...]]]
- PROPERTIES prop1 value1
- [prop2 value2 [...]])
+ set_source_files_properties(<files> ...
+ [DIRECTORY <dirs> ...]
+ [TARGET_DIRECTORY <targets> ...]
+ PROPERTIES <prop1> <value1>
+ [<prop2> <value2>] ...)
Sets properties associated with source files using a key/value paired
list.
+By default, source file properties are only visible to targets added in the
+same directory (``CMakeLists.txt``). Visibility can be set in other directory
+scopes using one or both of the following options:
+
+``DIRECTORY <dirs>...``
+ The source file properties will be set in each of the ``<dirs>``
+ directories' scopes. CMake must already know about each of these
+ source directories, either by having added them through a call to
+ :command:`add_subdirectory` or it being the top level source directory.
+ Relative paths are treated as relative to the current source directory.
+
+``TARGET_DIRECTORY <targets>...``
+ The source file properties will be set in each of the directory scopes
+ where any of the specified ``<targets>`` were created (the ``<targets>``
+ must therefore already exist).
+
+Use :command:`get_source_file_property` to get property values.
See also the :command:`set_property(SOURCE)` command.
See :ref:`Source File Properties` for the list of properties known
-to CMake. Source file properties are visible only to targets added
-in the same directory (``CMakeLists.txt``).
+to CMake.
diff --git a/Help/command/source_group.rst b/Help/command/source_group.rst
index 6623c9837..5ae9e5144 100644
--- a/Help/command/source_group.rst
+++ b/Help/command/source_group.rst
@@ -37,11 +37,13 @@ explicitly lists the file with ``FILES`` will be favored, if any.
If no group explicitly lists the file, the *last* group whose
regular expression matches the file will be favored.
-The ``<name>`` of the group and ``<prefix>`` argument may contain backslashes
-to specify subgroups:
+The ``<name>`` of the group and ``<prefix>`` argument may contain forward
+slashes or backslashes to specify subgroups. Backslashes need to be escaped
+appropriately:
.. code-block:: cmake
+ source_group(base/subdir ...)
source_group(outer\\inner ...)
source_group(TREE <root> PREFIX sources\\inc ...)
diff --git a/Help/command/string.rst b/Help/command/string.rst
index 81a206112..cfcf9147f 100644
--- a/Help/command/string.rst
+++ b/Help/command/string.rst
@@ -11,8 +11,6 @@ Synopsis
`Search and Replace`_
string(`FIND`_ <string> <substring> <out-var> [...])
string(`REPLACE`_ <match-string> <replace-string> <out-var> <input>...)
-
- `Regular Expressions`_
string(`REGEX MATCH`_ <match-regex> <out-var> <input>...)
string(`REGEX MATCHALL`_ <match-regex> <out-var> <input>...)
string(`REGEX REPLACE`_ <match-regex> <replace-expr> <out-var> <input>...)
@@ -38,6 +36,7 @@ Synopsis
`Generation`_
string(`ASCII`_ <number>... <out-var>)
+ string(`HEX`_ <string> <out-var>)
string(`CONFIGURE`_ <string> <out-var> [...])
string(`MAKE_C_IDENTIFIER`_ <string> <out-var>)
string(`RANDOM`_ [<option>...] <out-var>)
@@ -47,6 +46,9 @@ Synopsis
Search and Replace
^^^^^^^^^^^^^^^^^^
+Search and Replace With Plain Strings
+"""""""""""""""""""""""""""""""""""""
+
.. _FIND:
.. code-block:: cmake
@@ -74,8 +76,8 @@ so strings containing multi-byte characters may lead to unexpected results.
Replace all occurrences of ``<match_string>`` in the ``<input>``
with ``<replace_string>`` and store the result in the ``<output_variable>``.
-Regular Expressions
-^^^^^^^^^^^^^^^^^^^
+Search and Replace With Regular Expressions
+"""""""""""""""""""""""""""""""""""""""""""
.. _`REGEX MATCH`:
@@ -87,6 +89,7 @@ Regular Expressions
Match the ``<regular_expression>`` once and store the match in the
``<output_variable>``.
All ``<input>`` arguments are concatenated before matching.
+Regular expressions are specified in the subsection just below.
.. _`REGEX MATCHALL`:
@@ -353,6 +356,16 @@ Generation
Convert all numbers into corresponding ASCII characters.
+.. _HEX:
+
+.. code-block:: cmake
+
+ string(HEX <string> <output_variable>)
+
+Convert each byte in the input ``<string>`` to its hexadecimal representation
+and store the concatenated hex digits in the ``<output_variable>``. Letters in
+the output (``a`` through ``f``) are in lowercase.
+
.. _CONFIGURE:
.. code-block:: cmake
diff --git a/Help/command/target_compile_options.rst b/Help/command/target_compile_options.rst
index 47e7d86f8..3c733c5d7 100644
--- a/Help/command/target_compile_options.rst
+++ b/Help/command/target_compile_options.rst
@@ -46,3 +46,5 @@ to use the more specific commands :command:`target_compile_definitions`
and :command:`target_include_directories`.
For directory-wide settings, there is the command :command:`add_compile_options`.
+
+For file-specific settings, there is the source file property :prop_sf:`COMPILE_OPTIONS`.
diff --git a/Help/command/target_link_options.rst b/Help/command/target_link_options.rst
index b5abbc476..89038e328 100644
--- a/Help/command/target_link_options.rst
+++ b/Help/command/target_link_options.rst
@@ -43,6 +43,8 @@ with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.
+.. include:: DEVICE_LINK_OPTIONS.txt
+
.. include:: OPTIONS_SHELL.txt
.. include:: LINK_OPTIONS_LINKER.txt
diff --git a/Help/command/target_precompile_headers.rst b/Help/command/target_precompile_headers.rst
index 0d4f45ab5..d4280b13b 100644
--- a/Help/command/target_precompile_headers.rst
+++ b/Help/command/target_precompile_headers.rst
@@ -93,7 +93,7 @@ Reusing Precompile Headers
^^^^^^^^^^^^^^^^^^^^^^^^^^
The command also supports a second signature which can be used to specify that
-one target re-uses a precompiled header file artefact from another target
+one target re-uses a precompiled header file artifact from another target
instead of generating its own:
.. code-block:: cmake
diff --git a/Help/cpack_gen/archive.rst b/Help/cpack_gen/archive.rst
index d455f4b45..3656aa2d5 100644
--- a/Help/cpack_gen/archive.rst
+++ b/Help/cpack_gen/archive.rst
@@ -1,8 +1,8 @@
CPack Archive Generator
-----------------------
-Archive CPack generator that supports packaging of sources and binaries in
-different formats:
+CPack generator for packaging files into an archive, which can have
+any of the following formats:
- 7Z - 7zip - (.7z)
- TBZ2 (.tar.bz2)
@@ -12,25 +12,64 @@ different formats:
- TZST (.tar.zst)
- ZIP (.zip)
+When this generator is called from ``CPackSourceConfig.cmake`` (or through
+the ``package_source`` target), then the generated archive will contain all
+files in the project directory, except those specified in
+:variable:`CPACK_SOURCE_IGNORE_FILES`. The following is one example of
+packaging all source files of a project:
+
+.. code-block:: cmake
+
+ set(CPACK_SOURCE_GENERATOR "TGZ")
+ set(CPACK_SOURCE_IGNORE_FILES
+ \\.git/
+ build/
+ ".*~$"
+ )
+ set(CPACK_VERBATIM_VARIABLES YES)
+ include(CPack)
+
+When this generator is called from ``CPackConfig.cmake`` (or through the
+``package`` target), then the generated archive will contain all files
+that have been installed via CMake's :command:`install` command (and the
+deprecated commands :command:`install_files`, :command:`install_programs`,
+and :command:`install_targets`).
+
Variables specific to CPack Archive generator
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. variable:: CPACK_ARCHIVE_FILE_NAME
CPACK_ARCHIVE_<component>_FILE_NAME
- Package file name without extension which is added automatically depending
- on the archive format.
-
- * Mandatory : YES
- * Default : ``<CPACK_PACKAGE_FILE_NAME>[-<component>].<extension>`` with
- spaces replaced by '-'
+ Package file name without extension. The extension is determined from the
+ archive format (see list above) and automatically appended to the file name.
+ The default is ``<CPACK_PACKAGE_FILE_NAME>[-<component>]``, with spaces
+ replaced by '-'.
.. variable:: CPACK_ARCHIVE_COMPONENT_INSTALL
- Enable component packaging for CPackArchive
+ Enable component packaging. If enabled (ON), then the archive generator
+ creates multiple packages. The default is OFF, which means that a single
+ package containing files of all components is generated.
+
+Variables used by CPack Archive generator
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+These variables are used by the Archive generator, but are also available to
+CPack generators which are essentially archives at their core. These include:
+
+ - :cpack_gen:`CPack Cygwin Generator`
+ - :cpack_gen:`CPack FreeBSD Generator`
+
+.. variable:: CPACK_ARCHIVE_THREADS
+
+ The number of threads to use when performing the compression. If set to
+ ``0``, the number of available cores on the machine will be used instead.
+ The default is ``1`` which limits compression to a single thread. Note that
+ not all compression modes support threading in all environments. Currently,
+ only the XZ compression may support it.
- * Mandatory : NO
- * Default : OFF
+.. note::
- If enabled (ON) multiple packages are generated. By default a single package
- containing files of all components is generated.
+ Official CMake binaries available on ``cmake.org`` ship with a ``liblzma``
+ that does not support parallel compression.
diff --git a/Help/cpack_gen/cygwin.rst b/Help/cpack_gen/cygwin.rst
index 1c5f7af91..c65653efb 100644
--- a/Help/cpack_gen/cygwin.rst
+++ b/Help/cpack_gen/cygwin.rst
@@ -3,6 +3,11 @@ CPack Cygwin Generator
Cygwin CPack generator (Cygwin).
+Variables affecting the CPack Cygwin generator
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+ - :variable:`CPACK_ARCHIVE_THREADS`
+
Variables specific to CPack Cygwin generator
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/Help/cpack_gen/deb.rst b/Help/cpack_gen/deb.rst
index db71c87e7..bf50c555d 100644
--- a/Help/cpack_gen/deb.rst
+++ b/Help/cpack_gen/deb.rst
@@ -25,8 +25,8 @@ or a component GROUP name.
Here are some CPack DEB generator wiki resources that are here for historic
reasons and are no longer maintained but may still prove useful:
- - https://gitlab.kitware.com/cmake/community/wikis/doc/cpack/Configuration
- - https://gitlab.kitware.com/cmake/community/wikis/doc/cpack/PackageGenerators#deb-unix-only
+ - https://gitlab.kitware.com/cmake/community/-/wikis/doc/cpack/Configuration
+ - https://gitlab.kitware.com/cmake/community/-/wikis/doc/cpack/PackageGenerators#deb-unix-only
List of CPack DEB generator specific variables:
@@ -282,7 +282,7 @@ List of CPack DEB generator specific variables:
You may need set :variable:`CMAKE_INSTALL_RPATH` to an appropriate value
if you use this feature, because if you don't ``dpkg-shlibdeps``
may fail to find your own shared libs.
- See https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling
+ See https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling
.. variable:: CPACK_DEBIAN_PACKAGE_DEBUG
diff --git a/Help/cpack_gen/freebsd.rst b/Help/cpack_gen/freebsd.rst
index a8dd32050..47a77847a 100644
--- a/Help/cpack_gen/freebsd.rst
+++ b/Help/cpack_gen/freebsd.rst
@@ -3,6 +3,11 @@ CPack FreeBSD Generator
The built in (binary) CPack FreeBSD (pkg) generator (Unix only)
+Variables affecting the CPack FreeBSD (pkg) generator
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+ - :variable:`CPACK_ARCHIVE_THREADS`
+
Variables specific to CPack FreeBSD (pkg) generator
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/Help/cpack_gen/ifw.rst b/Help/cpack_gen/ifw.rst
index 4a9ab99b3..776bb4605 100644
--- a/Help/cpack_gen/ifw.rst
+++ b/Help/cpack_gen/ifw.rst
@@ -1,73 +1,28 @@
CPack IFW Generator
-------------------
+Configure and run the Qt Installer Framework to generate a Qt installer.
+
+.. only:: html
+
+ .. contents::
+
Overview
^^^^^^^^
This :manual:`cpack generator <cpack-generators(7)>` generates
configuration and meta information for the `Qt Installer Framework
-<http://doc.qt.io/qtinstallerframework/index.html>`_ (QtIFW).
+<http://doc.qt.io/qtinstallerframework/index.html>`_ (QtIFW),
+and runs QtIFW tools to generate a Qt installer.
QtIFW provides tools and utilities to create installers for
the platforms supported by `Qt <https://www.qt.io>`_: Linux,
Microsoft Windows, and macOS.
-To make use of this generator, QtIFW should also be installed.
-The module :module:`CPackIFW` looks for the location of the
-QtIFW command-line utilities.
-
-Hints
-^^^^^
-
-Generally, the CPack ``IFW`` generator automatically finds QtIFW tools,
-but if you don't use a default path for installation of the QtIFW tools,
-the path may be specified in either a CMake or an environment variable:
-
-.. variable:: CPACK_IFW_ROOT
-
- An CMake variable which specifies the location of the QtIFW tool suite.
-
- The variable will be cached in the ``CPackConfig.cmake`` file and used at
- CPack runtime.
-
-.. variable:: QTIFWDIR
-
- An environment variable which specifies the location of the QtIFW tool
- suite.
-
-.. note::
- The specified path should not contain "bin" at the end
- (for example: "D:\\DevTools\\QtIFW2.0.5").
-
-The :variable:`CPACK_IFW_ROOT` variable has a higher priority and overrides
-the value of the :variable:`QTIFWDIR` variable.
-
-Internationalization
-^^^^^^^^^^^^^^^^^^^^
-
-Some variables and command arguments support internationalization via
-CMake script. This is an optional feature.
-
-Installers created by QtIFW tools have built-in support for
-internationalization and many phrases are localized to many languages,
-but this does not apply to the description of the your components and groups
-that will be distributed.
-
-Localization of the description of your components and groups is useful for
-users of your installers.
-
-A localized variable or argument can contain a single default value, and a
-set of pairs the name of the locale and the localized value.
-
-For example:
-
-.. code-block:: cmake
-
- set(LOCALIZABLE_VARIABLE "Default value"
- en "English value"
- en_US "American value"
- en_GB "Great Britain value"
- )
+To make use of this generator, QtIFW needs to be installed.
+The :module:`CPackIFW` module looks for the location of the
+QtIFW command-line utilities, and defines several commands to
+control the behavior of this generator.
Variables
^^^^^^^^^
@@ -157,6 +112,8 @@ Package
Default target directory for installation.
By default used
"@ApplicationsDir@/:variable:`CPACK_PACKAGE_INSTALL_DIRECTORY`"
+ (variables embedded in '@' are expanded by the
+ `QtIFW scripting engine <https://doc.qt.io/qtinstallerframework/scripting.html>`_).
You can use predefined variables.
@@ -263,55 +220,111 @@ Components
repack dependent components. This feature available only
since QtIFW 3.1.
-Tools
-"""""
+QtIFW Tools
+"""""""""""
.. variable:: CPACK_IFW_FRAMEWORK_VERSION
The version of used QtIFW tools.
-.. variable:: CPACK_IFW_BINARYCREATOR_EXECUTABLE
+The following variables provide the locations of the QtIFW
+command-line tools as discovered by the module :module:`CPackIFW`.
+These variables are cached, and may be configured if needed.
- The path to "binarycreator" command line client.
+.. variable:: CPACK_IFW_BINARYCREATOR_EXECUTABLE
- This variable is cached and may be configured if needed.
+ The path to ``binarycreator``.
.. variable:: CPACK_IFW_REPOGEN_EXECUTABLE
- The path to "repogen" command line client.
-
- This variable is cached and may be configured if needed.
+ The path to ``repogen``.
.. variable:: CPACK_IFW_INSTALLERBASE_EXECUTABLE
- The path to "installerbase" installer executable base.
-
- This variable is cached and may be configured if needed.
+ The path to ``installerbase``.
.. variable:: CPACK_IFW_DEVTOOL_EXECUTABLE
- The path to "devtool" command line client.
+ The path to ``devtool``.
+
+Hints for Finding QtIFW
+"""""""""""""""""""""""
+
+Generally, the CPack ``IFW`` generator automatically finds QtIFW tools,
+but if you don't use a default path for installation of the QtIFW tools,
+the path may be specified in either a CMake or an environment variable:
+
+.. variable:: CPACK_IFW_ROOT
- This variable is cached and may be configured if needed.
+ An CMake variable which specifies the location of the QtIFW tool suite.
+
+ The variable will be cached in the ``CPackConfig.cmake`` file and used at
+ CPack runtime.
+
+.. variable:: QTIFWDIR
+
+ An environment variable which specifies the location of the QtIFW tool
+ suite.
+
+.. note::
+ The specified path should not contain "bin" at the end
+ (for example: "D:\\DevTools\\QtIFW2.0.5").
+
+The :variable:`CPACK_IFW_ROOT` variable has a higher priority and overrides
+the value of the :variable:`QTIFWDIR` variable.
+Other Settings
+^^^^^^^^^^^^^^
Online installer
-^^^^^^^^^^^^^^^^
+""""""""""""""""
-By default CPack IFW generator makes offline installer. This means that all
-components will be packaged into a binary file.
+By default, this generator generates an *offline installer*. This means that
+that all packaged files are fully contained in the installer executable.
-To make a component downloaded, you must set the ``DOWNLOADED`` option in
-:command:`cpack_add_component`.
+In contrast, an *online installer* will download some or all components from
+a remote server.
-Then you would use the command :command:`cpack_configure_downloads`.
-If you set ``ALL`` option all components will be downloaded.
+The ``DOWNLOADED`` option in the :command:`cpack_add_component` command
+specifies that a component is to be downloaded. Alternatively, the ``ALL``
+option in the :command:`cpack_configure_downloads` command specifies that
+`all` components are to be be downloaded.
-You also can use command :command:`cpack_ifw_add_repository` and
-variable :variable:`CPACK_IFW_DOWNLOAD_ALL` for more specific configuration.
+The :command:`cpack_ifw_add_repository` command and the
+:variable:`CPACK_IFW_DOWNLOAD_ALL` variable allow for more specific
+configuration.
-CPack IFW generator creates "repository" dir in current binary dir. You
-would copy content of this dir to specified ``site`` (``url``).
+When there are online components, CPack will write them to archive files.
+The help page of the :module:`CPackComponent` module, especially the section
+on the :command:`cpack_configure_downloads` function, explains how to make
+these files accessible from a download URL.
+
+Internationalization
+""""""""""""""""""""
+
+Some variables and command arguments support internationalization via
+CMake script. This is an optional feature.
+
+Installers created by QtIFW tools have built-in support for
+internationalization and many phrases are localized to many languages,
+but this does not apply to the description of the your components and groups
+that will be distributed.
+
+Localization of the description of your components and groups is useful for
+users of your installers.
+
+A localized variable or argument can contain a single default value, and a
+set of pairs the name of the locale and the localized value.
+
+For example:
+
+.. code-block:: cmake
+
+ set(LOCALIZABLE_VARIABLE "Default value"
+ en "English value"
+ en_US "American value"
+ en_GB "Great Britain value"
+ )
See Also
^^^^^^^^
@@ -330,5 +343,5 @@ Qt Installer Framework Manual:
* Promoting Updates:
http://doc.qt.io/qtinstallerframework/ifw-updates.html
-Download Qt Installer Framework for you platform from Qt site:
+Download Qt Installer Framework for your platform from Qt site:
http://download.qt.io/official_releases/qt-installer-framework
diff --git a/Help/cpack_gen/nsis.rst b/Help/cpack_gen/nsis.rst
index d1e495f99..0dd876eec 100644
--- a/Help/cpack_gen/nsis.rst
+++ b/Help/cpack_gen/nsis.rst
@@ -155,3 +155,7 @@ on Windows Nullsoft Scriptable Install System.
.. variable:: CPACK_NSIS_MUI_HEADERIMAGE
The image to display on the header of installers pages.
+
+.. variable:: CPACK_NSIS_MANIFEST_DPI_AWARE
+
+ If set, declares that the installer is DPI-aware.
diff --git a/Help/cpack_gen/rpm.rst b/Help/cpack_gen/rpm.rst
index 2693c7b62..ccb7ebd7b 100644
--- a/Help/cpack_gen/rpm.rst
+++ b/Help/cpack_gen/rpm.rst
@@ -36,8 +36,8 @@ http://www.rpm.org/wiki/Docs
Here are some CPack RPM generator wiki resources that are here for historic
reasons and are no longer maintained but may still prove useful:
- - https://gitlab.kitware.com/cmake/community/wikis/doc/cpack/Configuration
- - https://gitlab.kitware.com/cmake/community/wikis/doc/cpack/PackageGenerators#rpm-unix-only
+ - https://gitlab.kitware.com/cmake/community/-/wikis/doc/cpack/Configuration
+ - https://gitlab.kitware.com/cmake/community/-/wikis/doc/cpack/PackageGenerators#rpm-unix-only
List of CPack RPM generator specific variables:
@@ -473,38 +473,42 @@ List of CPack RPM generator specific variables:
.. variable:: CPACK_RPM_PRE_INSTALL_SCRIPT_FILE
CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE
+ CPACK_RPM_PRE_TRANS_SCRIPT_FILE
- Path to file containing pre (un)install script.
+ Path to file containing pre install/uninstall/transaction script.
* Mandatory : NO
* Default : -
- May be used to embed a pre (un)installation script in the spec file.
+ May be used to embed a pre installation/uninstallation/transaction script in the spec file.
The referred script file (or both) will be read and directly
put after the ``%pre`` or ``%preun`` section
- If :variable:`CPACK_RPM_COMPONENT_INSTALL` is set to ON the (un)install
+ If :variable:`CPACK_RPM_COMPONENT_INSTALL` is set to ON the install/uninstall/transaction
script for each component can be overridden with
- ``CPACK_RPM_<COMPONENT>_PRE_INSTALL_SCRIPT_FILE`` and
- ``CPACK_RPM_<COMPONENT>_PRE_UNINSTALL_SCRIPT_FILE``.
+ ``CPACK_RPM_<COMPONENT>_PRE_INSTALL_SCRIPT_FILE``,
+ ``CPACK_RPM_<COMPONENT>_PRE_UNINSTALL_SCRIPT_FILE``, and
+ ``CPACK_RPM_<COMPONENT>_PRE_TRANS_SCRIPT_FILE``
One may verify which scriptlet has been included with::
rpm -qp --scripts package.rpm
.. variable:: CPACK_RPM_POST_INSTALL_SCRIPT_FILE
CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE
+ CPACK_RPM_POST_TRANS_SCRIPT_FILE
- Path to file containing post (un)install script.
+ Path to file containing post install/uninstall/transaction script.
* Mandatory : NO
* Default : -
- May be used to embed a post (un)installation script in the spec file.
+ May be used to embed a post installation/uninstallation/transaction script in the spec file.
The referred script file (or both) will be read and directly
put after the ``%post`` or ``%postun`` section.
- If :variable:`CPACK_RPM_COMPONENT_INSTALL` is set to ON the (un)install
+ If :variable:`CPACK_RPM_COMPONENT_INSTALL` is set to ON the install/uninstall/transaction
script for each component can be overridden with
- ``CPACK_RPM_<COMPONENT>_POST_INSTALL_SCRIPT_FILE`` and
- ``CPACK_RPM_<COMPONENT>_POST_UNINSTALL_SCRIPT_FILE``.
+ ``CPACK_RPM_<COMPONENT>_POST_INSTALL_SCRIPT_FILE``,
+ ``CPACK_RPM_<COMPONENT>_POST_UNINSTALL_SCRIPT_FILE``, and
+ ``CPACK_RPM_<COMPONENT>_POST_TRANS_SCRIPT_FILE``
One may verify which scriptlet has been included with::
rpm -qp --scripts package.rpm
diff --git a/Help/dev/review.rst b/Help/dev/review.rst
index 8ec41d29c..6c7e92cf8 100644
--- a/Help/dev/review.rst
+++ b/Help/dev/review.rst
@@ -28,7 +28,7 @@ request is accepted" option when creating the MR or by editing it.
This will cause the MR topic branch to be automatically removed from
the user's fork during the `Merge`_ step.
-.. _`CMake Merge Requests Page`: https://gitlab.kitware.com/cmake/cmake/merge_requests
+.. _`CMake Merge Requests Page`: https://gitlab.kitware.com/cmake/cmake/-/merge_requests
.. _`CMake Repository`: https://gitlab.kitware.com/cmake/cmake
Workflow Status
@@ -60,7 +60,7 @@ in GitLab to track the state of a MR:
The workflow status labels are intended to be mutually exclusive,
so please remove any existing workflow label when adding one.
-.. _`CMake GitLab Project Developers`: https://gitlab.kitware.com/cmake/cmake/settings/members
+.. _`CMake GitLab Project Developers`: https://gitlab.kitware.com/cmake/cmake/-/settings/members
Robot Review
============
@@ -278,42 +278,52 @@ merging.
Topic Testing
=============
-CMake has a `buildbot`_ instance watching for merge requests to test.
-`CMake GitLab Project Developers`_ may activate buildbot on a MR by
-adding a comment with a command among the `comment trailing lines`_::
+CMake uses `GitLab CI`_ to test merge requests, configured by the top-level
+``.gitlab-ci.yml`` file. Results may be seen both on the merge request's
+pipeline page and on the `CMake CDash Page`_. Filtered CDash results
+showing just the pipeline's jobs can be reached by selecting the ``cdash``
+job in the ``External`` stage of the pipeline.
- Do: test
+Lint and documentation build jobs run automatically after every push.
+Heavier jobs require a manual trigger to run:
-``@kwrobot`` will add an award emoji to the comment to indicate that it
-was processed and also inform buildbot about the request. The buildbot
-user (``@buildbot``) will schedule builds and respond with a comment
-linking to the `CMake CDash Page`_ with a filter for results associated
-with the topic test request. If the MR topic branch is updated by a
-push a new ``Do: test`` command is needed to activate testing again.
-
-The ``Do: test`` command accepts the following arguments:
-
-* ``--stop``: clear the list of commands for the merge request
-* ``--clear``: clear previous commands before adding this command
-* ``--regex-include <arg>`` or ``-i <arg>``: only build on builders
- matching ``<arg>`` (a Python regular expression)
-* ``--regex-exclude <arg>`` or ``-e <arg>``: exclude builds on builders
- matching ``<arg>`` (a Python regular expression)
-
-Builder names follow the pattern ``project-host-os-buildtype-generator``:
-
-* ``project``: always ``cmake`` for CMake builds
-* ``host``: the buildbot host
-* ``os``: one of ``windows``, ``osx``, or ``linux``
-* ``buildtype``: ``release`` or ``debug``
-* ``generator``: ``ninja``, ``makefiles``, ``vs<year>``,
- or ``lint-iwyu-tidy``
-
-The special ``lint-<tools>`` generator name is a builder that builds
-CMake using lint tools but does not run the test suite (so the actual
-generator does not matter).
-
-.. _`buildbot`: http://buildbot.net
+* Merge request authors may visit their merge request's pipeline and click the
+ "Play" button on one or more jobs manually. If the merge request has the
+ "Allow commits from members who can merge to the target branch" check box
+ enabled, CMake maintainers may use the "Play" button too.
+
+* `CMake GitLab Project Developers`_ may trigger CI on a merge request by
+ adding a comment with a command among the `comment trailing lines`_::
+
+ Do: test
+
+ ``@kwrobot`` will add an award emoji to the comment to indicate that it
+ was processed and also trigger all manual jobs in the merge request's
+ pipeline.
+
+ The ``Do: test`` command accepts the following arguments:
+
+ * ``--named <regex>``, ``-n <regex>``: Trigger jobs matching ``<regex>``
+ anywhere in their name. Job names may be seen on the merge request's
+ pipeline page.
+ * ``--stage <stage>``, ``-s <stage>``: Only affect jobs in a given stage.
+ Stage names may be seen on the merge request's pipeline page. Note that
+ the names are determined by what is in the ``.gitlab-ci.yml`` file and may
+ be capitalized in the web page, so lowercasing the webpage's display name
+ for stages may be required.
+ * ``--action <action>``, ``-a <action>``: The action to perform on the jobs.
+ Possible actions:
+
+ * ``manual`` (the default): Start jobs awaiting manual interaction.
+ * ``unsuccessful``: Start or restart jobs which have not completed
+ successfully.
+ * ``failed``: Restart jobs which have completed, but without success.
+ * ``completed``: Restart all completed jobs.
+
+If the merge request topic branch is updated by a push, a new manual trigger
+using one of the above methods is needed to start CI again.
+
+.. _`GitLab CI`: https://gitlab.kitware.com/help/ci/README.md
.. _`CMake CDash Page`: https://open.cdash.org/index.php?project=CMake
Integration Testing
@@ -454,8 +464,8 @@ comment instead):
The ``-t`` option to a ``Do: merge`` command overrides any topic
rename set in the MR description.
-.. _`CMake GitLab Project Masters`: https://gitlab.kitware.com/cmake/cmake/settings/members
-.. _`backport instructions`: https://gitlab.kitware.com/utils/git-workflow/wikis/Backport-topics
+.. _`CMake GitLab Project Masters`: https://gitlab.kitware.com/cmake/cmake/-/settings/members
+.. _`backport instructions`: https://gitlab.kitware.com/utils/git-workflow/-/wikis/Backport-topics
.. _`git rev-parse`: https://git-scm.com/docs/git-rev-parse
Close
diff --git a/Help/dev/source.rst b/Help/dev/source.rst
index 0f7488be0..0ccb8f42d 100644
--- a/Help/dev/source.rst
+++ b/Help/dev/source.rst
@@ -23,12 +23,157 @@ format only a subset of files, such as those that are locally modified.
C++ Subset Permitted
====================
-CMake requires compiling as C++11 or above. However, in order to support
-building on older toolchains some constructs need to be handled with care:
+CMake requires compiling as C++11 in order to support building on older
+toolchains. However, to facilitate development, some standard library
+features from more recent C++ standards are supported through a compatibility
+layer. These features are defined under the namespace ``cm`` and headers
+are accessible under the ``cm/`` directory. The headers under ``cm/`` can
+be used in place of the standard ones when extended features are needed.
+For example ``<cm/memory>`` can be used in place of ``<memory>``.
-* Do not use ``std::auto_ptr``.
+Available features are:
- The ``std::auto_ptr`` template is deprecated in C++11. Use ``std::unique_ptr``.
+* From ``C++14``:
+
+ * ``<cm/iterator>``:
+ ``cm::make_reverse_iterator``, ``cm::cbegin``, ``cm::cend``,
+ ``cm::rbegin``, ``cm::rend``, ``cm::crbegin``, ``cm::crend``
+
+ * ``<cm/memory>``:
+ ``cm::make_unique``
+
+ * ``<cm/shared_mutex>``:
+ ``cm::shared_lock``
+
+ * ``<cm/type_traits>``:
+ ``cm::enable_if_t``
+
+* From ``C++17``:
+
+ * ``<cm/algorithm>``:
+ ``cm::clamp``
+
+ * ``<cm/iterator>``:
+ ``cm::size``, ``cm::empty``, ``cm::data``
+
+ * ``<cm/optional>``:
+ ``cm::nullopt_t``, ``cm::nullopt``, ``cm::optional``,
+ ``cm::make_optional``, ``cm::bad_optional_access``
+
+ * ``<cm/shared_mutex>``:
+ ``cm::shared_mutex``
+
+ * ``<cm/string_view>``:
+ ``cm::string_view``
+
+ * ``<cm/type_traits>``:
+ ``cm::bool_constant``, ``cm::invoke_result_t``, ``cm::invoke_result``,
+ ``cm::void_t``
+
+ * ``<cm/utility>``:
+ ``cm::in_place_t``, ``cm::in_place``
+
+* From ``C++20``:
+
+ * ``<cm/deque>``:
+ ``cm::erase``, ``cm::erase_if``
+
+ * ``<cm/list>``:
+ ``cm::erase``, ``cm::erase_if``
+
+ * ``<cm/map>`` :
+ ``cm::erase_if``
+
+ * ``<cm/set>`` :
+ ``cm::erase_if``
+
+ * ``<cm/string>``:
+ ``cm::erase``, ``cm::erase_if``
+
+ * ``<cm/unordered_map>``:
+ ``cm::erase_if``
+
+ * ``<cm/unordered_set>``:
+ ``cm::erase_if``
+
+ * ``<cm/vector>``:
+ ``cm::erase``, ``cm::erase_if``
+
+Additionally, some useful non-standard extensions to the C++ standard library
+are available in headers under the directory ``cmext/`` in namespace ``cm``.
+These are:
+
+* ``<cmext/algorithm>``:
+
+ * ``cm::append``:
+ Append elements to a sequential container.
+
+ * ``cm::contains``:
+ Checks if element or key is contained in container.
+
+* ``<cmext/iterator>``:
+
+ * ``cm::is_terator``:
+ Checks if a type is an iterator type.
+
+ * ``cm::is_input_iterator``:
+ Checks if a type is an input iterator type.
+
+ * ``cm::is_range``:
+ Checks if a type is a range type: functions ``std::begin()`` and
+ ``std::end()`` apply.
+
+ * ``cm::is_input_range``:
+ Checks if a type is an input range type: functions ``std::begin()`` and
+ ``std::end()`` apply and return an input iterator.
+
+* ``<cmext/memory>``:
+
+ * ``cm::static_reference_cast``:
+ Apply a ``static_cast`` to a smart pointer.
+
+ * ``cm::dynamic_reference_cast``:
+ Apply a ``dynamic_cast`` to a smart pointer.
+
+* ``<cmext/type_traits>``:
+
+ * ``cm::is_container``:
+ Checks if a type is a container type.
+
+ * ``cm::is_associative_container``:
+ Checks if a type is an associative container type.
+
+ * ``cm::is_unordered_associative_container``:
+ Checks if a type is an unordered associative container type.
+
+ * ``cm::is_sequence_container``:
+ Checks if a type is a sequence container type.
+
+ * ``cm::is_unique_ptr``:
+ Checks if a type is a ``std::unique_ptr`` type.
+
+Dynamic Memory Management
+=========================
+
+To ensure efficient memory management, i.e. no memory leaks, it is required
+to use smart pointers. Any dynamic memory allocation must be handled by a
+smart pointer such as ``std::unique_ptr`` or ``std::shared_ptr``.
+
+It is allowed to pass raw pointers between objects to enable objects sharing.
+A raw pointer **must** not be deleted. Only the object(s) owning the smart
+pointer are allowed to delete dynamically allocated memory.
+
+Third Parties
+=============
+
+To build CMake, some third parties are needed. Under ``Utilities``
+directory, are versions of these third parties which can be used as an
+alternate to the ones provided by the system.
+
+To enable the selection of the third parties between the system and CMake ones,
+in CMake sources, third parties headers must be prefixed by ``cm3p/``
+(for example: ``<cm3p/json/reader.h>``). These wrappers are located under
+``Utilities/cm3p`` directory.
Source Tree Layout
==================
@@ -69,6 +214,15 @@ The CMake source tree is organized as follows.
* ``Utilities/``:
Scripts, third-party source code.
+ * ``Utilities/std/cm``:
+ Support files for various C++ standards.
+
+ * ``Utilities/std/cmext``:
+ Extensions to the C++ STL.
+
+ * ``Utilities/cm3p``:
+ Public headers for third parties needed to build CMake.
+
* ``Utilities/Sphinx/``:
Sphinx configuration to build CMake user documentation.
diff --git a/Help/dev/testing.rst b/Help/dev/testing.rst
index 23d0ca3f2..279e4b29f 100644
--- a/Help/dev/testing.rst
+++ b/Help/dev/testing.rst
@@ -33,7 +33,7 @@ CTest script with local settings and include ``cmake_common.cmake``.
.. _`CMake Review Process`: review.rst
.. _`CMake CDash Page`: https://open.cdash.org/index.php?project=CMake
.. _`CMake Dashboard Scripts Repository`: https://gitlab.kitware.com/cmake/dashboard-scripts
-.. _`cmake_common.cmake`: https://gitlab.kitware.com/cmake/dashboard-scripts/blob/master/cmake_common.cmake
+.. _`cmake_common.cmake`: https://gitlab.kitware.com/cmake/dashboard-scripts/-/blob/master/cmake_common.cmake
Nightly Start Time
------------------
diff --git a/Help/envvar/ASM_DIALECTFLAGS.rst b/Help/envvar/ASM_DIALECTFLAGS.rst
index 3c3b02a76..2e1c6d294 100644
--- a/Help/envvar/ASM_DIALECTFLAGS.rst
+++ b/Help/envvar/ASM_DIALECTFLAGS.rst
@@ -11,3 +11,5 @@ flags, after which the value for ``ASM<DIALECT>FLAGS`` is stored in the cache
as ``CMAKE_ASM<DIALECT>_FLAGS <CMAKE_<LANG>_FLAGS>``. For any configuration
run (including the first), the environment variable will be ignored, if the
``CMAKE_ASM<DIALECT>_FLAGS <CMAKE_<LANG>_FLAGS>`` variable is defined.
+
+See also :variable:`CMAKE_ASM<DIALECT>_FLAGS_INIT <CMAKE_<LANG>_FLAGS_INIT>`.
diff --git a/Help/envvar/CCMAKE_COLORS.rst b/Help/envvar/CCMAKE_COLORS.rst
new file mode 100644
index 000000000..d4750c368
--- /dev/null
+++ b/Help/envvar/CCMAKE_COLORS.rst
@@ -0,0 +1,34 @@
+CCMAKE_COLORS
+-------------
+
+Determines what colors are used by the CMake curses interface,
+when run on a terminal that supports colors.
+The syntax follows the same conventions as ``LS_COLORS``;
+that is, a list of key/value pairs separated by ``:``.
+
+Keys are a single letter corresponding to a CMake cache variable type:
+
+- ``s``: A ``STRING``.
+- ``p``: A ``FILEPATH``.
+- ``c``: A value which has an associated list of choices.
+- ``y``: A ``BOOL`` which has a true-like value (e.g. ``ON``, ``YES``).
+- ``n``: A ``BOOL`` which has a false-like value (e.g. ``OFF``, ``NO``).
+
+Values are an integer number that specifies what color to use.
+``0`` is black (you probably don't want to use that).
+Others are determined by your terminal's color support.
+Most (color) terminals will support at least 8 or 16 colors.
+Some will support up to 256 colors. The colors will likely match
+`this chart <https://upload.wikimedia.org/wikipedia/commons/1/15/Xterm_256color_chart.svg>`_,
+although the first 16 colors may match the original
+`CGA color palette <https://en.wikipedia.org/wiki/Color_Graphics_Adapter#Color_palette>`_.
+(Many modern terminal emulators also allow their color palette,
+at least for the first 16 colors, to be configured by the user.)
+
+Note that fairly minimal checking is done for bad colors
+(although a value higher than what curses believes your terminal supports
+will be silently ignored) or bad syntax.
+
+For example::
+
+ CCMAKE_COLORS='s=39:p=220:c=207:n=196:y=46'
diff --git a/Help/envvar/CFLAGS.rst b/Help/envvar/CFLAGS.rst
index fda9ccc48..190b4f47c 100644
--- a/Help/envvar/CFLAGS.rst
+++ b/Help/envvar/CFLAGS.rst
@@ -9,3 +9,5 @@ flags, after which the value for ``CFLAGS`` is stored in the cache
as :variable:`CMAKE_C_FLAGS <CMAKE_<LANG>_FLAGS>`. For any configuration run
(including the first), the environment variable will be ignored if the
:variable:`CMAKE_C_FLAGS <CMAKE_<LANG>_FLAGS>` variable is defined.
+
+See also :variable:`CMAKE_C_FLAGS_INIT <CMAKE_<LANG>_FLAGS_INIT>`.
diff --git a/Help/envvar/CMAKE_PREFIX_PATH.rst b/Help/envvar/CMAKE_PREFIX_PATH.rst
new file mode 100644
index 000000000..276fdd6b9
--- /dev/null
+++ b/Help/envvar/CMAKE_PREFIX_PATH.rst
@@ -0,0 +1,17 @@
+CMAKE_PREFIX_PATH
+-----------------
+
+.. include:: ENV_VAR.txt
+
+The ``CMAKE_PREFIX_PATH`` environment variable may be set to a list of
+directories specifying installation *prefixes* to be searched by the
+:command:`find_package`, :command:`find_program`, :command:`find_library`,
+:command:`find_file`, and :command:`find_path` commands. Each command will
+add appropriate subdirectories (like ``bin``, ``lib``, or ``include``)
+as specified in its own documentation.
+
+This variable may hold a single prefix or a list of prefixes separated
+by ``:`` on UNIX or ``;`` on Windows (the same as the ``PATH`` environment
+variable convention on those platforms).
+
+See also the :variable:`CMAKE_PREFIX_PATH` CMake variable.
diff --git a/Help/envvar/CSFLAGS.rst b/Help/envvar/CSFLAGS.rst
index 404bb5930..87629827d 100644
--- a/Help/envvar/CSFLAGS.rst
+++ b/Help/envvar/CSFLAGS.rst
@@ -9,3 +9,5 @@ compilation flags, after which the value for ``CSFLAGS`` is stored in the cache
as :variable:`CMAKE_CSharp_FLAGS <CMAKE_<LANG>_FLAGS>`. For any configuration
run (including the first), the environment variable will be ignored if the
:variable:`CMAKE_CSharp_FLAGS <CMAKE_<LANG>_FLAGS>` variable is defined.
+
+See also :variable:`CMAKE_CSharp_FLAGS_INIT <CMAKE_<LANG>_FLAGS_INIT>`.
diff --git a/Help/envvar/CUDAFLAGS.rst b/Help/envvar/CUDAFLAGS.rst
index 4456d6bf8..14c5d84bd 100644
--- a/Help/envvar/CUDAFLAGS.rst
+++ b/Help/envvar/CUDAFLAGS.rst
@@ -9,3 +9,5 @@ compilation flags, after which the value for ``CUDAFLAGS`` is stored in the
cache as :variable:`CMAKE_CUDA_FLAGS <CMAKE_<LANG>_FLAGS>`. For any configuration
run (including the first), the environment variable will be ignored if
the :variable:`CMAKE_CUDA_FLAGS <CMAKE_<LANG>_FLAGS>` variable is defined.
+
+See also :variable:`CMAKE_CUDA_FLAGS_INIT <CMAKE_<LANG>_FLAGS_INIT>`.
diff --git a/Help/envvar/CXXFLAGS.rst b/Help/envvar/CXXFLAGS.rst
index d7296dca0..460a347c5 100644
--- a/Help/envvar/CXXFLAGS.rst
+++ b/Help/envvar/CXXFLAGS.rst
@@ -9,3 +9,5 @@ compilation flags, after which the value for ``CXXFLAGS`` is stored in the cache
as :variable:`CMAKE_CXX_FLAGS <CMAKE_<LANG>_FLAGS>`. For any configuration run (
including the first), the environment variable will be ignored if
the :variable:`CMAKE_CXX_FLAGS <CMAKE_<LANG>_FLAGS>` variable is defined.
+
+See also :variable:`CMAKE_CXX_FLAGS_INIT <CMAKE_<LANG>_FLAGS_INIT>`.
diff --git a/Help/envvar/FFLAGS.rst b/Help/envvar/FFLAGS.rst
index 02d3c3461..53bffb67f 100644
--- a/Help/envvar/FFLAGS.rst
+++ b/Help/envvar/FFLAGS.rst
@@ -9,3 +9,5 @@ compilation flags, after which the value for ``FFLAGS`` is stored in the cache
as :variable:`CMAKE_Fortran_FLAGS <CMAKE_<LANG>_FLAGS>`. For any configuration
run (including the first), the environment variable will be ignored if
the :variable:`CMAKE_Fortran_FLAGS <CMAKE_<LANG>_FLAGS>` variable is defined.
+
+See also :variable:`CMAKE_Fortran_FLAGS_INIT <CMAKE_<LANG>_FLAGS_INIT>`.
diff --git a/Help/envvar/RCFLAGS.rst b/Help/envvar/RCFLAGS.rst
index 45419fed1..bc43cb212 100644
--- a/Help/envvar/RCFLAGS.rst
+++ b/Help/envvar/RCFLAGS.rst
@@ -9,3 +9,5 @@ default compilation flags, after which the value for ``RCFLAGS`` is stored in
the cache as :variable:`CMAKE_RC_FLAGS <CMAKE_<LANG>_FLAGS>`. For any
configuration run (including the first), the environment variable will be ignored
if the :variable:`CMAKE_RC_FLAGS <CMAKE_<LANG>_FLAGS>` variable is defined.
+
+See also :variable:`CMAKE_RC_FLAGS_INIT <CMAKE_<LANG>_FLAGS_INIT>`.
diff --git a/Help/guide/tutorial/Step5/MathFunctions/MakeTable.cxx b/Help/guide/tutorial/Step5/MathFunctions/MakeTable.cxx
deleted file mode 100644
index ee585568c..000000000
--- a/Help/guide/tutorial/Step5/MathFunctions/MakeTable.cxx
+++ /dev/null
@@ -1,25 +0,0 @@
-// A simple program that builds a sqrt table
-#include <cmath>
-#include <fstream>
-#include <iostream>
-
-int main(int argc, char* argv[])
-{
- // make sure we have enough arguments
- if (argc < 2) {
- return 1;
- }
-
- std::ofstream fout(argv[1], std::ios_base::out);
- const bool fileOpen = fout.is_open();
- if (fileOpen) {
- fout << "double sqrtTable[] = {" << std::endl;
- for (int i = 0; i < 10; ++i) {
- fout << sqrt(static_cast<double>(i)) << "," << std::endl;
- }
- // close the table with a zero
- fout << "0};" << std::endl;
- fout.close();
- }
- return fileOpen ? 0 : 1; // return 0 if wrote the file
-}
diff --git a/Help/guide/tutorial/Step6/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step6/MathFunctions/CMakeLists.txt
index 4bf6024c2..f64c6ac54 100644
--- a/Help/guide/tutorial/Step6/MathFunctions/CMakeLists.txt
+++ b/Help/guide/tutorial/Step6/MathFunctions/CMakeLists.txt
@@ -8,10 +8,20 @@ target_include_directories(MathFunctions
# does this system provide the log and exp functions?
include(CheckSymbolExists)
-set(CMAKE_REQUIRED_LIBRARIES "m")
check_symbol_exists(log "math.h" HAVE_LOG)
check_symbol_exists(exp "math.h" HAVE_EXP)
+if(NOT (HAVE_LOG AND HAVE_EXP))
+ unset(HAVE_LOG CACHE)
+ unset(HAVE_EXP CACHE)
+ set(CMAKE_REQUIRED_LIBRARIES "m")
+ check_symbol_exists(log "math.h" HAVE_LOG)
+ check_symbol_exists(exp "math.h" HAVE_EXP)
+ if(HAVE_LOG AND HAVE_EXP)
+ target_link_libraries(MathFunctions PRIVATE m)
+ endif()
+endif()
+# add compile definitions
if(HAVE_LOG AND HAVE_EXP)
target_compile_definitions(MathFunctions
PRIVATE "HAVE_LOG" "HAVE_EXP")
diff --git a/Help/guide/tutorial/index.rst b/Help/guide/tutorial/index.rst
index a844cbf84..6e26de977 100644
--- a/Help/guide/tutorial/index.rst
+++ b/Help/guide/tutorial/index.rst
@@ -380,13 +380,17 @@ tutorial assume that they are not common.
If the platform has ``log`` and ``exp`` then we will use them to compute the
square root in the ``mysqrt`` function. We first test for the availability of
these functions using the :module:`CheckSymbolExists` module in the top-level
-``CMakeLists.txt``. We're going to use the new defines in
-``TutorialConfig.h.in``, so be sure to set them before that file is configured.
+``CMakeLists.txt``. On some platforms, we will need to link to the m library.
+If ``log`` and ``exp`` are not initially found, require the m library and try
+again.
+
+We're going to use the new defines in ``TutorialConfig.h.in``, so be sure to
+set them before that file is configured.
.. literalinclude:: Step6/MathFunctions/CMakeLists.txt
:language: cmake
:start-after: # does this system provide the log and exp functions?
- :end-before: if(HAVE_LOG AND HAVE_EXP)
+ :end-before: # add compile definitions
Now let's add these defines to ``TutorialConfig.h.in`` so that we can use them
from ``mysqrt.cxx``:
diff --git a/Help/guide/user-interaction/index.rst b/Help/guide/user-interaction/index.rst
index 3a1038fa7..c724b6fc0 100644
--- a/Help/guide/user-interaction/index.rst
+++ b/Help/guide/user-interaction/index.rst
@@ -86,6 +86,7 @@ populated. It is always advised to use different
directories for the source and the build.
.. image:: /guide/user-interaction/GUI-Source-Binary.png
+ :alt: Choosing source and binary directories
Generating a Buildsystem
========================
@@ -246,16 +247,19 @@ The "Configure" button triggers a new dialog to
select the CMake generator to use.
.. image:: /guide/user-interaction/GUI-Configure-Dialog.png
+ :alt: Configuring a generator
All generators available on the command line are also
available in :manual:`cmake-gui(1)`.
.. image:: /guide/user-interaction/GUI-Choose-Generator.png
+ :alt: Choosing a generator
When choosing a Visual Studio generator, further options
are available to set an architecture to generate for.
.. image:: /manual/VS-Choose-Arch.png
+ :alt: Choosing an architecture for Visual Studio generators
.. _`Setting Build Variables`:
@@ -356,6 +360,7 @@ button. This triggers a new dialog to set the value of
the variable.
.. image:: /guide/user-interaction/GUI-Add-Entry.png
+ :alt: Editing a cache entry
The main view of the :manual:`cmake-gui(1)` user interface
can be used to edit existing variables.
diff --git a/Help/manual/cmake-commands.7.rst b/Help/manual/cmake-commands.7.rst
index 59ba89727..0aa4f7517 100644
--- a/Help/manual/cmake-commands.7.rst
+++ b/Help/manual/cmake-commands.7.rst
@@ -17,6 +17,7 @@ These commands are always available.
/command/break
/command/cmake_host_system_information
+ /command/cmake_language
/command/cmake_minimum_required
/command/cmake_parse_arguments
/command/cmake_policy
diff --git a/Help/manual/cmake-env-variables.7.rst b/Help/manual/cmake-env-variables.7.rst
index f72e414b4..ce1e36012 100644
--- a/Help/manual/cmake-env-variables.7.rst
+++ b/Help/manual/cmake-env-variables.7.rst
@@ -14,6 +14,13 @@ For general information on environment variables, see the
:ref:`Environment Variables <CMake Language Environment Variables>`
section in the cmake-language manual.
+Environment Variables that Change Behavior
+==========================================
+
+.. toctree::
+ :maxdepth: 1
+
+ /envvar/CMAKE_PREFIX_PATH
Environment Variables that Control the Build
============================================
@@ -75,3 +82,11 @@ Environment Variables for CTest
/envvar/CTEST_PROGRESS_OUTPUT
/envvar/CTEST_USE_LAUNCHERS_DEFAULT
/envvar/DASHBOARD_TEST_FROM_CTEST
+
+Environment Variables for the CMake curses interface
+====================================================
+
+.. toctree::
+ :maxdepth: 1
+
+ /envvar/CCMAKE_COLORS
diff --git a/Help/manual/cmake-file-api.7.rst b/Help/manual/cmake-file-api.7.rst
index 12eecd993..cc50952d6 100644
--- a/Help/manual/cmake-file-api.7.rst
+++ b/Help/manual/cmake-file-api.7.rst
@@ -425,7 +425,7 @@ Version 1 does not exist to avoid confusion with that from
{
"kind": "codemodel",
- "version": { "major": 2, "minor": 0 },
+ "version": { "major": 2, "minor": 1 },
"paths": {
"source": "/path/to/top-level-source-dir",
"build": "/path/to/top-level-build-dir"
@@ -899,6 +899,24 @@ with members:
an unsigned integer 0-based index into the ``backtraceGraph``
member's ``nodes`` array.
+ ``precompileHeaders``
+ Optional member that is present when :command:`target_precompile_headers`
+ or other command invocations set :prop_tgt:`PRECOMPILE_HEADERS` on the
+ target. The value is a JSON array with an entry for each header. Each
+ entry is a JSON object with members:
+
+ ``header``
+ Full path to the precompile header file.
+
+ ``backtrace``
+ Optional member that is present when a CMake language backtrace to
+ the :command:`target_precompile_headers` or other command invocation
+ that added this precompiled header is available. The value is an
+ unsigned integer 0-based index into the ``backtraceGraph`` member's
+ ``nodes`` array.
+
+ This field was added in codemodel version 2.1.
+
``defines``
Optional member that is present when there are preprocessor definitions.
The value is a JSON array with an entry for each definition. Each
diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst
index 691481b99..124da4414 100644
--- a/Help/manual/cmake-generator-expressions.7.rst
+++ b/Help/manual/cmake-generator-expressions.7.rst
@@ -259,6 +259,122 @@ Variable Queries
add_executable(myapp main.cpp)
target_link_libraries(myapp myapp_c myapp_cxx)
+.. _`Boolean LINK_LANGUAGE Generator Expression`:
+
+``$<LINK_LANG_AND_ID:language,compiler_ids>``
+ ``1`` when the language used for link step matches ``language`` and the
+ CMake's compiler id of the language linker matches any one of the entries
+ in ``compiler_ids``, otherwise ``0``. This expression is a short form for the
+ combination of ``$<LINK_LANGUAGE:language>`` and
+ ``$<LANG_COMPILER_ID:compiler_ids>``. This expression may be used to specify
+ link libraries, link options, link directories and link dependencies of a
+ particular language and linker combination in a target. For example:
+
+ .. code-block:: cmake
+
+ add_library(libC_Clang ...)
+ add_library(libCXX_Clang ...)
+ add_library(libC_Intel ...)
+ add_library(libCXX_Intel ...)
+
+ add_executable(myapp main.c)
+ if (CXX_CONFIG)
+ target_sources(myapp PRIVATE file.cxx)
+ endif()
+ target_link_libraries(myapp
+ PRIVATE $<$<LINK_LANG_AND_ID:CXX,Clang,AppleClang>:libCXX_Clang>
+ $<$<LINK_LANG_AND_ID:C,Clang,AppleClang>:libC_Clang>
+ $<$<LINK_LANG_AND_ID:CXX,Intel>:libCXX_Intel>
+ $<$<LINK_LANG_AND_ID:C,Intel>:libC_Intel>)
+
+ This specifies the use of different link libraries based on both the
+ compiler id and link language. This example will have target ``libCXX_Clang``
+ as link dependency when ``Clang`` or ``AppleClang`` is the ``CXX``
+ linker, and ``libCXX_Intel`` when ``Intel`` is the ``CXX`` linker.
+ Likewise when the ``C`` linker is ``Clang`` or ``AppleClang``, target
+ ``libC_Clang`` will be added as link dependency and ``libC_Intel`` when
+ ``Intel`` is the ``C`` linker.
+
+ See :ref:`the note related to
+ <Constraints LINK_LANGUAGE Generator Expression>`
+ ``$<LINK_LANGUAGE:language>`` for constraints about the usage of this
+ generator expression.
+
+``$<LINK_LANGUAGE:languages>``
+ ``1`` when the language used for link step matches any of the entries
+ in ``languages``, otherwise ``0``. This expression may be used to specify
+ link libraries, link options, link directories and link dependencies of a
+ particular language in a target. For example:
+
+ .. code-block:: cmake
+
+ add_library(api_C ...)
+ add_library(api_CXX ...)
+ add_library(api INTERFACE)
+ target_link_options(api INTERFACE $<$<LINK_LANGUAGE:C>:-opt_c>
+ $<$<LINK_LANGUAGE:CXX>:-opt_cxx>)
+ target_link_libraries(api INTERFACE $<$<LINK_LANGUAGE:C>:api_C>
+ $<$<LINK_LANGUAGE:CXX>:api_CXX>)
+
+ add_executable(myapp1 main.c)
+ target_link_options(myapp1 PRIVATE api)
+
+ add_executable(myapp2 main.cpp)
+ target_link_options(myapp2 PRIVATE api)
+
+ This specifies to use the ``api`` target for linking targets ``myapp1`` and
+ ``myapp2``. In practice, ``myapp1`` will link with target ``api_C`` and
+ option ``-opt_c`` because it will use ``C`` as link language. And ``myapp2``
+ will link with ``api_CXX`` and option ``-opt_cxx`` because ``CXX`` will be
+ the link language.
+
+ .. _`Constraints LINK_LANGUAGE Generator Expression`:
+
+ .. note::
+
+ To determine the link language of a target, it is required to collect,
+ transitively, all the targets which will be linked to it. So, for link
+ libraries properties, a double evaluation will be done. During the first
+ evaluation, ``$<LINK_LANGUAGE:..>`` expressions will always return ``0``.
+ The link language computed after this first pass will be used to do the
+ second pass. To avoid inconsistency, it is required that the second pass
+ do not change the link language. Moreover, to avoid unexpected
+ side-effects, it is required to specify complete entities as part of the
+ ``$<LINK_LANGUAGE:..>`` expression. For example:
+
+ .. code-block:: cmake
+
+ add_library(lib STATIC file.cxx)
+ add_library(libother STATIC file.c)
+
+ # bad usage
+ add_executable(myapp1 main.c)
+ target_link_libraries(myapp1 PRIVATE lib$<$<LINK_LANGUAGE:C>:other>)
+
+ # correct usage
+ add_executable(myapp2 main.c)
+ target_link_libraries(myapp2 PRIVATE $<$<LINK_LANGUAGE:C>:libother>)
+
+ In this example, for ``myapp1``, the first pass will, unexpectedly,
+ determine that the link language is ``CXX`` because the evaluation of the
+ generator expression will be an empty string so ``myapp1`` will depends on
+ target ``lib`` which is ``C++``. On the contrary, for ``myapp2``, the first
+ evaluation will give ``C`` as link language, so the second pass will
+ correctly add target ``libother`` as link dependency.
+
+``$<DEVICE_LINK:list>``
+ Returns the list if it is the device link step, an empty list otherwise.
+ The device link step is controlled by :prop_tgt:`CUDA_SEPARABLE_COMPILATION`
+ and :prop_tgt:`CUDA_RESOLVE_DEVICE_SYMBOLS` properties and
+ policy :policy:`CMP0105`. This expression can only be used to specify link
+ options.
+
+``$<HOST_LINK:list>``
+ Returns the list if it is the normal link step, an empty list otherwise.
+ This expression is mainly useful when a device link step is also involved
+ (see ``$<DEVICE_LINK:list>`` generator expression). This expression can only
+ be used to specify link options.
+
String-Valued Generator Expressions
===================================
@@ -450,22 +566,41 @@ Variable Queries
<Boolean COMPILE_LANGUAGE Generator Expression>`
``$<COMPILE_LANGUAGE:language>``
for notes about the portability of this generator expression.
+``$<LINK_LANGUAGE>``
+ The link language of target when evaluating link options.
+ See :ref:`the related boolean expression
+ <Boolean LINK_LANGUAGE Generator Expression>` ``$<LINK_LANGUAGE:language>``
+ for notes about the portability of this generator expression.
+
+ .. note::
+
+ This generator expression is not supported by the link libraries
+ properties to avoid side-effects due to the double evaluation of
+ these properties.
Target-Dependent Queries
------------------------
+These queries refer to a target ``tgt``. This can be any runtime artifact,
+namely:
+
+* an executable target created by :command:`add_executable`
+* a shared library target (``.so``, ``.dll`` but not their ``.lib`` import library)
+ created by :command:`add_library`
+* a static library target created by :command:`add_library`
+
+In the following, "the ``tgt`` filename" means the name of the ``tgt``
+binary file. This has to be distinguished from "the target name",
+which is just the string ``tgt``.
+
``$<TARGET_NAME_IF_EXISTS:tgt>``
- Expands to the ``tgt`` if the given target exists, an empty string
- otherwise.
+ The target name ``tgt`` if the target exists, an empty string otherwise.
``$<TARGET_FILE:tgt>``
- Full path to main file (.exe, .so.1.2, .a) where ``tgt`` is the name of a
- target.
+ Full path to the ``tgt`` binary file.
``$<TARGET_FILE_BASE_NAME:tgt>``
- Base name of main file where ``tgt`` is the name of a target.
-
- The base name corresponds to the target file name (see
- ``$<TARGET_FILE_NAME:tgt>``) without prefix and suffix. For example, if
- target file name is ``libbase.so``, the base name is ``base``.
+ Base name of ``tgt``, i.e. ``$<TARGET_FILE_NAME:tgt>`` without prefix and
+ suffix.
+ For example, if the ``tgt`` filename is ``libbase.so``, the base name is ``base``.
See also the :prop_tgt:`OUTPUT_NAME`, :prop_tgt:`ARCHIVE_OUTPUT_NAME`,
:prop_tgt:`LIBRARY_OUTPUT_NAME` and :prop_tgt:`RUNTIME_OUTPUT_NAME`
@@ -480,32 +615,31 @@ Target-Dependent Queries
Note that ``tgt`` is not added as a dependency of the target this
expression is evaluated on.
``$<TARGET_FILE_PREFIX:tgt>``
- Prefix of main file where ``tgt`` is the name of a target.
+ Prefix of the ``tgt`` filename (such as ``lib``).
See also the :prop_tgt:`PREFIX` target property.
Note that ``tgt`` is not added as a dependency of the target this
expression is evaluated on.
``$<TARGET_FILE_SUFFIX:tgt>``
- Suffix of main file where ``tgt`` is the name of a target.
-
- The suffix corresponds to the file extension (such as ".so" or ".exe").
+ Suffix of the ``tgt`` filename (extension such as ``.so`` or ``.exe``).
See also the :prop_tgt:`SUFFIX` target property.
Note that ``tgt`` is not added as a dependency of the target this
expression is evaluated on.
``$<TARGET_FILE_NAME:tgt>``
- Name of main file (.exe, .so.1.2, .a).
+ The ``tgt`` filename.
``$<TARGET_FILE_DIR:tgt>``
- Directory of main file (.exe, .so.1.2, .a).
+ Directory of the ``tgt`` binary file.
``$<TARGET_LINKER_FILE:tgt>``
- File used to link (.a, .lib, .so) where ``tgt`` is the name of a target.
+ File used when linking to the ``tgt`` target. This will usually
+ be the library that ``tgt`` represents (``.a``, ``.lib``, ``.so``),
+ but for a shared library on DLL platforms, it would be the ``.lib``
+ import library associated with the DLL.
``$<TARGET_LINKER_FILE_BASE_NAME:tgt>``
- Base name of file used to link where ``tgt`` is the name of a target.
-
- The base name corresponds to the target linker file name (see
- ``$<TARGET_LINKER_FILE_NAME:tgt>``) without prefix and suffix. For example,
+ Base name of file used to link the target ``tgt``, i.e.
+ ``$<TARGET_LINKER_FILE_NAME:tgt>`` without prefix and suffix. For example,
if target file name is ``libbase.a``, the base name is ``base``.
See also the :prop_tgt:`OUTPUT_NAME`, :prop_tgt:`ARCHIVE_OUTPUT_NAME`,
@@ -520,7 +654,7 @@ Target-Dependent Queries
Note that ``tgt`` is not added as a dependency of the target this
expression is evaluated on.
``$<TARGET_LINKER_FILE_PREFIX:tgt>``
- Prefix of file used to link where ``tgt`` is the name of a target.
+ Prefix of file used to link target ``tgt``.
See also the :prop_tgt:`PREFIX` and :prop_tgt:`IMPORT_PREFIX` target
properties.
@@ -538,15 +672,15 @@ Target-Dependent Queries
Note that ``tgt`` is not added as a dependency of the target this
expression is evaluated on.
``$<TARGET_LINKER_FILE_NAME:tgt>``
- Name of file used to link (.a, .lib, .so).
+ Name of file used to link target ``tgt``.
``$<TARGET_LINKER_FILE_DIR:tgt>``
- Directory of file used to link (.a, .lib, .so).
+ Directory of file used to link target ``tgt``.
``$<TARGET_SONAME_FILE:tgt>``
- File with soname (.so.3) where ``tgt`` is the name of a target.
+ File with soname (``.so.3``) where ``tgt`` is the name of a target.
``$<TARGET_SONAME_FILE_NAME:tgt>``
- Name of file with soname (.so.3).
+ Name of file with soname (``.so.3``).
``$<TARGET_SONAME_FILE_DIR:tgt>``
- Directory of with soname (.so.3).
+ Directory of with soname (``.so.3``).
``$<TARGET_PDB_FILE:tgt>``
Full path to the linker generated program database file (.pdb)
where ``tgt`` is the name of a target.
@@ -589,11 +723,10 @@ Target-Dependent Queries
Note that ``tgt`` is not added as a dependency of the target this
expression is evaluated on.
``$<TARGET_PROPERTY:prop>``
- Value of the property ``prop`` on the target on which the generator
- expression is evaluated. Note that for generator expressions in
- :ref:`Target Usage Requirements` this is the value of the property
- on the consuming target rather than the target specifying the
- requirement.
+ Value of the property ``prop`` on the target for which the expression
+ is being evaluated. Note that for generator expressions in
+ :ref:`Target Usage Requirements` this is the consuming target rather
+ than the target specifying the requirement.
``$<INSTALL_PREFIX>``
Content of the install prefix when the target is exported via
:command:`install(EXPORT)`, or when evaluated in
diff --git a/Help/manual/cmake-modules.7.rst b/Help/manual/cmake-modules.7.rst
index be64112c7..50131e8fc 100644
--- a/Help/manual/cmake-modules.7.rst
+++ b/Help/manual/cmake-modules.7.rst
@@ -36,6 +36,7 @@ These modules are loaded using the :command:`include` command.
/module/CheckIncludeFiles
/module/CheckLanguage
/module/CheckLibraryExists
+ /module/CheckLinkerFlag
/module/CheckOBJCCompilerFlag
/module/CheckOBJCSourceCompiles
/module/CheckOBJCSourceRuns
diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst
index c25625097..e98038ac6 100644
--- a/Help/manual/cmake-policies.7.rst
+++ b/Help/manual/cmake-policies.7.rst
@@ -51,6 +51,19 @@ The :variable:`CMAKE_MINIMUM_REQUIRED_VERSION` variable may also be used
to determine whether to report an error on use of deprecated macros or
functions.
+Policies Introduced by CMake 3.18
+=================================
+
+.. toctree::
+ :maxdepth: 1
+
+ CMP0108: A target cannot link to itself through an alias. </policy/CMP0108>
+ CMP0107: An ALIAS target cannot overwrite another target. </policy/CMP0107>
+ CMP0106: The Documentation module is removed. </policy/CMP0106>
+ CMP0105: Device link step uses the link options. </policy/CMP0105>
+ CMP0104: CMAKE_CUDA_ARCHITECTURES now detected for NVCC, empty CUDA_ARCHITECTURES not allowed. </policy/CMP0104>
+ CMP0103: Multiple export() with same FILE without APPEND is not allowed. </policy/CMP0103>
+
Policies Introduced by CMake 3.17
=================================
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index 060a072bf..30b2a0590 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -105,6 +105,7 @@ Properties on Targets
/prop_tgt/ADDITIONAL_CLEAN_FILES
/prop_tgt/AIX_EXPORT_ALL_SYMBOLS
+ /prop_tgt/ALIAS_GLOBAL
/prop_tgt/ALIASED_TARGET
/prop_tgt/ANDROID_ANT_ADDITIONAL_OPTIONS
/prop_tgt/ANDROID_API
@@ -171,6 +172,7 @@ Properties on Targets
/prop_tgt/CONFIG_OUTPUT_NAME
/prop_tgt/CONFIG_POSTFIX
/prop_tgt/CROSSCOMPILING_EMULATOR
+ /prop_tgt/CUDA_ARCHITECTURES
/prop_tgt/CUDA_PTX_COMPILATION
/prop_tgt/CUDA_SEPARABLE_COMPILATION
/prop_tgt/CUDA_RESOLVE_DEVICE_SYMBOLS
@@ -199,7 +201,9 @@ Properties on Targets
/prop_tgt/FOLDER
/prop_tgt/Fortran_FORMAT
/prop_tgt/Fortran_MODULE_DIRECTORY
+ /prop_tgt/Fortran_PREPROCESS
/prop_tgt/FRAMEWORK
+ /prop_tgt/FRAMEWORK_MULTI_CONFIG_POSTFIX_CONFIG
/prop_tgt/FRAMEWORK_VERSION
/prop_tgt/GENERATOR_FILE_NAME
/prop_tgt/GHS_INTEGRITY_APP
@@ -307,6 +311,7 @@ Properties on Targets
/prop_tgt/OSX_ARCHITECTURES
/prop_tgt/OUTPUT_NAME_CONFIG
/prop_tgt/OUTPUT_NAME
+ /prop_tgt/PCH_WARN_INVALID
/prop_tgt/PDB_NAME_CONFIG
/prop_tgt/PDB_NAME
/prop_tgt/PDB_OUTPUT_DIRECTORY_CONFIG
@@ -343,6 +348,7 @@ Properties on Targets
/prop_tgt/UNITY_BUILD_BATCH_SIZE
/prop_tgt/UNITY_BUILD_CODE_AFTER_INCLUDE
/prop_tgt/UNITY_BUILD_CODE_BEFORE_INCLUDE
+ /prop_tgt/UNITY_BUILD_MODE
/prop_tgt/VERSION
/prop_tgt/VISIBILITY_INLINES_HIDDEN
/prop_tgt/VS_CONFIGURATION_TYPE
@@ -369,12 +375,15 @@ Properties on Targets
/prop_tgt/VS_MOBILE_EXTENSIONS_VERSION
/prop_tgt/VS_NO_SOLUTION_DEPLOY
/prop_tgt/VS_PACKAGE_REFERENCES
+ /prop_tgt/VS_PLATFORM_TOOLSET
/prop_tgt/VS_PROJECT_IMPORT
/prop_tgt/VS_SCC_AUXPATH
/prop_tgt/VS_SCC_LOCALPATH
/prop_tgt/VS_SCC_PROJECTNAME
/prop_tgt/VS_SCC_PROVIDER
/prop_tgt/VS_SDK_REFERENCES
+ /prop_tgt/VS_SOLUTION_DEPLOY
+ /prop_tgt/VS_SOURCE_SETTINGS_tool
/prop_tgt/VS_USER_PROPS
/prop_tgt/VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION
/prop_tgt/VS_WINRT_COMPONENT
@@ -459,6 +468,7 @@ Properties on Source Files
/prop_sf/COMPILE_OPTIONS
/prop_sf/EXTERNAL_OBJECT
/prop_sf/Fortran_FORMAT
+ /prop_sf/Fortran_PREPROCESS
/prop_sf/GENERATED
/prop_sf/HEADER_FILE_ONLY
/prop_sf/INCLUDE_DIRECTORIES
@@ -478,12 +488,14 @@ Properties on Source Files
/prop_sf/Swift_DEPENDENCIES_FILE
/prop_sf/Swift_DIAGNOSTICS_FILE
/prop_sf/SYMBOLIC
+ /prop_sf/UNITY_GROUP
/prop_sf/VS_COPY_TO_OUT_DIR
/prop_sf/VS_CSHARP_tagname
/prop_sf/VS_DEPLOYMENT_CONTENT
/prop_sf/VS_DEPLOYMENT_LOCATION
/prop_sf/VS_INCLUDE_IN_VSIX
/prop_sf/VS_RESOURCE_GENERATOR
+ /prop_sf/VS_SETTINGS
/prop_sf/VS_SHADER_DISABLE_OPTIMIZATIONS
/prop_sf/VS_SHADER_ENABLE_DEBUG
/prop_sf/VS_SHADER_ENTRYPOINT
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index fc2773949..4ce836510 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -388,8 +388,10 @@ Variables that Control the Build
/variable/CMAKE_EXE_LINKER_FLAGS_INIT
/variable/CMAKE_FOLDER
/variable/CMAKE_FRAMEWORK
+ /variable/CMAKE_FRAMEWORK_MULTI_CONFIG_POSTFIX_CONFIG
/variable/CMAKE_Fortran_FORMAT
/variable/CMAKE_Fortran_MODULE_DIRECTORY
+ /variable/CMAKE_Fortran_PREPROCESS
/variable/CMAKE_GHS_NO_SOURCE_GROUP_FILE
/variable/CMAKE_GLOBAL_AUTOGEN_TARGET
/variable/CMAKE_GLOBAL_AUTOGEN_TARGET_NAME
@@ -437,6 +439,7 @@ Variables that Control the Build
/variable/CMAKE_OSX_ARCHITECTURES
/variable/CMAKE_OSX_DEPLOYMENT_TARGET
/variable/CMAKE_OSX_SYSROOT
+ /variable/CMAKE_PCH_WARN_INVALID
/variable/CMAKE_PDB_OUTPUT_DIRECTORY
/variable/CMAKE_PDB_OUTPUT_DIRECTORY_CONFIG
/variable/CMAKE_POSITION_INDEPENDENT_CODE
@@ -486,6 +489,7 @@ Variables for Languages
/variable/CMAKE_COMPILER_IS_GNUCC
/variable/CMAKE_COMPILER_IS_GNUCXX
/variable/CMAKE_COMPILER_IS_GNUG77
+ /variable/CMAKE_CUDA_ARCHITECTURES
/variable/CMAKE_CUDA_COMPILE_FEATURES
/variable/CMAKE_CUDA_HOST_COMPILER
/variable/CMAKE_CUDA_EXTENSIONS
@@ -621,6 +625,7 @@ Variables for CTest
/variable/CTEST_P4_COMMAND
/variable/CTEST_P4_OPTIONS
/variable/CTEST_P4_UPDATE_OPTIONS
+ /variable/CTEST_RESOURCE_SPEC_FILE
/variable/CTEST_RUN_CURRENT_SCRIPT
/variable/CTEST_SCP_COMMAND
/variable/CTEST_SITE
diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst
index d34387431..9becfc60d 100644
--- a/Help/manual/cmake.1.rst
+++ b/Help/manual/cmake.1.rst
@@ -358,6 +358,20 @@ Options
in :variable:`CMAKE_SOURCE_DIR` and :variable:`CMAKE_BINARY_DIR`.
This flag tells CMake to warn about other files as well.
+``--profiling-output=<path>``
+ Used in conjuction with ``--profiling-format`` to output to a given path.
+
+``--profiling-format=<file>``
+ Enable the output of profiling data of CMake script in the given format.
+
+ This can aid performance analysis of CMake scripts executed. Third party
+ applications should be used to process the output into human readable format.
+
+ Currently supported values are:
+ ``google-trace`` Outputs in Google Trace Format, which can be parsed by the
+ about:tracing tab of Google Chrome or using a plugin for a tool like Trace
+ Compass.
+
.. _`Build Tool Mode`:
Build a Project
@@ -467,13 +481,17 @@ Run a Script
.. code-block:: shell
- cmake [{-D <var>=<value>}...] -P <cmake-script-file>
+ cmake [{-D <var>=<value>}...] -P <cmake-script-file> [-- <unparsed-options>...]
Process the given cmake file as a script written in the CMake
language. No configure or generate step is performed and the cache
is not modified. If variables are defined using ``-D``, this must be
done before the ``-P`` argument.
+Any options after ``--`` are not parsed by CMake, but they are still included
+in the set of :variable:`CMAKE_ARGV<n> <CMAKE_ARGV0>` variables passed to the
+script (including the ``--`` itself).
+
Run a Command-Line Tool
=======================
@@ -540,6 +558,9 @@ Available commands are:
``serverMode``
``true`` if cmake supports server-mode and ``false`` otherwise.
+``cat <files>...``
+ Concatenate files and print on the standard output.
+
``chdir <dir> <cmd> [<arg>...]``
Change the current working directory and run a command.
diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst
index 6503f0e29..d3ab75a92 100644
--- a/Help/manual/ctest.1.rst
+++ b/Help/manual/ctest.1.rst
@@ -72,6 +72,9 @@ Options
This option can also be enabled by setting the
:envvar:`CTEST_OUTPUT_ON_FAILURE` environment variable
+``--stop-on-failure``
+ Stop running the tests when the first failure happens.
+
``-F``
Enable failover.
@@ -994,8 +997,12 @@ Configuration settings include:
``ResourceSpecFile``
Specify a
- :ref:`resource specification file <ctest-resource-specification-file>`. See
- :ref:`ctest-resource-allocation` for more information.
+ :ref:`resource specification file <ctest-resource-specification-file>`.
+
+ * `CTest Script`_ variable: :variable:`CTEST_RESOURCE_SPEC_FILE`
+ * :module:`CTest` module variable: ``CTEST_RESOURCE_SPEC_FILE``
+
+ See :ref:`ctest-resource-allocation` for more information.
``LabelsForSubprojects``
Specify a semicolon-separated list of labels that will be treated as
@@ -1403,9 +1410,16 @@ Resource Specification File
The resource specification file is a JSON file which is passed to CTest, either
on the :manual:`ctest(1)` command line as ``--resource-spec-file``, or as the
-``RESOURCE_SPEC_FILE`` argument of :command:`ctest_test`. The resource
-specification file must be a JSON object. All examples in this document assume
-the following resource specification file:
+``RESOURCE_SPEC_FILE`` argument of :command:`ctest_test`. If a dashboard script
+is used and ``RESOURCE_SPEC_FILE`` is not specified, the value of
+:variable:`CTEST_RESOURCE_SPEC_FILE` in the dashboard script is used instead.
+If ``--resource-spec-file``, ``RESOURCE_SPEC_FILE``, and
+:variable:`CTEST_RESOURCE_SPEC_FILE` in the dashboard script are not specified,
+the value of :variable:`CTEST_RESOURCE_SPEC_FILE` in the CMake build is used
+instead. If none of these are specified, no resource spec file is used.
+
+The resource specification file must be a JSON object. All examples in this
+document assume the following resource specification file:
.. code-block:: json
diff --git a/Help/module/CheckLinkerFlag.rst b/Help/module/CheckLinkerFlag.rst
new file mode 100644
index 000000000..400572500
--- /dev/null
+++ b/Help/module/CheckLinkerFlag.rst
@@ -0,0 +1 @@
+.. cmake-module:: ../../Modules/CheckLinkerFlag.cmake
diff --git a/Help/policy/CMP0103.rst b/Help/policy/CMP0103.rst
new file mode 100644
index 000000000..223e0cb00
--- /dev/null
+++ b/Help/policy/CMP0103.rst
@@ -0,0 +1,22 @@
+CMP0103
+-------
+
+Multiple calls to :command:`export` command with same ``FILE`` without
+``APPEND`` is no longer allowed.
+
+In CMake 3.17 and below, multiple calls to :command:`export` command with the
+same ``FILE`` without ``APPEND`` are accepted silently but only the last
+occurrence is taken into account during the generation.
+
+The ``OLD`` behavior for this policy is to ignore the multiple occurrences of
+ :command:`export` command except the last one.
+
+The ``NEW`` behavior of this policy is to raise an error on second call to
+:command:`export` command with same ``FILE`` without ``APPEND``.
+
+This policy was introduced in CMake version 3.18. CMake version
+|release| warns when the policy is not set and uses ``OLD`` behavior.
+Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW``
+explicitly.
+
+.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0104.rst b/Help/policy/CMP0104.rst
new file mode 100644
index 000000000..85167169f
--- /dev/null
+++ b/Help/policy/CMP0104.rst
@@ -0,0 +1,56 @@
+CMP0104
+-------
+
+Initialize :variable:`CMAKE_CUDA_ARCHITECTURES` when
+:variable:`CMAKE_CUDA_COMPILER_ID <CMAKE_<LANG>_COMPILER_ID>` is ``NVIDIA``.
+Raise an error if :prop_tgt:`CUDA_ARCHITECTURES` is empty.
+
+:variable:`CMAKE_CUDA_ARCHITECTURES` introduced in CMake 3.18 is used to
+initialize :prop_tgt:`CUDA_ARCHITECTURES`, which passes correct code generation
+flags to the CUDA compiler.
+
+Previous to this users had to manually specify the code generation flags. This
+policy is for backwards compatibility with manually specifying code generation
+flags.
+
+The ``OLD`` behavior for this policy is to not initialize
+:variable:`CMAKE_CUDA_ARCHITECTURES` when
+:variable:`CMAKE_CUDA_COMPILER_ID <CMAKE_<LANG>_COMPILER_ID>` is ``NVIDIA``.
+Empty :prop_tgt:`CUDA_ARCHITECTURES` is allowed.
+
+The ``NEW`` behavior of this policy is to initialize
+:variable:`CMAKE_CUDA_ARCHITECTURES` when
+:variable:`CMAKE_CUDA_COMPILER_ID <CMAKE_<LANG>_COMPILER_ID>` is ``NVIDIA``
+and raise an error if :prop_tgt:`CUDA_ARCHITECTURES` is empty during generation.
+
+If :prop_tgt:`CUDA_ARCHITECTURES` is set to a false value no architectures
+flags are passed to the compiler. This is intended to support packagers and
+the rare cases where full control over the passed flags is required.
+
+This policy was introduced in CMake version 3.18. CMake version
+|release| warns when the policy is not set and uses ``OLD`` behavior.
+Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW``
+explicitly.
+
+.. include:: DEPRECATED.txt
+
+Examples
+^^^^^^^^
+
+.. code-block:: cmake
+
+ set_property(TARGET tgt PROPERTY CUDA_ARCHITECTURES 35 50 72)
+
+Generates code for real and virtual architectures ``30``, ``50`` and ``72``.
+
+.. code-block:: cmake
+
+ set_property(TARGET tgt PROPERTY CUDA_ARCHITECTURES 70-real 72-virtual)
+
+Generates code for real architecture ``70`` and virtual architecture ``72``.
+
+.. code-block:: cmake
+
+ set_property(TARGET tgt PROPERTY CUDA_ARCHITECTURES OFF)
+
+CMake will not pass any architecture flags to the compiler.
diff --git a/Help/policy/CMP0105.rst b/Help/policy/CMP0105.rst
new file mode 100644
index 000000000..19a1edbe7
--- /dev/null
+++ b/Help/policy/CMP0105.rst
@@ -0,0 +1,19 @@
+CMP0105
+-------
+
+:prop_tgt:`LINK_OPTIONS` and :prop_tgt:`INTERFACE_LINK_OPTIONS` target
+properties are now used for the device link step.
+
+In CMake 3.17 and below, link options are not used by the device link step.
+
+The ``OLD`` behavior for this policy is to ignore the link options.
+
+The ``NEW`` behavior of this policy is to use the link options during the
+device link step.
+
+This policy was introduced in CMake version 3.17. Use the
+:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+Unlike many policies, CMake version |release| does *not* warn
+when this policy is not set and simply uses ``OLD`` behavior.
+
+.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0106.rst b/Help/policy/CMP0106.rst
new file mode 100644
index 000000000..e34d15ac8
--- /dev/null
+++ b/Help/policy/CMP0106.rst
@@ -0,0 +1,19 @@
+CMP0106
+-------
+
+The :module:`Documentation` module is removed.
+
+The :module:`Documentation` was added as a support mechanism for the VTK
+project and was tuned for that project. Instead of CMake providing this module
+with (now old) VTK patterns for cache variables and required packages, the
+module is now deprecated by CMake itself.
+
+The ``OLD`` behavior of this policy is for :module:`Documentation` to add
+cache variables and find VTK documentation dependent packages. The ``NEW``
+behavior is to act as an empty module.
+
+This policy was introduced in CMake version 3.18. CMake version |release|
+warns when the policy is not set and uses ``OLD`` behavior. Use the
+:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+
+.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0107.rst b/Help/policy/CMP0107.rst
new file mode 100644
index 000000000..111bef7a4
--- /dev/null
+++ b/Help/policy/CMP0107.rst
@@ -0,0 +1,19 @@
+CMP0107
+-------
+
+It is not allowed to create an ``ALIAS`` target with the same name as an
+another target.
+
+In CMake 3.17 and below, an ``ALIAS`` target can overwrite silently an existing
+target with the same name.
+
+The ``OLD`` behavior for this policy is to allow target overwrite.
+
+The ``NEW`` behavior of this policy is to prevent target overwriting.
+
+This policy was introduced in CMake version 3.17. Use the
+:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+Unlike many policies, CMake version |release| does *not* warn
+when this policy is not set and simply uses ``OLD`` behavior.
+
+.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0108.rst b/Help/policy/CMP0108.rst
new file mode 100644
index 000000000..0d54cfa3e
--- /dev/null
+++ b/Help/policy/CMP0108.rst
@@ -0,0 +1,19 @@
+CMP0108
+-------
+
+A target is not allowed to link to itself even through an ``ALIAS`` target.
+
+In CMake 3.17 and below, a target can link to a target aliased to itself.
+
+The ``OLD`` behavior for this policy is to allow a target to link to a target
+aliased to itself.
+
+The ``NEW`` behavior of this policy is to prevent a target to link to itself
+through an ``ALIAS`` target.
+
+This policy was introduced in CMake version 3.17. Use the
+:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+Unlike many policies, CMake version |release| does *not* warn
+when this policy is not set and simply uses ``OLD`` behavior.
+
+.. include:: DEPRECATED.txt
diff --git a/Help/prop_dir/LINK_OPTIONS.rst b/Help/prop_dir/LINK_OPTIONS.rst
index 54ac6ddaa..f229ba6d6 100644
--- a/Help/prop_dir/LINK_OPTIONS.rst
+++ b/Help/prop_dir/LINK_OPTIONS.rst
@@ -2,7 +2,7 @@ LINK_OPTIONS
------------
List of options to use for the link step of shared library, module
-and executable targets.
+and executable targets as well as the device link step.
This property holds a :ref:`semicolon-separated list <CMake Language Lists>` of options
given so far to the :command:`add_link_options` command.
diff --git a/Help/prop_sf/COMPILE_OPTIONS.rst b/Help/prop_sf/COMPILE_OPTIONS.rst
index 7e48271d0..537dcecf6 100644
--- a/Help/prop_sf/COMPILE_OPTIONS.rst
+++ b/Help/prop_sf/COMPILE_OPTIONS.rst
@@ -5,9 +5,7 @@ List of additional options to pass to the compiler.
This property holds a :ref:`semicolon-separated list <CMake Language Lists>` of options
and will be added to the list of compile flags when this
-source file builds. Use :prop_sf:`COMPILE_DEFINITIONS` to pass
-additional preprocessor definitions and :prop_sf:`INCLUDE_DIRECTORIES` to pass
-additional include directories.
+source file builds.
Contents of ``COMPILE_OPTIONS`` may use "generator expressions" with the
syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual
@@ -16,6 +14,19 @@ does not support per-config per-source settings, so expressions
that depend on the build configuration are not allowed with that
generator.
-.. note::
+Usage example:
- This property should be preferred over the :prop_sf:`COMPILE_FLAGS` property.
+.. code-block:: cmake
+
+ set_source_files_properties(foo.cpp PROPERTIES COMPILE_OPTIONS "-Wno-unused-parameter;-Wno-missing-field-initializer")
+
+Related properties:
+
+* Prefer this property over :prop_sf:`COMPILE_FLAGS`.
+* Use :prop_sf:`COMPILE_DEFINITIONS` to pass additional preprocessor definitions.
+* Use :prop_sf:`INCLUDE_DIRECTORIES` to pass additional include directories.
+
+Related commands:
+
+* :command:`add_compile_options` for directory-wide settings
+* :command:`target_compile_options` for target-specific settings
diff --git a/Help/prop_sf/Fortran_FORMAT.rst b/Help/prop_sf/Fortran_FORMAT.rst
index 1cbbf4809..ef3392619 100644
--- a/Help/prop_sf/Fortran_FORMAT.rst
+++ b/Help/prop_sf/Fortran_FORMAT.rst
@@ -4,7 +4,9 @@ Fortran_FORMAT
Set to ``FIXED`` or ``FREE`` to indicate the Fortran source layout.
This property tells CMake whether a given Fortran source file uses
-fixed-format or free-format. CMake will pass the corresponding format
-flag to the compiler. Consider using the target-wide
-:prop_tgt:`Fortran_FORMAT` property if all source files in a target
-share the same format.
+fixed-format or free-format. CMake will pass the corresponding format flag
+to the compiler. Consider using the target-wide :prop_tgt:`Fortran_FORMAT`
+property if all source files in a target share the same format.
+
+.. note:: For some compilers, ``NAG``, ``PGI`` and ``Solaris Studio``,
+ setting this to ``OFF`` will have no effect.
diff --git a/Help/prop_sf/Fortran_PREPROCESS.rst b/Help/prop_sf/Fortran_PREPROCESS.rst
new file mode 100644
index 000000000..25ea827c8
--- /dev/null
+++ b/Help/prop_sf/Fortran_PREPROCESS.rst
@@ -0,0 +1,17 @@
+Fortran_PREPROCESS
+------------------
+
+Control whether the Fortran source file should be unconditionally preprocessed.
+
+If unset or empty, rely on the compiler to determine whether the file
+should be preprocessed. If explicitly set to ``OFF`` then the file
+does not need to be preprocessed. If explicitly set to ``ON``, then
+the file does need to be preprocessed as part of the compilation step.
+
+When using the :generator:`Ninja` generator, all source files are
+first preprocessed in order to generate module dependency
+information. Setting this property to ``OFF`` will make ``Ninja``
+skip this step.
+
+Consider using the target-wide :prop_tgt:`Fortran_PREPROCESS` property
+if all source files in a target need to be preprocessed.
diff --git a/Help/prop_sf/OBJECT_OUTPUTS.rst b/Help/prop_sf/OBJECT_OUTPUTS.rst
index e7e880b29..3e799ed88 100644
--- a/Help/prop_sf/OBJECT_OUTPUTS.rst
+++ b/Help/prop_sf/OBJECT_OUTPUTS.rst
@@ -7,3 +7,6 @@ Additional outputs created by compilation of this source file. If any
of these outputs is missing the object will be recompiled. This is
supported only on the :generator:`Ninja` and :ref:`Makefile Generators`
and will be ignored on other generators.
+
+This property supports
+:manual:`generator expressions <cmake-generator-expressions(7)>`.
diff --git a/Help/prop_sf/UNITY_GROUP.rst b/Help/prop_sf/UNITY_GROUP.rst
new file mode 100644
index 000000000..ec6b0f652
--- /dev/null
+++ b/Help/prop_sf/UNITY_GROUP.rst
@@ -0,0 +1,5 @@
+UNITY_GROUP
+-----------
+
+This property controls which *bucket* the source will be part of when
+the :prop_tgt:`UNITY_BUILD_MODE` is set to ``GROUP``.
diff --git a/Help/prop_sf/VS_SETTINGS.rst b/Help/prop_sf/VS_SETTINGS.rst
new file mode 100644
index 000000000..50034fb18
--- /dev/null
+++ b/Help/prop_sf/VS_SETTINGS.rst
@@ -0,0 +1,18 @@
+VS_SETTINGS
+-----------
+
+Set any item metadata on a non-built file.
+
+Takes a list of ``Key=Value`` pairs. Tells the Visual Studio generator to set
+``Key`` to ``Value`` as item metadata on the file.
+
+For example:
+
+.. code-block:: cmake
+
+ set_property(SOURCE file.hlsl PROPERTY VS_SETTINGS "Key=Value" "Key2=Value2")
+
+will set ``Key`` to ``Value`` and ``Key2`` to ``Value2`` on the
+``file.hlsl`` item as metadata.
+
+:manual:`Generator expressions <cmake-generator-expressions(7)>` are supported.
diff --git a/Help/prop_test/DEPENDS.rst b/Help/prop_test/DEPENDS.rst
index 89c755325..5aa36b446 100644
--- a/Help/prop_test/DEPENDS.rst
+++ b/Help/prop_test/DEPENDS.rst
@@ -8,3 +8,15 @@ results of those tests are not considered, the dependency relationship is
purely for order of execution (i.e. it is really just a *run after*
relationship). Consider using test fixtures with setup tests if a dependency
with successful completion is required (see :prop_test:`FIXTURES_REQUIRED`).
+
+Examples
+~~~~~~~~
+
+.. code-block:: cmake
+
+ add_test(NAME baseTest1 ...)
+ add_test(NAME baseTest2 ...)
+ add_test(NAME dependsTest12 ...)
+
+ set_tests_properties(dependsTest12 PROPERTIES DEPENDS "baseTest1;baseTest2")
+ # dependsTest12 runs after baseTest1 and baseTest2, even if they fail
diff --git a/Help/prop_test/REQUIRED_FILES.rst b/Help/prop_test/REQUIRED_FILES.rst
index fac357c1e..baf209cfb 100644
--- a/Help/prop_test/REQUIRED_FILES.rst
+++ b/Help/prop_test/REQUIRED_FILES.rst
@@ -1,7 +1,38 @@
REQUIRED_FILES
--------------
-List of files required to run the test.
+List of files required to run the test. The filenames are relative to the
+test :prop_test:`WORKING_DIRECTORY` unless an absolute path is specified.
If set to a list of files, the test will not be run unless all of the
files exist.
+
+Examples
+~~~~~~~~
+
+Suppose that ``test.txt`` is created by test ``baseTest`` and ``none.txt``
+does not exist:
+
+.. code-block:: cmake
+
+ add_test(NAME baseTest ...) # Assumed to create test.txt
+ add_test(NAME fileTest ...)
+
+ # The following ensures that if baseTest is successful, test.txt will
+ # have been created before fileTest is run
+ set_tests_properties(fileTest PROPERTIES
+ DEPENDS baseTest
+ REQUIRED_FILES test.txt
+ )
+
+ add_test(NAME notRunTest ...)
+
+ # The following makes notRunTest depend on two files. Nothing creates
+ # the none.txt file, so notRunTest will fail with status "Not Run".
+ set_tests_properties(notRunTest PROPERTIES
+ REQUIRED_FILES "test.txt;none.txt"
+ )
+
+The above example demonstrates how ``REQUIRED_FILES`` works, but it is not the
+most robust way to implement test ordering with failure detection. For that,
+test fixtures are a better alternative (see :prop_test:`FIXTURES_REQUIRED`).
diff --git a/Help/prop_tgt/ALIAS_GLOBAL.rst b/Help/prop_tgt/ALIAS_GLOBAL.rst
new file mode 100644
index 000000000..8854f571c
--- /dev/null
+++ b/Help/prop_tgt/ALIAS_GLOBAL.rst
@@ -0,0 +1,17 @@
+ALIAS_GLOBAL
+------------
+
+Read-only property indicating of whether an :ref:`ALIAS target <Alias Targets>`
+is globally visible.
+
+The boolean value of this property is ``TRUE`` for aliases to
+:ref:`IMPORTED targets <Imported Targets>` created
+with the ``GLOBAL`` options to :command:`add_executable()` or
+:command:`add_library()`, ``FALSE`` otherwise. It is undefined for
+targets built within the project.
+
+.. note::
+
+ Promoting an :ref:`IMPORTED target <Imported Targets>` from ``LOCAL``
+ to ``GLOBAL`` scope by changing the value or :prop_tgt:`IMPORTED_GLOBAL`
+ target property do not change the scope of local aliases.
diff --git a/Help/prop_tgt/AUTOMOC_PATH_PREFIX.rst b/Help/prop_tgt/AUTOMOC_PATH_PREFIX.rst
index 5ed504ff3..3e3059d7a 100644
--- a/Help/prop_tgt/AUTOMOC_PATH_PREFIX.rst
+++ b/Help/prop_tgt/AUTOMOC_PATH_PREFIX.rst
@@ -13,7 +13,7 @@ the ``-p`` path prefix option. ``moc`` usually generates a
relative include path in that case.
:prop_tgt:`AUTOMOC_PATH_PREFIX` is initialized from the variable
-:variable:`CMAKE_AUTOMOC_PATH_PREFIX`, which is ``OFF`` by default.
+:variable:`CMAKE_AUTOMOC_PATH_PREFIX`, which is ``ON`` by default.
See the :manual:`cmake-qt(7)` manual for more information on using CMake
with Qt.
@@ -24,7 +24,8 @@ Reproducible builds
For reproducible builds it is recommended to keep headers that are ``moc``
compiled in one of the target
:command:`include directories <target_include_directories>` and set
-:prop_tgt:`AUTOMOC_PATH_PREFIX` to ``ON``. This ensures that:
+:prop_tgt:`AUTOMOC_PATH_PREFIX` to ``ON`` (which is the default). This ensures
+that:
- ``moc`` output files are identical on different build setups,
- ``moc`` output files will compile correctly when the source and/or
diff --git a/Help/prop_tgt/CONFIG_POSTFIX.rst b/Help/prop_tgt/CONFIG_POSTFIX.rst
index 11b50b900..5c2fbd75f 100644
--- a/Help/prop_tgt/CONFIG_POSTFIX.rst
+++ b/Help/prop_tgt/CONFIG_POSTFIX.rst
@@ -8,3 +8,6 @@ is appended to the target file name built on disk. For non-executable
targets, this property is initialized by the value of the variable
CMAKE_<CONFIG>_POSTFIX if it is set when a target is created. This
property is ignored on the Mac for Frameworks and App Bundles.
+
+For macOS see also the :prop_tgt:`FRAMEWORK_MULTI_CONFIG_POSTFIX_<CONFIG>`
+target property.
diff --git a/Help/prop_tgt/CUDA_ARCHITECTURES.rst b/Help/prop_tgt/CUDA_ARCHITECTURES.rst
new file mode 100644
index 000000000..bae3c6f3a
--- /dev/null
+++ b/Help/prop_tgt/CUDA_ARCHITECTURES.rst
@@ -0,0 +1,40 @@
+CUDA_ARCHITECTURES
+------------------
+
+List of architectures to generate device code for.
+
+An architecture can be suffixed by either ``-real`` or ``-virtual`` to specify
+the kind of architecture to generate code for.
+If no suffix is given then code is generated for both real and virtual
+architectures.
+
+A non-empty false value (e.g. ``OFF``) disables adding architectures.
+This is intended to support packagers and rare cases where full control
+over the passed flags is required.
+
+This property is initialized by the value of the :variable:`CMAKE_CUDA_ARCHITECTURES`
+variable if it is set when a target is created.
+
+The ``CUDA_ARCHITECTURES`` target property must be set to a non-empty value on targets
+that compile CUDA sources, or it is an error. See policy :policy:`CMP0104`.
+
+Examples
+^^^^^^^^
+
+.. code-block:: cmake
+
+ set_property(TARGET tgt PROPERTY CUDA_ARCHITECTURES 35 50 72)
+
+Generates code for real and virtual architectures ``30``, ``50`` and ``72``.
+
+.. code-block:: cmake
+
+ set_property(TARGET tgt PROPERTY CUDA_ARCHITECTURES 70-real 72-virtual)
+
+Generates code for real architecture ``70`` and virtual architecture ``72``.
+
+.. code-block:: cmake
+
+ set_property(TARGET tgt PROPERTY CUDA_ARCHITECTURES OFF)
+
+CMake will not pass any architecture flags to the compiler.
diff --git a/Help/prop_tgt/CUDA_STANDARD.rst b/Help/prop_tgt/CUDA_STANDARD.rst
index a3a2f5689..6d6774e4f 100644
--- a/Help/prop_tgt/CUDA_STANDARD.rst
+++ b/Help/prop_tgt/CUDA_STANDARD.rst
@@ -7,7 +7,7 @@ This property specifies the CUDA/C++ standard whose features are requested
to build this target. For some compilers, this results in adding a
flag such as ``-std=gnu++11`` to the compile line.
-Supported values are ``98``, ``11``, ``14``.
+Supported values are ``98``, ``03``, ``11``, ``14``, ``17``, ``20``.
If the value requested does not result in a compile flag being added for
the compiler in use, a previous standard flag will be added instead. This
diff --git a/Help/prop_tgt/C_STANDARD.rst b/Help/prop_tgt/C_STANDARD.rst
index e7f7904f2..6a051393a 100644
--- a/Help/prop_tgt/C_STANDARD.rst
+++ b/Help/prop_tgt/C_STANDARD.rst
@@ -6,8 +6,8 @@ The C standard whose features are requested to build this target.
This property specifies the C standard whose features are requested
to build this target. For some compilers, this results in adding a
flag such as ``-std=gnu11`` to the compile line. For compilers that
-have no notion of a standard level, such as Microsoft Visual C++ before
-2015 Update 3, this has no effect.
+have no notion of a C standard level, such as all versions of
+MSVC known as of this version of CMake, this has no effect.
Supported values are ``90``, ``99`` and ``11``.
diff --git a/Help/prop_tgt/EXCLUDE_FROM_ALL.rst b/Help/prop_tgt/EXCLUDE_FROM_ALL.rst
index 3aa296d3b..c9ece22de 100644
--- a/Help/prop_tgt/EXCLUDE_FROM_ALL.rst
+++ b/Help/prop_tgt/EXCLUDE_FROM_ALL.rst
@@ -13,9 +13,9 @@ included in the "all" target of its ancestor directories unless the
With ``EXCLUDE_FROM_ALL`` set to false or not set at all, the target
will be brought up to date as part of doing a ``make install`` or its
-equivalent for the CMake generator being used. If a target has
-``EXCLUDE_FROM_ALL`` set to true, then any attempt to install that
-target has undefined behavior. Note that such a target can still safely
-be listed in an :command:`install(TARGETS)` command as long as the install
-components the target belongs to are not part of the set of components
-that anything tries to install.
+equivalent for the CMake generator being used.
+
+If a target has ``EXCLUDE_FROM_ALL`` set to true, it may still be listed
+in an :command:`install(TARGETS)` command, but the user is responsible for
+ensuring that the target's build artifacts are not missing or outdated when
+an install is performed.
diff --git a/Help/prop_tgt/FRAMEWORK_MULTI_CONFIG_POSTFIX_CONFIG.rst b/Help/prop_tgt/FRAMEWORK_MULTI_CONFIG_POSTFIX_CONFIG.rst
new file mode 100644
index 000000000..243c0cd4b
--- /dev/null
+++ b/Help/prop_tgt/FRAMEWORK_MULTI_CONFIG_POSTFIX_CONFIG.rst
@@ -0,0 +1,26 @@
+FRAMEWORK_MULTI_CONFIG_POSTFIX_<CONFIG>
+---------------------------------------
+
+Postfix to append to the framework file name for configuration ``<CONFIG>``,
+when using a multi-config generator (like Xcode and Ninja Multi-Config).
+
+When building with configuration ``<CONFIG>`` the value of this property
+is appended to the framework file name built on disk.
+
+For example, given a framework called ``my_fw``, a value of ``_debug``
+for the ``FRAMEWORK_MULTI_CONFIG_POSTFIX_DEBUG`` property, and
+``Debug;Release`` in :variable:`CMAKE_CONFIGURATION_TYPES`, the following
+relevant files would be created for the ``Debug`` and ``Release``
+configurations:
+
+- ``Release/my_fw.framework/my_fw``
+- ``Release/my_fw.framework/Versions/A/my_fw``
+- ``Debug/my_fw.framework/my_fw_debug``
+- ``Debug/my_fw.framework/Versions/A/my_fw_debug``
+
+For framework targets, this property is initialized by the value of the
+:variable:`CMAKE_FRAMEWORK_MULTI_CONFIG_POSTFIX_<CONFIG>` variable if it
+is set when a target is created.
+
+This property is ignored for non-framework targets, and when using single
+config generators.
diff --git a/Help/prop_tgt/Fortran_PREPROCESS.rst b/Help/prop_tgt/Fortran_PREPROCESS.rst
new file mode 100644
index 000000000..47a15c056
--- /dev/null
+++ b/Help/prop_tgt/Fortran_PREPROCESS.rst
@@ -0,0 +1,23 @@
+Fortran_PREPROCESS
+------------------
+
+Control whether the Fortran source file should be unconditionally
+preprocessed.
+
+If unset or empty, rely on the compiler to determine whether the file
+should be preprocessed. If explicitly set to ``OFF`` then the file does not
+need to be preprocessed. If explicitly set to ``ON``, then the file does
+need to be preprocessed as part of the compilation step.
+
+When using the :generator:`Ninja` generator, all source files are
+first preprocessed in order to generate module dependency
+information. Setting this property to ``OFF`` will make ``Ninja``
+skip this step.
+
+Use the source-specific :prop_sf:`Fortran_PREPROCESS` property if a single
+file needs to be preprocessed. If the variable
+:variable:`CMAKE_Fortran_PREPROCESS` is set when a target is created its
+value is used to initialize this property.
+
+.. note:: For some compilers, ``NAG``, ``PGI`` and ``Solaris Studio``,
+ setting this to ``OFF`` will have no effect.
diff --git a/Help/prop_tgt/IMPORTED_GLOBAL.rst b/Help/prop_tgt/IMPORTED_GLOBAL.rst
index 1feca049d..1a9129fd7 100644
--- a/Help/prop_tgt/IMPORTED_GLOBAL.rst
+++ b/Help/prop_tgt/IMPORTED_GLOBAL.rst
@@ -16,7 +16,15 @@ property for such a locally ``IMPORTED`` target to True promotes that
target to global scope. This promotion can only be done in the same
directory where that ``IMPORTED`` target was created in the first place.
-Once an imported target has been made global, it cannot be changed back to
-non-global. Therefore, if a project sets this property, it may only
-provide a value of True. CMake will issue an error if the project tries to
-set the property to a non-True value, even if the value was already False.
+.. note::
+
+ Once an imported target has been made global, it cannot be changed back to
+ non-global. Therefore, if a project sets this property, it may only
+ provide a value of True. CMake will issue an error if the project tries to
+ set the property to a non-True value, even if the value was already False.
+
+.. note::
+
+ Local :ref:`ALIAS targets <Alias Targets>` created before promoting an
+ :ref:`IMPORTED target <Imported Targets>` from ``LOCAL`` to ``GLOBAL``, keep
+ their initial scope (see :prop_tgt:`ALIAS_GLOBAL` target property).
diff --git a/Help/prop_tgt/INSTALL_RPATH.rst b/Help/prop_tgt/INSTALL_RPATH.rst
index 93b448830..4549b9228 100644
--- a/Help/prop_tgt/INSTALL_RPATH.rst
+++ b/Help/prop_tgt/INSTALL_RPATH.rst
@@ -8,5 +8,9 @@ targets (for platforms that support it). This property is initialized
by the value of the variable :variable:`CMAKE_INSTALL_RPATH` if it is set when
a target is created.
+Because the rpath may contain ``${ORIGIN}``, which coincides with CMake syntax,
+the contents of ``INSTALL_RPATH`` are properly escaped in the
+``cmake_install.cmake`` script (see policy :policy:`CMP0095`.)
+
This property supports
:manual:`generator expressions <cmake-generator-expressions(7)>`.
diff --git a/Help/prop_tgt/LINK_OPTIONS.rst b/Help/prop_tgt/LINK_OPTIONS.rst
index 2a05ea75a..ff3ee87e3 100644
--- a/Help/prop_tgt/LINK_OPTIONS.rst
+++ b/Help/prop_tgt/LINK_OPTIONS.rst
@@ -2,12 +2,16 @@ LINK_OPTIONS
------------
List of options to use for the link step of shared library, module
-and executable targets. Targets that are static libraries need to use
-the :prop_tgt:`STATIC_LIBRARY_OPTIONS` target property.
+and executable targets as well as the device link step. Targets that are static
+libraries need to use the :prop_tgt:`STATIC_LIBRARY_OPTIONS` target property.
+These options are used for both normal linking and device linking
+(see policy :policy:`CMP0105`). To control link options for normal and device
+link steps, ``$<HOST_LINK>`` and ``$<DEVICE_LINK>``
+:manual:`generator expressions <cmake-generator-expressions(7)>` can be used.
-This property holds a :ref:`semicolon-separated list <CMake Language Lists>` of options
-specified so far for its target. Use the :command:`target_link_options`
+This property holds a :ref:`semicolon-separated list <CMake Language Lists>` of
+options specified so far for its target. Use the :command:`target_link_options`
command to append more options.
This property is initialized by the :prop_dir:`LINK_OPTIONS` directory
diff --git a/Help/prop_tgt/PCH_WARN_INVALID.rst b/Help/prop_tgt/PCH_WARN_INVALID.rst
new file mode 100644
index 000000000..96e1abdf8
--- /dev/null
+++ b/Help/prop_tgt/PCH_WARN_INVALID.rst
@@ -0,0 +1,10 @@
+PCH_WARN_INVALID
+----------------
+
+When this property is set to true, the precompile header compiler options
+will contain a compiler flag which should warn about invalid precompiled
+headers e.g. ``-Winvalid-pch`` for GNU compiler.
+
+This property is initialized by the value of the
+:variable:`CMAKE_PCH_WARN_INVALID` variable if it is set when a target is
+created. If that variable is not set, the property defaults to ``ON``.
diff --git a/Help/prop_tgt/UNITY_BUILD.rst b/Help/prop_tgt/UNITY_BUILD.rst
index 479802e59..e14095211 100644
--- a/Help/prop_tgt/UNITY_BUILD.rst
+++ b/Help/prop_tgt/UNITY_BUILD.rst
@@ -5,8 +5,28 @@ When this property is set to true, the target source files will be combined
into batches for faster compilation. This is done by creating a (set of)
unity sources which ``#include`` the original sources, then compiling these
unity sources instead of the originals. This is known as a *Unity* or *Jumbo*
-build. The :prop_tgt:`UNITY_BUILD_BATCH_SIZE` property controls the upper
-limit on how many sources can be combined per unity source file.
+build.
+
+CMake provides different algorithms for selecting which sources are grouped
+together into a *bucket*. Algorithm selection is decided by the
+:prop_tgt:`UNITY_BUILD_MODE` target property, which has the following acceptable
+values:
+
+* ``BATCH``
+ When in this mode CMake determines which files are grouped together.
+ The :prop_tgt:`UNITY_BUILD_BATCH_SIZE` property controls the upper limit on
+ how many sources can be combined per unity source file.
+
+* ``GROUP``
+ When in this mode each target explicitly specifies how to group
+ source files. Each source file that has the same
+ :prop_sf:`UNITY_GROUP` value will be grouped together. Any sources
+ that don't have this property will be compiled individually. The
+ :prop_tgt:`UNITY_BUILD_BATCH_SIZE` property is ignored when using
+ this mode.
+
+If no explicit :prop_tgt:`UNITY_BUILD_MODE` has been specified, CMake will
+default to ``BATCH``.
Unity builds are not currently supported for all languages. CMake version
|release| supports combining ``C`` and ``CXX`` source files. For targets that
diff --git a/Help/prop_tgt/UNITY_BUILD_MODE.rst b/Help/prop_tgt/UNITY_BUILD_MODE.rst
new file mode 100644
index 000000000..1ebab2319
--- /dev/null
+++ b/Help/prop_tgt/UNITY_BUILD_MODE.rst
@@ -0,0 +1,58 @@
+UNITY_BUILD_MODE
+----------------
+
+CMake provides different algorithms for selecting which sources are grouped
+together into a *bucket*. Selection is decided by this property,
+which has the following acceptable values:
+
+``BATCH``
+ When in this mode CMake determines which files are grouped together.
+ The :prop_tgt:`UNITY_BUILD_BATCH_SIZE` property controls the upper limit on
+ how many sources can be combined per unity source file.
+
+ Example usage:
+
+ .. code-block:: cmake
+
+ add_library(example_library
+ source1.cxx
+ source2.cxx
+ source3.cxx
+ source4.cxx)
+
+ set_target_properties(example_library PROPERTIES
+ UNITY_BUILD_MODE BATCH
+ UNITY_BUILD_BATCH_SIZE 2
+ )
+
+``GROUP``
+ When in this mode each target explicitly specifies how to group
+ source files. Each source file that has the same
+ :prop_sf:`UNITY_GROUP` value will be grouped together. Any sources
+ that don't have this property will be compiled individually. The
+ :prop_tgt:`UNITY_BUILD_BATCH_SIZE` property is ignored when using
+ this mode.
+
+ Example usage:
+
+ .. code-block:: cmake
+
+ add_library(example_library
+ source1.cxx
+ source2.cxx
+ source3.cxx
+ source4.cxx)
+
+ set_target_properties(example_library PROPERTIES
+ UNITY_BUILD_MODE GROUP
+ )
+
+ set_source_files_properties(source1.cxx source2.cxx source3.cxx
+ PROPERTIES UNITY_GROUP "bucket1"
+ )
+ set_source_files_properties(source4.cxx
+ PROPERTIES UNITY_GROUP "bucket2"
+ )
+
+If no explicit :prop_tgt:`UNITY_BUILD_MODE` has been specified, CMake will
+default to ``BATCH``.
diff --git a/Help/prop_tgt/VS_PLATFORM_TOOLSET.rst b/Help/prop_tgt/VS_PLATFORM_TOOLSET.rst
new file mode 100644
index 000000000..f8f2e8e79
--- /dev/null
+++ b/Help/prop_tgt/VS_PLATFORM_TOOLSET.rst
@@ -0,0 +1,10 @@
+VS_PLATFORM_TOOLSET
+-------------------
+
+Overrides the platform toolset used to build a target.
+
+Only supported when the compiler used by the given toolset is the
+same as the compiler used to build the whole source tree.
+
+This is especially useful to create driver projects with the toolsets
+"WindowsUserModeDriver10.0" or "WindowsKernelModeDriver10.0".
diff --git a/Help/prop_tgt/VS_SOLUTION_DEPLOY.rst b/Help/prop_tgt/VS_SOLUTION_DEPLOY.rst
new file mode 100644
index 000000000..eef848f99
--- /dev/null
+++ b/Help/prop_tgt/VS_SOLUTION_DEPLOY.rst
@@ -0,0 +1,27 @@
+VS_SOLUTION_DEPLOY
+------------------
+
+Specify that the target should be marked for deployment when not targeting
+Windows CE, Windows Phone or a Windows Store application.
+
+If the target platform doesn't support deployment, this property won't have
+any effect.
+
+:manual:`Generator expressions <cmake-generator-expressions(7)>` are supported.
+
+Examples
+^^^^^^^^
+
+Always deploy target ``foo``:
+
+.. code-block:: cmake
+
+ add_executable(foo SHARED foo.cpp)
+ set_property(TARGET foo PROPERTY VS_SOLUTION_DEPLOY ON)
+
+Deploy target ``foo`` for all configurations except ``Release``:
+
+.. code-block:: cmake
+
+ add_executable(foo SHARED foo.cpp)
+ set_property(TARGET foo PROPERTY VS_SOLUTION_DEPLOY "$<NOT:$<CONFIG:Release>>")
diff --git a/Help/prop_tgt/VS_SOURCE_SETTINGS_tool.rst b/Help/prop_tgt/VS_SOURCE_SETTINGS_tool.rst
new file mode 100644
index 000000000..738a91211
--- /dev/null
+++ b/Help/prop_tgt/VS_SOURCE_SETTINGS_tool.rst
@@ -0,0 +1,19 @@
+VS_SOURCE_SETTINGS_<tool>
+-------------------------
+
+Set any item metadata on all non-built files that use <tool>.
+
+Takes a list of ``Key=Value`` pairs. Tells the Visual Studio generator
+to set ``Key`` to ``Value`` as item metadata on all non-built files
+that use ``<tool>``.
+
+For example:
+
+.. code-block:: cmake
+
+ set_property(TARGET main PROPERTY VS_SOURCE_SETTINGS_FXCompile "Key=Value" "Key2=Value2")
+
+will set ``Key`` to ``Value`` and ``Key2`` to ``Value2`` for all
+non-built files that use ``FXCompile``.
+
+:manual:`Generator expressions <cmake-generator-expressions(7)>` are supported.
diff --git a/Help/release/3.10.rst b/Help/release/3.10.rst
index 03eda362d..117415b2a 100644
--- a/Help/release/3.10.rst
+++ b/Help/release/3.10.rst
@@ -236,7 +236,7 @@ Deprecated and Removed Features
support for C++11 and a port of libuv. See `CMake Issue 17137`_.
Use CMake 3.9 or lower instead for HP-UX support.
-.. _`CMake Issue 17137`: https://gitlab.kitware.com/cmake/cmake/issues/17137
+.. _`CMake Issue 17137`: https://gitlab.kitware.com/cmake/cmake/-/issues/17137
Other Changes
=============
diff --git a/Help/release/3.16.rst b/Help/release/3.16.rst
index 84d96cdc8..f3fdb08d2 100644
--- a/Help/release/3.16.rst
+++ b/Help/release/3.16.rst
@@ -178,15 +178,17 @@ Modules
Autogen
-------
-* When using :prop_tgt:`AUTOMOC`, the new :variable:`CMAKE_AUTOMOC_PATH_PREFIX`
- variable or :prop_tgt:`AUTOMOC_PATH_PREFIX` target property may be enabled
- to generate the ``-p`` path prefix
+* When using :prop_tgt:`AUTOMOC`, CMake now generates the ``-p`` path prefix
option for ``moc``. This ensures that ``moc`` output files are identical
on different build setups (given, that the headers compiled by ``moc`` are
in an :command:`include directory <target_include_directories>`).
Also it ensures that ``moc`` output files will compile correctly when the
source and/or build directory is a symbolic link.
+ The ``moc`` path prefix generation behavior can be configured by setting
+ the new :variable:`CMAKE_AUTOMOC_PATH_PREFIX` variable and/or
+ :prop_tgt:`AUTOMOC_PATH_PREFIX` target property.
+
CTest
-----
@@ -314,11 +316,3 @@ Changes made since CMake 3.16.0 include the following.
:prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` target properties.
Previously they would be places in ``*_CFLAGS_OTHER`` variables and
:prop_tgt:`INTERFACE_COMPILE_OPTIONS` target properties.
-
-3.16.9
-------
-
-* The default value of :variable:`CMAKE_AUTOMOC_PATH_PREFIX` was changed to
- ``OFF`` because this feature can break existing projects that have
- identically named header files in different include directories.
- This restores compatibility with behavior of CMake 3.15 and below.
diff --git a/Help/release/3.17.rst b/Help/release/3.17.rst
index abd746314..b7c66d85a 100644
--- a/Help/release/3.17.rst
+++ b/Help/release/3.17.rst
@@ -346,12 +346,3 @@ Changes made since CMake 3.17.0 include the following.
:prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` target properties.
Previously they would be places in ``*_CFLAGS_OTHER`` variables and
:prop_tgt:`INTERFACE_COMPILE_OPTIONS` target properties.
-
-3.17.5
-------
-
-* The default value of :variable:`CMAKE_AUTOMOC_PATH_PREFIX` was changed to
- ``OFF`` because this feature can break existing projects that have
- identically named header files in different include directories.
- This restores compatibility with behavior of CMake 3.15 and below.
- The default was also changed to ``OFF`` in 3.16.9.
diff --git a/Help/release/3.18.rst b/Help/release/3.18.rst
new file mode 100644
index 000000000..386b61b17
--- /dev/null
+++ b/Help/release/3.18.rst
@@ -0,0 +1,320 @@
+CMake 3.18 Release Notes
+************************
+
+.. only:: html
+
+ .. contents::
+
+Changes made since CMake 3.17 include the following.
+
+New Features
+============
+
+Languages
+---------
+
+* The ``CUDA`` language can now be compiled using Clang on non-Windows
+ platforms. Separable compilation is not yet supported on any platform.
+
+Command-Line
+------------
+
+* :manual:`cmake(1)` gained support for profiling of CMake scripts through
+ the parameters ``--profiling-output`` and ``--profiling-format``.
+
+* :manual:`cmake(1)` gained a ``cat`` command line
+ option that can be used to concatenate files and print them
+ on standard output.
+
+Commands
+--------
+
+* The :command:`add_library` and :command:`add_executable` commands
+ learned to create :ref:`Alias Targets` referencing non-``GLOBAL``
+ :ref:`Imported Targets`.
+
+* The :command:`cmake_language()` command was added for meta-operations on
+ scripted or built-in commands, starting with a mode to ``CALL`` other
+ commands, and ``EVAL CODE`` to inplace evaluate a CMake script.
+
+* The :command:`execute_process` command gained the ``ECHO_OUTPUT_VARIABLE``
+ and ``ECHO_ERROR_VARIABLE`` options.
+
+* The :command:`export` command now raise an error if used multiple times with
+ same ``FILE`` without ``APPEND``. See policy :policy:`CMP0103`.
+
+* The :command:`file` command gained the ``ARCHIVE_CREATE`` and
+ ``ARCHIVE_EXTRACT`` subcommands to expose the :manual:`cmake(1)` ``-E tar``
+ functionality to CMake scripting code.
+
+* The :command:`file(CONFIGURE)` subcommand was created in order to replicate
+ the :command:`configure_file` functionality without resorting to a
+ pre-existing file on disk as input. The content is instead passed as a
+ string.
+
+* The :command:`file(UPLOAD)` command gained ``TLS_VERIFY`` and ``TLS_CAINFO``
+ options to control server certificate verification.
+
+* The :command:`find_program`, :command:`find_library`, :command:`find_path`
+ and :command:`find_file` commands gained a new ``REQUIRED`` option that will
+ stop processing with an error message if nothing is found.
+
+* The :command:`get_property` command with ``SOURCE`` scope gained the
+ ``DIRECTORY`` and ``TARGET_DIRECTORY`` options to get a property
+ from the provided directory scope.
+
+* The :command:`get_source_file_property` command gained the ``DIRECTORY``
+ and ``TARGET_DIRECTORY`` options to get a property from the
+ provided directory scope.
+
+* The :command:`list` operation ``SORT`` gained the ``NATURAL`` sort
+ option to sort using natural order (see ``strverscmp(3)`` manual).
+
+* The :command:`set_property` command with the ``SOURCE`` scope gained the
+ ``DIRECTORY`` and ``TARGET_DIRECTORY`` options to set properties
+ in the provided directory scopes.
+
+* The :command:`set_source_files_properties` command gained the ``DIRECTORY``
+ and ``TARGET_DIRECTORY`` options to set properties in the provided
+ directory scopes.
+
+* The :command:`string` command learned a new ``HEX`` sub-command, which
+ converts strings into their hexadecimal representation.
+
+Variables
+---------
+
+* A :variable:`CMAKE_CUDA_ARCHITECTURES` variable was added to specify
+ CUDA output architectures. Users are encouraged to use this instead of
+ specifying options manually, as this approach is compiler-agnostic.
+ The variable is initialized automatically when
+ :variable:`CMAKE_CUDA_COMPILER_ID <CMAKE_<LANG>_COMPILER_ID>` is ``NVIDIA``.
+ The variable is used to initialize the new :prop_tgt:`CUDA_ARCHITECTURES`
+ target property. See policy :policy:`CMP0104`.
+
+* The :variable:`CMAKE_PCH_WARN_INVALID` variable was added to initialize the
+ :prop_tgt:`PCH_WARN_INVALID` target property to allow the removal of the
+ precompiled header invalid warning.
+
+Properties
+----------
+
+* The :prop_tgt:`CUDA_ARCHITECTURES` target property was added to specify
+ CUDA output architectures. Users are encouraged to use this instead of
+ specifying options manually, as this approach is compiler-agnostic.
+ The property is initialized by the new :variable:`CMAKE_CUDA_ARCHITECTURES`
+ variable. See policy :policy:`CMP0104`.
+
+* The :prop_tgt:`Fortran_PREPROCESS` target property and
+ :prop_sf:`Fortran_PREPROCESS` source-file property were added to
+ control preprocessing of Fortran source files.
+
+* The :prop_tgt:`FRAMEWORK_MULTI_CONFIG_POSTFIX_<CONFIG>` target property
+ and associated :variable:`CMAKE_FRAMEWORK_MULTI_CONFIG_POSTFIX_<CONFIG>`
+ variable were created to allow adding a postfix to the name of a
+ framework file name when using a multi-config generator.
+
+* The :prop_sf:`OBJECT_OUTPUTS` source file property now supports
+ :manual:`generator expressions <cmake-generator-expressions(7)>`.
+
+* The :prop_tgt:`PCH_WARN_INVALID` target property was added to allow the
+ removal of the precompiled header invalid warning.
+
+* The :prop_tgt:`UNITY_BUILD_MODE` target property was added to tell
+ generators which algorithm to use for grouping included source
+ files.
+
+* The :prop_tgt:`VS_SOURCE_SETTINGS_<tool>` target property was added
+ to tell :ref:`Visual Studio Generators` for VS 2010 and above to add
+ metadata to non-built source files using ``<tool>``.
+
+* The :prop_sf:`VS_SETTINGS` source file property was added to tell
+ :ref:`Visual Studio Generators` for VS 2010 and above to add
+ metadata to a non-built source file.
+
+* The :prop_tgt:`VS_PLATFORM_TOOLSET` target property was added to tell
+ :ref:`Visual Studio Generators` for VS 2010 and above to override
+ the platform toolset.
+
+* The :prop_tgt:`VS_SOLUTION_DEPLOY` target property was added to tell
+ :ref:`Visual Studio Generators` for VS 2010 and above to mark a
+ target for deployment even when not building for Windows Phone/Store/CE.
+
+Modules
+-------
+
+* The :module:`CheckLinkerFlag` module has been added to provide a
+ facility to check validity of link flags.
+
+* The :module:`ExternalProject` module :command:`ExternalProject_Add` command
+ gained a new ``GIT_REMOTE_UPDATE_STRATEGY`` keyword. This can be used to
+ specify how failed rebase operations during a git update should be handled.
+ The ``CMAKE_EP_GIT_REMOTE_UPDATE_STRATEGY`` variable was also added as a
+ global default and is honored by both the :module:`ExternalProject` and
+ :module:`FetchContent` modules.
+
+* The :module:`FetchContent` module :command:`FetchContent_Declare` command
+ now supports a ``SOURCE_SUBDIR`` option. It can be used to direct
+ :command:`FetchContent_MakeAvailable` to look in a different location
+ for the ``CMakeLists.txt`` file.
+
+* The :module:`FindBLAS` module now provides an imported target.
+
+* The :module:`FindCUDAToolkit` module:
+
+ * gained the variable
+ ``CUDAToolkit_LIBRARY_ROOT``, which is the directory containing the
+ ``nvvm`` directory and ``version.txt``.
+
+ * uses toolkit and library root found during ``CUDA`` compiler detection.
+
+* The :module:`FindLAPACK` module now provides an imported target.
+
+* The :module:`FindPython3`, :module:`FindPython2` and :module:`FindPython`
+ modules:
+
+ * gained the possibility to create per-artifact cache variables for
+ interactive editing in :manual:`cmake-gui(1)` and :manual:`ccmake(1)`.
+
+ * gained sub-components ``Development.Module`` and
+ ``Development.Embed`` under the ``Development`` component.
+
+ * gained the capability to specify which Python implementations to find,
+ including ``IronPython`` and ``PyPy``.
+
+* The :module:`FindRuby` module input and output variables were all renamed
+ from ``RUBY_`` to ``Ruby_`` for consistency with other find modules.
+ Input variables of the old case will be honored if provided, and output
+ variables of the old case are always provided.
+
+* The :module:`FindSWIG` module now accepts target languages as ``COMPONENTS``
+ and ``OPTIONAL_COMPONENTS`` arguments to ``find_package``.
+
+* The :module:`GoogleTest` module :command:`gtest_discover_tests` command:
+
+ * gained a new ``DISCOVERY_MODE`` option to control when the test
+ discovery step is run. It offers a new ``PRE_TEST`` setting to
+ run the discovery at test time instead of build time. A new
+ ``CMAKE_GTEST_DISCOVER_TESTS_DISCOVERY_MODE`` variable can be used
+ to change the default globally.
+
+ * gained a new optional parameter ``XML_OUTPUT_DIR``. When set the
+ JUnit XML test results are stored in that directory.
+
+* The :module:`FindLibXslt` module now provides imported targets.
+
+* The :module:`UseSWIG` module now supports Fortran as a target language if
+ the ``SWIG_EXECUTABLE`` is SWIG-Fortran_.
+
+.. _`SWIG-Fortran`: https://github.com/swig-fortran/swig
+
+Generator Expressions
+---------------------
+
+* The ``$<DEVICE_LINK:...>`` and ``$<HOST_LINK:...>``
+ :manual:`generator expressions <cmake-generator-expressions(7)>` were added
+ to manage device and host link steps.
+
+* The ``$<LINK_LANGUAGE:...>`` and ``$<LINK_LANG_AND_ID:...>``
+ :manual:`generator expressions <cmake-generator-expressions(7)>` were added.
+
+CTest
+-----
+
+* :manual:`ctest(1)` gained a new :variable:`CTEST_RESOURCE_SPEC_FILE`
+ variable, which can be used to specify a
+ :ref:`resource specification file <ctest-resource-specification-file>`.
+
+* :manual:`ctest(1)` gained a ``--stop-on-failure`` option,
+ which can be used to stop running the tests once one has failed.
+
+* The :command:`ctest_test` command gained a ``STOP_ON_FAILURE`` option
+ which can be used to stop running the tests once one has failed.
+
+* The :module:`CTestCoverageCollectGCOV` module
+ :command:`ctest_coverage_collect_gcov` command gained a
+ ``TARBALL_COMPRESSION`` option to control compression of the
+ tarball of collected results.
+
+CPack
+-----
+
+* The :cpack_gen:`CPack Archive Generator`'s ``TXZ`` format learned the
+ :variable:`CPACK_ARCHIVE_THREADS` variable to enable parallel compression.
+ Requires support in the ``liblzma`` used by CMake.
+
+* The :cpack_gen:`CPack NSIS Generator` gained a new variable
+ :variable:`CPACK_NSIS_MANIFEST_DPI_AWARE` to declare that the
+ installer is DPI-aware.
+
+* The :cpack_gen:`CPack RPM Generator` gained
+ :variable:`CPACK_RPM_PRE_TRANS_SCRIPT_FILE` and
+ :variable:`CPACK_RPM_POST_TRANS_SCRIPT_FILE`
+ variables to specify pre- and post-transaction scripts.
+
+Other
+-----
+
+* :manual:`cmake-gui(1)` now populates its generator selection
+ widget default value from the :envvar:`CMAKE_GENERATOR` environment
+ variable. Additionally, environment variables
+ :envvar:`CMAKE_GENERATOR_PLATFORM` and :envvar:`CMAKE_GENERATOR_TOOLSET`
+ are used to populate their respective widget defaults.
+
+* :manual:`ccmake(1)` learned to read a :envvar:`CCMAKE_COLORS`
+ environment variable to customize colors.
+
+Deprecated and Removed Features
+===============================
+
+* The :module:`Documentation` module has been deprecated via
+ :policy:`CMP0106`. This module was essentially VTK code that CMake should
+ not be shipping anymore.
+
+* An explicit deprecation diagnostic was added for policy ``CMP0070``
+ and policy ``CMP0071`` (``CMP0069`` and below were already deprecated).
+ The :manual:`cmake-policies(7)` manual explains that the OLD behaviors
+ of all policies are deprecated and that projects should port to the
+ NEW behaviors.
+
+Other Changes
+=============
+
+* On Windows, the :generator:`Ninja` and :generator:`Ninja Multi-Config`
+ generators, when a compiler is not explicitly specified, now select
+ the first compiler (of any name) found in directories listed by the
+ ``PATH`` environment variable.
+
+* The :prop_tgt:`LINK_OPTIONS` and :prop_tgt:`INTERFACE_LINK_OPTIONS` target
+ properties are now used for the device link step.
+ See policy :policy:`CMP0105`.
+
+* Creation of an ``ALIAS`` target overwriting an existing target now raises an
+ error. See policy :policy:`CMP0107`.
+
+* Linking a target to itself through an alias now raises an error.
+ See policy :policy:`CMP0108`.
+
+* The :module:`FindPackageHandleStandardArgs` module option ``REQUIRED_VARS``
+ is now optional if ``HANDLE_COMPONENTS`` is specified.
+
+* The :command:`source_group` command now also recognizes forward slashes
+ as subgroup delimiters, not just backslashes.
+
+* :manual:`ctest(1)` now logs environment variables that it sets for each test,
+ either due to the :prop_test:`ENVIRONMENT` property or the
+ :ref:`resource allocation <ctest-resource-allocation>` feature, and submits
+ this log to CDash. It does not log environment variables that were set
+ outside of CTest.
+
+* When building CMake itself from source and not using a system-provided
+ libcurl, HTTP/2 support is now enabled for commands supporting
+ network communication via ``http(s)``, such as :command:`file(DOWNLOAD)`,
+ :command:`file(UPLOAD)`, and :command:`ctest_submit`.
+ The precompiled binaries provided on ``cmake.org`` now support HTTP/2.
+
+* The :manual:`cmake-file-api(7)` "codemodel" version 2 ``version`` field has
+ been updated to 2.1.
+
+* The :manual:`cmake-file-api(7)` "codemodel" version 2 "target" object gained
+ a new ``precompileHeaders`` field in the ``compileGroups`` objects.
diff --git a/Help/release/index.rst b/Help/release/index.rst
index 5d1f8a2bc..4578b3a64 100644
--- a/Help/release/index.rst
+++ b/Help/release/index.rst
@@ -13,6 +13,7 @@ Releases
.. toctree::
:maxdepth: 1
+ 3.18 <3.18>
3.17 <3.17>
3.16 <3.16>
3.15 <3.15>
diff --git a/Help/variable/CMAKE_AUTOMOC_PATH_PREFIX.rst b/Help/variable/CMAKE_AUTOMOC_PATH_PREFIX.rst
index 1e9790fde..dca0b0657 100644
--- a/Help/variable/CMAKE_AUTOMOC_PATH_PREFIX.rst
+++ b/Help/variable/CMAKE_AUTOMOC_PATH_PREFIX.rst
@@ -8,4 +8,4 @@ This variable is used to initialize the :prop_tgt:`AUTOMOC_PATH_PREFIX`
property on all the targets. See that target property for additional
information.
-The default value is ``OFF``.
+The default value is ``ON``.
diff --git a/Help/variable/CMAKE_CUDA_ARCHITECTURES.rst b/Help/variable/CMAKE_CUDA_ARCHITECTURES.rst
new file mode 100644
index 000000000..149bffad6
--- /dev/null
+++ b/Help/variable/CMAKE_CUDA_ARCHITECTURES.rst
@@ -0,0 +1,17 @@
+CMAKE_CUDA_ARCHITECTURES
+------------------------
+
+Default value for :prop_tgt:`CUDA_ARCHITECTURES` property of targets.
+
+This is initialized as follows depending on :variable:`CMAKE_CUDA_COMPILER_ID <CMAKE_<LANG>_COMPILER_ID>`:
+
+- For ``Clang``: the oldest architecture that works.
+
+- For ``NVIDIA``: the default architecture chosen by the compiler.
+ See policy :policy:`CMP0104`.
+
+Users are encouraged to override this, as the default varies across compilers
+and compiler versions.
+
+This variable is used to initialize the :prop_tgt:`CUDA_ARCHITECTURES` property
+on all targets. See the target property for additional information.
diff --git a/Help/variable/CMAKE_FRAMEWORK_MULTI_CONFIG_POSTFIX_CONFIG.rst b/Help/variable/CMAKE_FRAMEWORK_MULTI_CONFIG_POSTFIX_CONFIG.rst
new file mode 100644
index 000000000..5c7cd2373
--- /dev/null
+++ b/Help/variable/CMAKE_FRAMEWORK_MULTI_CONFIG_POSTFIX_CONFIG.rst
@@ -0,0 +1,8 @@
+CMAKE_FRAMEWORK_MULTI_CONFIG_POSTFIX_<CONFIG>
+---------------------------------------------
+
+Default framework filename postfix under configuration ``<CONFIG>`` when
+using a multi-config generator.
+
+When a framework target is created its :prop_tgt:`FRAMEWORK_MULTI_CONFIG_POSTFIX_<CONFIG>`
+target property is initialized with the value of this variable if it is set.
diff --git a/Help/variable/CMAKE_Fortran_PREPROCESS.rst b/Help/variable/CMAKE_Fortran_PREPROCESS.rst
new file mode 100644
index 000000000..74b2d8be0
--- /dev/null
+++ b/Help/variable/CMAKE_Fortran_PREPROCESS.rst
@@ -0,0 +1,8 @@
+CMAKE_Fortran_PREPROCESS
+------------------------
+
+Default value for :prop_tgt:`Fortran_PREPROCESS` of targets.
+
+This variable is used to initialize the :prop_tgt:`Fortran_PREPROCESS`
+property on all the targets. See that target property for additional
+information.
diff --git a/Help/variable/CMAKE_LANG_FLAGS_INIT.rst b/Help/variable/CMAKE_LANG_FLAGS_INIT.rst
index a88d1229e..4a034e84c 100644
--- a/Help/variable/CMAKE_LANG_FLAGS_INIT.rst
+++ b/Help/variable/CMAKE_LANG_FLAGS_INIT.rst
@@ -5,7 +5,11 @@ Value used to initialize the :variable:`CMAKE_<LANG>_FLAGS` cache entry
the first time a build tree is configured for language ``<LANG>``.
This variable is meant to be set by a :variable:`toolchain file
<CMAKE_TOOLCHAIN_FILE>`. CMake may prepend or append content to
-the value based on the environment and target platform.
+the value based on the environment and target platform. For example,
+the contents of a ``xxxFLAGS`` environment variable will be prepended,
+where ``xxx`` will be language-specific but not necessarily the same as
+``<LANG>`` (e.g. :envvar:`CXXFLAGS` for ``CXX``, :envvar:`FFLAGS` for
+``Fortran``, and so on).
See also the configuration-specific
:variable:`CMAKE_<LANG>_FLAGS_<CONFIG>_INIT` variable.
diff --git a/Help/variable/CMAKE_PCH_WARN_INVALID.rst b/Help/variable/CMAKE_PCH_WARN_INVALID.rst
new file mode 100644
index 000000000..e152abd9d
--- /dev/null
+++ b/Help/variable/CMAKE_PCH_WARN_INVALID.rst
@@ -0,0 +1,5 @@
+CMAKE_PCH_WARN_INVALID
+----------------------
+
+This variable is used to initialize the :prop_tgt:`PCH_WARN_INVALID`
+property of targets when they are created.
diff --git a/Help/variable/CMAKE_SYSTEM_PREFIX_PATH.rst b/Help/variable/CMAKE_SYSTEM_PREFIX_PATH.rst
index 87a9d06a8..81a7a0bc0 100644
--- a/Help/variable/CMAKE_SYSTEM_PREFIX_PATH.rst
+++ b/Help/variable/CMAKE_SYSTEM_PREFIX_PATH.rst
@@ -8,11 +8,43 @@ CMAKE_SYSTEM_PREFIX_PATH
subdirectories (like ``bin``, ``lib``, or ``include``) as specified in its own
documentation.
-By default this contains the standard directories for the current system, the
+By default this contains the system directories for the current system, the
:variable:`CMAKE_INSTALL_PREFIX`, and the :variable:`CMAKE_STAGING_PREFIX`.
The installation and staging prefixes may be excluded by setting
the :variable:`CMAKE_FIND_NO_INSTALL_PREFIX` variable.
+The system directories that are contained in ``CMAKE_SYSTEM_PREFIX_PATH`` are
+locations that typically include installed software. An example being
+``/usr/local`` for UNIX based platforms. In addition to standard platform
+locations, CMake will also add values to ``CMAKE_SYSTEM_PREFIX_PATH`` based on
+environment variables. The environment variables and search locations that
+CMake uses may evolve over time, as platforms and their conventions also
+evolve. The following provides an indicative list of environment variables
+and locations that CMake searches, but they are subject to change:
+
+
+CrayLinuxEnvironment:
+ * ``ENV{SYSROOT_DIR}/``
+ * ``ENV{SYSROOT_DIR}/usr``
+ * ``ENV{SYSROOT_DIR}/usr/local``
+
+Darwin:
+ * ``ENV{SDKROOT}/usr`` When ``CMAKE_OSX_SYSROOT`` is not explicitly specified.
+
+OpenBSD:
+ * ``ENV{LOCALBASE}``
+
+Unix:
+ * ``ENV{CONDA_PREFIX}`` when using a conda compiler
+
+Windows:
+ * ``ENV{ProgramW6432}``
+ * ``ENV{ProgramFiles}``
+ * ``ENV{ProgramFiles(x86)}``
+ * ``ENV{SystemDrive}/Program Files``
+ * ``ENV{SystemDrive}/Program Files (x86)``
+
+
``CMAKE_SYSTEM_PREFIX_PATH`` is *not* intended to be modified by the project;
use :variable:`CMAKE_PREFIX_PATH` for this.
diff --git a/Help/variable/CTEST_NIGHTLY_START_TIME.rst b/Help/variable/CTEST_NIGHTLY_START_TIME.rst
index bc802764e..90841f906 100644
--- a/Help/variable/CTEST_NIGHTLY_START_TIME.rst
+++ b/Help/variable/CTEST_NIGHTLY_START_TIME.rst
@@ -1,5 +1,9 @@
CTEST_NIGHTLY_START_TIME
------------------------
-Specify the CTest ``NightlyStartTime`` setting
-in a :manual:`ctest(1)` dashboard client script.
+Specify the CTest ``NightlyStartTime`` setting in a :manual:`ctest(1)`
+dashboard client script.
+
+Note that this variable must always be set for a nightly build in a
+dashboard script. It is needed so that nightly builds can be properly grouped
+together in CDash.
diff --git a/Help/variable/CTEST_RESOURCE_SPEC_FILE.rst b/Help/variable/CTEST_RESOURCE_SPEC_FILE.rst
new file mode 100644
index 000000000..a6fdbc9ef
--- /dev/null
+++ b/Help/variable/CTEST_RESOURCE_SPEC_FILE.rst
@@ -0,0 +1,10 @@
+CTEST_RESOURCE_SPEC_FILE
+------------------------
+
+Specify the CTest ``ResourceSpecFile`` setting in a :manual:`ctest(1)`
+dashboard client script.
+
+This can also be used to specify the resource spec file from a CMake build. If
+no ``RESOURCE_SPEC_FILE`` is passed to :command:`ctest_test`, and
+``CTEST_RESOURCE_SPEC_FILE`` is not specified in the dashboard script, the
+value of this variable from the build is used.
diff --git a/Help/variable/PROJECT_SOURCE_DIR.rst b/Help/variable/PROJECT_SOURCE_DIR.rst
index 27f2838ee..b4601c2c4 100644
--- a/Help/variable/PROJECT_SOURCE_DIR.rst
+++ b/Help/variable/PROJECT_SOURCE_DIR.rst
@@ -1,6 +1,8 @@
PROJECT_SOURCE_DIR
------------------
-Top level source directory for the current project.
-
-This is the source directory of the most recent :command:`project` command.
+This is the source directory of the last call to the
+:command:`project` command made in the current directory scope or one
+of its parents. Note, it is not affected by calls to
+:command:`project` made within a child directory scope (i.e. from
+within a call to :command:`add_subdirectory` from the current scope).