summaryrefslogtreecommitdiff
path: root/Help
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2021-10-08 09:20:44 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2021-10-08 09:20:44 +0900
commit99a800848c2512f7c93504fc7b28e6182a6ceb93 (patch)
tree0236502664965e5284d0c950ed2c1bf294b1233b /Help
parentdf4ed7977a77409f899f6f05389960f6b73125a8 (diff)
downloadcmake-99a800848c2512f7c93504fc7b28e6182a6ceb93.tar.gz
cmake-99a800848c2512f7c93504fc7b28e6182a6ceb93.tar.bz2
cmake-99a800848c2512f7c93504fc7b28e6182a6ceb93.zip
Imported Upstream version 3.20.0upstream/3.20.0
Diffstat (limited to 'Help')
-rw-r--r--Help/command/DEVICE_LINK_OPTIONS.txt21
-rw-r--r--Help/command/FIND_XXX.txt42
-rw-r--r--Help/command/OPTIONS_SHELL.txt14
-rw-r--r--Help/command/add_custom_command.rst164
-rw-r--r--Help/command/add_custom_target.rst47
-rw-r--r--Help/command/add_dependencies.rst3
-rw-r--r--Help/command/add_executable.rst30
-rw-r--r--Help/command/add_library.rst70
-rw-r--r--Help/command/add_test.rst7
-rw-r--r--Help/command/cmake_host_system_information.rst8
-rw-r--r--Help/command/cmake_minimum_required.rst3
-rw-r--r--Help/command/cmake_parse_arguments.rst38
-rw-r--r--Help/command/cmake_path.rst784
-rw-r--r--Help/command/cmake_policy.rst3
-rw-r--r--Help/command/configure_file.rst37
-rw-r--r--Help/command/ctest_build.rst9
-rw-r--r--Help/command/ctest_configure.rst4
-rw-r--r--Help/command/ctest_coverage.rst4
-rw-r--r--Help/command/ctest_memcheck.rst2
-rw-r--r--Help/command/ctest_start.rst9
-rw-r--r--Help/command/ctest_submit.rst32
-rw-r--r--Help/command/ctest_test.rst18
-rw-r--r--Help/command/ctest_update.rst4
-rw-r--r--Help/command/ctest_upload.rst4
-rw-r--r--Help/command/enable_language.rst9
-rw-r--r--Help/command/execute_process.rst25
-rw-r--r--Help/command/export.rst17
-rw-r--r--Help/command/file.rst183
-rw-r--r--Help/command/find_package.rst23
-rw-r--r--Help/command/foreach.rst2
-rw-r--r--Help/command/function.rst5
-rw-r--r--Help/command/get_directory_property.rst6
-rw-r--r--Help/command/get_filename_component.rst16
-rw-r--r--Help/command/get_property.rst41
-rw-r--r--Help/command/get_source_file_property.rst29
-rw-r--r--Help/command/if.rst173
-rw-r--r--Help/command/include_external_msproject.rst7
-rw-r--r--Help/command/install.rst110
-rw-r--r--Help/command/link_directories.rst30
-rw-r--r--Help/command/list.rst21
-rw-r--r--Help/command/macro.rst5
-rw-r--r--Help/command/mark_as_advanced.rst8
-rw-r--r--Help/command/math.rst23
-rw-r--r--Help/command/message.rst47
-rw-r--r--Help/command/project.rst29
-rw-r--r--Help/command/separate_arguments.rst4
-rw-r--r--Help/command/set_property.rst46
-rw-r--r--Help/command/set_source_files_properties.rst12
-rw-r--r--Help/command/site_name.rst4
-rw-r--r--Help/command/source_group.rst7
-rw-r--r--Help/command/string.rst58
-rw-r--r--Help/command/target_compile_definitions.rst13
-rw-r--r--Help/command/target_compile_features.rst4
-rw-r--r--Help/command/target_compile_options.rst4
-rw-r--r--Help/command/target_include_directories.rst10
-rw-r--r--Help/command/target_link_libraries.rst20
-rw-r--r--Help/command/target_link_options.rst4
-rw-r--r--Help/command/target_precompile_headers.rst4
-rw-r--r--Help/command/target_sources.rst30
-rw-r--r--Help/command/try_compile.rst120
-rw-r--r--Help/command/try_run.rst20
-rw-r--r--Help/cpack_gen/archive.rst13
-rw-r--r--Help/cpack_gen/bundle.rst10
-rw-r--r--Help/cpack_gen/cygwin.rst4
-rw-r--r--Help/cpack_gen/deb.rst135
-rw-r--r--Help/cpack_gen/dmg.rst13
-rw-r--r--Help/cpack_gen/external.rst4
-rw-r--r--Help/cpack_gen/freebsd.rst8
-rw-r--r--Help/cpack_gen/ifw.rst82
-rw-r--r--Help/cpack_gen/nsis.rst36
-rw-r--r--Help/cpack_gen/nuget.rst78
-rw-r--r--Help/cpack_gen/packagemaker.rst8
-rw-r--r--Help/cpack_gen/productbuild.rst20
-rw-r--r--Help/cpack_gen/rpm.rst86
-rw-r--r--Help/cpack_gen/wix.rst40
-rw-r--r--Help/dev/README.rst2
-rw-r--r--Help/dev/documentation.rst30
-rw-r--r--Help/dev/experimental.rst70
-rw-r--r--Help/dev/maint.rst10
-rw-r--r--Help/envvar/CUDAARCHS.rst13
-rw-r--r--Help/envvar/CUDAHOSTCXX.rst7
-rw-r--r--Help/generator/CodeBlocks.rst11
-rw-r--r--Help/generator/CodeLite.rst8
-rw-r--r--Help/generator/Green Hills MULTI.rst43
-rw-r--r--Help/generator/NMake Makefiles JOM.rst3
-rw-r--r--Help/generator/Ninja Multi-Config.rst75
-rw-r--r--Help/generator/Ninja.rst45
-rw-r--r--Help/generator/VS_TOOLSET_HOST_ARCH.txt18
-rw-r--r--Help/generator/Visual Studio 10 2010.rst15
-rw-r--r--Help/generator/Visual Studio 11 2012.rst19
-rw-r--r--Help/generator/Visual Studio 12 2013.rst15
-rw-r--r--Help/generator/Visual Studio 14 2015.rst2
-rw-r--r--Help/generator/Visual Studio 15 2017.rst26
-rw-r--r--Help/generator/Visual Studio 9 2008.rst19
-rw-r--r--Help/generator/Xcode.rst15
-rw-r--r--Help/guide/ide-integration/index.rst4
-rw-r--r--Help/guide/importing-exporting/MathFunctions/CMakeLists.txt6
-rw-r--r--Help/guide/importing-exporting/MathFunctionsComponents/Addition/CMakeLists.txt2
-rw-r--r--Help/guide/importing-exporting/MathFunctionsComponents/CMakeLists.txt4
-rw-r--r--Help/guide/importing-exporting/MathFunctionsComponents/SquareRoot/CMakeLists.txt2
-rw-r--r--Help/guide/tutorial/index.rst69
-rw-r--r--Help/guide/user-interaction/index.rst2
-rw-r--r--Help/manual/cmake-commands.7.rst1
-rw-r--r--Help/manual/cmake-compile-features.7.rst4
-rw-r--r--Help/manual/cmake-developer.7.rst136
-rw-r--r--Help/manual/cmake-env-variables.7.rst1
-rw-r--r--Help/manual/cmake-file-api.7.rst157
-rw-r--r--Help/manual/cmake-generator-expressions.7.rst399
-rw-r--r--Help/manual/cmake-modules.7.rst10
-rw-r--r--Help/manual/cmake-policies.7.rst13
-rw-r--r--Help/manual/cmake-presets.7.rst952
-rw-r--r--Help/manual/cmake-properties.7.rst6
-rw-r--r--Help/manual/cmake-qt.7.rst7
-rw-r--r--Help/manual/cmake-server.7.rst741
-rw-r--r--Help/manual/cmake-toolchains.7.rst8
-rw-r--r--Help/manual/cmake-variables.7.rst6
-rw-r--r--Help/manual/cmake.1.rst25
-rw-r--r--Help/manual/ctest.1.rst15
-rw-r--r--Help/manual/presets/example.json18
-rw-r--r--Help/manual/presets/schema.json485
-rw-r--r--Help/module/UseJavaClassFilelist.rst7
-rw-r--r--Help/module/UseJavaSymlinks.rst7
-rw-r--r--Help/policy/CMP0026.rst4
-rw-r--r--Help/policy/CMP0051.rst2
-rw-r--r--Help/policy/CMP0115.rst34
-rw-r--r--Help/policy/CMP0116.rst41
-rw-r--r--Help/policy/CMP0117.rst43
-rw-r--r--Help/policy/CMP0118.rst25
-rw-r--r--Help/policy/CMP0119.rst36
-rw-r--r--Help/policy/CMP0120.rst47
-rw-r--r--Help/prop_gbl/CMAKE_CUDA_KNOWN_FEATURES.rst3
-rw-r--r--Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst2
-rw-r--r--Help/prop_sf/GENERATED.rst11
-rw-r--r--Help/prop_sf/LANGUAGE.rst8
-rw-r--r--Help/prop_tgt/ARCHIVE_OUTPUT_DIRECTORY.rst2
-rw-r--r--Help/prop_tgt/AUTOMOC.rst3
-rw-r--r--Help/prop_tgt/CUDA_STANDARD.rst2
-rw-r--r--Help/prop_tgt/CXX_STANDARD.rst2
-rw-r--r--Help/prop_tgt/EXPORT_COMPILE_COMMANDS.rst9
-rw-r--r--Help/prop_tgt/IMPORTED_OBJECTS.rst86
-rw-r--r--Help/prop_tgt/IMPORTED_OBJECTS_CONFIG.rst13
-rw-r--r--Help/prop_tgt/INSTALL_NAME_DIR.rst4
-rw-r--r--Help/prop_tgt/LANG_CLANG_TIDY.rst2
-rw-r--r--Help/prop_tgt/LIBRARY_OUTPUT_DIRECTORY.rst2
-rw-r--r--Help/prop_tgt/OBJCXX_STANDARD.rst2
-rw-r--r--Help/prop_tgt/RUNTIME_OUTPUT_DIRECTORY.rst2
-rw-r--r--Help/prop_tgt/UNITY_BUILD.rst5
-rw-r--r--Help/prop_tgt/UNITY_BUILD_UNIQUE_ID.rst55
-rw-r--r--Help/prop_tgt/XCODE_ATTRIBUTE_an-attribute.rst8
-rw-r--r--Help/prop_tgt/XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY.rst8
-rw-r--r--Help/prop_tgt/XCODE_EMBED_FRAMEWORKS_REMOVE_HEADERS_ON_COPY.rst8
-rw-r--r--Help/prop_tgt/XCODE_EMBED_type.rst14
-rw-r--r--Help/prop_tgt/XCODE_EMBED_type_PATH.rst9
-rw-r--r--Help/prop_tgt/XXX_OUTPUT_DIRECTORY.txt11
-rw-r--r--Help/release/3.20.rst329
-rw-r--r--Help/release/index.rst1
-rw-r--r--Help/variable/CMAKE_ANDROID_EXCEPTIONS.rst7
-rw-r--r--Help/variable/CMAKE_ANDROID_NDK_VERSION.rst8
-rw-r--r--Help/variable/CMAKE_ANDROID_RTTI.rst7
-rw-r--r--Help/variable/CMAKE_APPLE_SILICON_PROCESSOR.rst5
-rw-r--r--Help/variable/CMAKE_BUILD_TYPE.rst5
-rw-r--r--Help/variable/CMAKE_CUDA_ARCHITECTURES.rst18
-rw-r--r--Help/variable/CMAKE_DEPENDS_USE_COMPILER.rst9
-rw-r--r--Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst3
-rw-r--r--Help/variable/CMAKE_LANG_BYTE_ORDER.rst20
-rw-r--r--Help/variable/CMAKE_LANG_CLANG_TIDY.rst2
-rw-r--r--Help/variable/CMAKE_LANG_COMPILER_ID.rst2
-rw-r--r--Help/variable/CMAKE_LINK_SEARCH_END_STATIC.rst2
-rw-r--r--Help/variable/CMAKE_LINK_SEARCH_START_STATIC.rst2
-rw-r--r--Help/variable/CMAKE_NO_BUILTIN_CHRPATH.rst19
-rw-r--r--Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst2
-rw-r--r--Help/variable/CMAKE_POSITION_INDEPENDENT_CODE.rst2
-rw-r--r--Help/variable/CMAKE_SYSTEM_PROCESSOR.rst13
-rw-r--r--Help/variable/CMAKE_UNITY_BUILD_UNIQUE_ID.rst8
-rw-r--r--Help/variable/CMAKE_XCODE_ATTRIBUTE_an-attribute.rst10
-rw-r--r--Help/variable/CTEST_MEMORYCHECK_SANITIZER_OPTIONS.rst5
-rw-r--r--Help/variable/MSVC.rst5
-rw-r--r--Help/variable/MSVC_IDE.rst7
178 files changed, 5730 insertions, 1860 deletions
diff --git a/Help/command/DEVICE_LINK_OPTIONS.txt b/Help/command/DEVICE_LINK_OPTIONS.txt
index 3f0226fdc..1297cd054 100644
--- a/Help/command/DEVICE_LINK_OPTIONS.txt
+++ b/Help/command/DEVICE_LINK_OPTIONS.txt
@@ -1,11 +1,12 @@
-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.
+.. versionadded:: 3.18
+ 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 4a62c5b5b..97eecfca3 100644
--- a/Help/command/FIND_XXX.txt
+++ b/Help/command/FIND_XXX.txt
@@ -33,9 +33,6 @@ 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``.
-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:
@@ -60,7 +57,11 @@ Options include:
Specify the documentation string for the ``<VAR>`` cache entry.
``REQUIRED``
- Stop processing with an error message if nothing is found.
+ .. versionadded:: 3.18
+
+ Stop 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.
If ``NO_DEFAULT_PATH`` is specified, then no additional paths are
added to the search.
@@ -84,20 +85,21 @@ If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows:
|prefix_XXX_SUBDIR| for each ``<prefix>`` in
:variable:`CMAKE_SYSTEM_PREFIX_PATH`
-1. If called from within a find module or any other script loaded by a call to
- :command:`find_package(<PackageName>)`, search prefixes unique to the
- current package being found. Specifically, look in the
- :variable:`<PackageName>_ROOT` CMake variable and the
- :envvar:`<PackageName>_ROOT` environment variable.
- The package root variables are maintained as a stack, so if called from
- nested find modules or config packages, root paths from the parent's find
- module or config package will be searched after paths from the current
- module or package. In other words, the search order would be
- ``<CurrentPackage>_ROOT``, ``ENV{<CurrentPackage>_ROOT}``,
- ``<ParentPackage>_ROOT``, ``ENV{<ParentPackage>_ROOT}``, etc.
- This can be skipped if ``NO_PACKAGE_ROOT_PATH`` is passed or by setting
- the :variable:`CMAKE_FIND_USE_PACKAGE_ROOT_PATH` to ``FALSE``.
- See policy :policy:`CMP0074`.
+1. .. versionadded:: 3.12
+ If called from within a find module or any other script loaded by a call to
+ :command:`find_package(<PackageName>)`, search prefixes unique to the
+ current package being found. Specifically, look in the
+ :variable:`<PackageName>_ROOT` CMake variable and the
+ :envvar:`<PackageName>_ROOT` environment variable.
+ The package root variables are maintained as a stack, so if called from
+ nested find modules or config packages, root paths from the parent's find
+ module or config package will be searched after paths from the current
+ module or package. In other words, the search order would be
+ ``<CurrentPackage>_ROOT``, ``ENV{<CurrentPackage>_ROOT}``,
+ ``<ParentPackage>_ROOT``, ``ENV{<ParentPackage>_ROOT}``, etc.
+ This can be skipped if ``NO_PACKAGE_ROOT_PATH`` is passed or by setting
+ the :variable:`CMAKE_FIND_USE_PACKAGE_ROOT_PATH` to ``FALSE``.
+ See policy :policy:`CMP0074`.
* |FIND_PACKAGE_ROOT_PREFIX_PATH_XXX|
@@ -151,6 +153,10 @@ If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows:
or in the short-hand version of the command.
These are typically hard-coded guesses.
+.. versionadded:: 3.16
+ Added ``CMAKE_FIND_USE_<CATEGORY>_PATH`` variables to globally disable
+ various search locations.
+
.. |FIND_ARGS_XXX| replace:: <VAR> NAMES name
On macOS the :variable:`CMAKE_FIND_FRAMEWORK` and
diff --git a/Help/command/OPTIONS_SHELL.txt b/Help/command/OPTIONS_SHELL.txt
index 0f8ec323c..4051ffe16 100644
--- a/Help/command/OPTIONS_SHELL.txt
+++ b/Help/command/OPTIONS_SHELL.txt
@@ -1,9 +1,11 @@
The final set of compile or link options used for a target is constructed by
accumulating options from the current target and the usage requirements of
its dependencies. The set of options is de-duplicated to avoid repetition.
-While beneficial for individual options, the de-duplication step can break
-up option groups. For example, ``-D A -D B`` becomes ``-D A B``. One may
-specify a group of options using shell-like quoting along with a ``SHELL:``
-prefix. The ``SHELL:`` prefix is dropped, and the rest of the option string
-is parsed using the :command:`separate_arguments` ``UNIX_COMMAND`` mode.
-For example, ``"SHELL:-D A" "SHELL:-D B"`` becomes ``-D A -D B``.
+
+.. versionadded:: 3.12
+ While beneficial for individual options, the de-duplication step can break
+ up option groups. For example, ``-D A -D B`` becomes ``-D A B``. One may
+ specify a group of options using shell-like quoting along with a ``SHELL:``
+ prefix. The ``SHELL:`` prefix is dropped, and the rest of the option string
+ is parsed using the :command:`separate_arguments` ``UNIX_COMMAND`` mode.
+ For example, ``"SHELL:-D A" "SHELL:-D B"`` becomes ``-D A -D B``.
diff --git a/Help/command/add_custom_command.rst b/Help/command/add_custom_command.rst
index 231f9dad4..183bb72fc 100644
--- a/Help/command/add_custom_command.rst
+++ b/Help/command/add_custom_command.rst
@@ -46,11 +46,19 @@ The options are:
Append the ``COMMAND`` and ``DEPENDS`` option values to the custom
command for the first output specified. There must have already
been a previous call to this command with the same output.
+
+ If the previous call specified the output via a generator expression,
+ the output specified by the current call must match in at least one
+ configuration after evaluating generator expressions. In this case,
+ the appended commands and dependencies apply to all configurations.
+
The ``COMMENT``, ``MAIN_DEPENDENCY``, and ``WORKING_DIRECTORY``
options are currently ignored when APPEND is given, but may be
used in the future.
``BYPRODUCTS``
+ .. versionadded:: 3.2
+
Specify the files the command is expected to produce but whose
modification time may or may not be newer than the dependencies.
If a byproduct name is a relative path it will be interpreted
@@ -71,6 +79,10 @@ The options are:
The :ref:`Makefile Generators` will remove ``BYPRODUCTS`` and other
:prop_sf:`GENERATED` files during ``make clean``.
+ .. versionadded:: 3.20
+ Arguments to ``BYPRODUCTS`` may use
+ :manual:`generator expressions <cmake-generator-expressions(7)>`.
+
``COMMAND``
Specify the command-line(s) to execute at build time.
If more than one ``COMMAND`` is specified they will be executed in order,
@@ -88,18 +100,19 @@ The options are:
* The target is not being cross-compiled (i.e. the
:variable:`CMAKE_CROSSCOMPILING` variable is not set to true).
- * The target is being cross-compiled and an emulator is provided (i.e.
- its :prop_tgt:`CROSSCOMPILING_EMULATOR` target property is set).
- In this case, the contents of :prop_tgt:`CROSSCOMPILING_EMULATOR` will be
- prepended to the command before the location of the target executable.
+ * .. versionadded:: 3.6
+ The target is being cross-compiled and an emulator is provided (i.e.
+ its :prop_tgt:`CROSSCOMPILING_EMULATOR` target property is set).
+ In this case, the contents of :prop_tgt:`CROSSCOMPILING_EMULATOR` will be
+ prepended to the command before the location of the target executable.
If neither of the above conditions are met, it is assumed that the
command name is a program to be found on the ``PATH`` at build time.
Arguments to ``COMMAND`` may use
:manual:`generator expressions <cmake-generator-expressions(7)>`.
- Use the ``TARGET_FILE`` generator expression to refer to the location of
- a target later in the command line (i.e. as a command argument rather
+ Use the :genex:`TARGET_FILE` generator expression to refer to the location
+ of a target later in the command line (i.e. as a command argument rather
than as the command to execute).
Whenever one of the following target based generator expressions are used as
@@ -153,18 +166,23 @@ The options are:
If any dependency is an ``OUTPUT`` of another custom command in the same
directory (``CMakeLists.txt`` file), CMake automatically brings the other
custom command into the target in which this command is built.
- A target-level dependency is added if any dependency is listed as
- ``BYPRODUCTS`` of a target or any of its build events in the same
- directory to ensure the byproducts will be available.
+
+ .. versionadded:: 3.16
+ A target-level dependency is added if any dependency is listed as
+ ``BYPRODUCTS`` of a target or any of its build events in the same
+ directory to ensure the byproducts will be available.
If ``DEPENDS`` is not specified, the command will run whenever
the ``OUTPUT`` is missing; if the command does not actually
create the ``OUTPUT``, the rule will always run.
- Arguments to ``DEPENDS`` may use
- :manual:`generator expressions <cmake-generator-expressions(7)>`.
+ .. versionadded:: 3.1
+ Arguments to ``DEPENDS`` may use
+ :manual:`generator expressions <cmake-generator-expressions(7)>`.
``COMMAND_EXPAND_LISTS``
+ .. versionadded:: 3.8
+
Lists in ``COMMAND`` arguments will be expanded, including those
created with
:manual:`generator expressions <cmake-generator-expressions(7)>`,
@@ -183,7 +201,13 @@ The options are:
Note that the ``IMPLICIT_DEPENDS`` option is currently supported
only for Makefile generators and will be ignored by other generators.
+ .. note::
+
+ This option cannot be specified at the same time as ``DEPFILE`` option.
+
``JOB_POOL``
+ .. versionadded:: 3.15
+
Specify a :prop_gbl:`pool <JOB_POOLS>` for the :generator:`Ninja`
generator. Incompatible with ``USES_TERMINAL``, which implies
the ``console`` pool.
@@ -210,7 +234,13 @@ The options are:
as a file on disk it should be marked with the :prop_sf:`SYMBOLIC`
source file property.
+ .. versionadded:: 3.20
+ Arguments to ``OUTPUT`` may use
+ :manual:`generator expressions <cmake-generator-expressions(7)>`.
+
``USES_TERMINAL``
+ .. versionadded:: 3.2
+
The command will be given direct access to the terminal if possible.
With the :generator:`Ninja` generator, this places the command in
the ``console`` :prop_gbl:`pool <JOB_POOLS>`.
@@ -230,14 +260,72 @@ The options are:
If it is a relative path it will be interpreted relative to the
build tree directory corresponding to the current source directory.
- Arguments to ``WORKING_DIRECTORY`` may use
- :manual:`generator expressions <cmake-generator-expressions(7)>`.
+ .. versionadded:: 3.13
+ Arguments to ``WORKING_DIRECTORY`` may use
+ :manual:`generator expressions <cmake-generator-expressions(7)>`.
``DEPFILE``
- Specify a ``.d`` depfile for the :generator:`Ninja` generator.
+ .. versionadded:: 3.7
+
+ Specify a ``.d`` depfile for the :generator:`Ninja` generator and
+ :ref:`Makefile Generators`.
A ``.d`` file holds dependencies usually emitted by the custom
command itself.
- Using ``DEPFILE`` with other generators than Ninja is an error.
+ Using ``DEPFILE`` with other generators than :generator:`Ninja` or
+ :ref:`Makefile Generators` is an error.
+
+ .. versionadded:: 3.20
+ Added the support of :ref:`Makefile Generators`.
+
+ If the ``DEPFILE`` argument is relative, it should be relative to
+ :variable:`CMAKE_CURRENT_BINARY_DIR`, and any relative paths inside the
+ ``DEPFILE`` should also be relative to :variable:`CMAKE_CURRENT_BINARY_DIR`
+ (see policy :policy:`CMP0116`. This policy is always ``NEW`` for
+ :ref:`Makefile Generators`).
+
+ .. note::
+
+ For :ref:`Makefile Generators`, this option cannot be specified at the
+ same time as ``IMPLICIT_DEPENDS`` option.
+
+Examples: Generating Files
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Custom commands may be used to generate source files.
+For example, the code:
+
+.. code-block:: cmake
+
+ add_custom_command(
+ OUTPUT out.c
+ COMMAND someTool -i ${CMAKE_CURRENT_SOURCE_DIR}/in.txt
+ -o out.c
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/in.txt
+ VERBATIM)
+ add_library(myLib out.c)
+
+adds a custom command to run ``someTool`` to generate ``out.c`` and then
+compile the generated source as part of a library. The generation rule
+will re-run whenever ``in.txt`` changes.
+
+.. versionadded:: 3.20
+ One may use generator expressions to specify per-configuration outputs.
+ For example, the code:
+
+ .. code-block:: cmake
+
+ add_custom_command(
+ OUTPUT "out-$<CONFIG>.c"
+ COMMAND someTool -i ${CMAKE_CURRENT_SOURCE_DIR}/in.txt
+ -o "out-$<CONFIG>.c"
+ -c "$<CONFIG>"
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/in.txt
+ VERBATIM)
+ add_library(myLib "out-$<CONFIG>.c")
+
+ adds a custom command to run ``someTool`` to generate ``out-<config>.c``,
+ where ``<config>`` is the build configuration, and then compile the generated
+ source as part of a library.
Build Events
^^^^^^^^^^^^
@@ -288,3 +376,49 @@ of the following is specified:
configuration and no "empty-string-command" will be added.
This allows to add individual build events for every configuration.
+
+Examples: Build Events
+^^^^^^^^^^^^^^^^^^^^^^
+
+A ``POST_BUILD`` event may be used to post-process a binary after linking.
+For example, the code:
+
+.. code-block:: cmake
+
+ add_executable(myExe myExe.c)
+ add_custom_command(
+ TARGET myExe POST_BUILD
+ COMMAND someHasher -i "$<TARGET_FILE:myExe>"
+ -o "$<TARGET_FILE:myExe>.hash"
+ VERBATIM)
+
+will run ``someHasher`` to produce a ``.hash`` file next to the executable
+after linking.
+
+.. versionadded:: 3.20
+ One may use generator expressions to specify per-configuration byproducts.
+ For example, the code:
+
+ .. code-block:: cmake
+
+ add_library(myPlugin MODULE myPlugin.c)
+ add_custom_command(
+ TARGET myPlugin POST_BUILD
+ COMMAND someHasher -i "$<TARGET_FILE:myPlugin>"
+ --as-code "myPlugin-hash-$<CONFIG>.c"
+ BYPRODUCTS "myPlugin-hash-$<CONFIG>.c"
+ VERBATIM)
+ add_executable(myExe myExe.c "myPlugin-hash-$<CONFIG>.c")
+
+ will run ``someHasher`` after linking ``myPlugin``, e.g. to produce a ``.c``
+ file containing code to check the hash of ``myPlugin`` that the ``myExe``
+ executable can use to verify it before loading.
+
+Ninja Multi-Config
+^^^^^^^^^^^^^^^^^^
+
+.. versionadded:: 3.20
+
+ ``add_custom_command`` supports the :generator:`Ninja Multi-Config`
+ generator's cross-config capabilities. See the generator documentation
+ for more information.
diff --git a/Help/command/add_custom_target.rst b/Help/command/add_custom_target.rst
index 2eb0c8864..22d3f294d 100644
--- a/Help/command/add_custom_target.rst
+++ b/Help/command/add_custom_target.rst
@@ -32,6 +32,8 @@ The options are:
called ``ALL``).
``BYPRODUCTS``
+ .. versionadded:: 3.2
+
Specify the files the command is expected to produce but whose
modification time may or may not be updated on subsequent builds.
If a byproduct name is a relative path it will be interpreted
@@ -52,6 +54,10 @@ The options are:
The :ref:`Makefile Generators` will remove ``BYPRODUCTS`` and other
:prop_sf:`GENERATED` files during ``make clean``.
+ .. versionadded:: 3.20
+ Arguments to ``BYPRODUCTS`` may use
+ :manual:`generator expressions <cmake-generator-expressions(7)>`.
+
``COMMAND``
Specify the command-line(s) to execute at build time.
If more than one ``COMMAND`` is specified they will be executed in order,
@@ -67,18 +73,19 @@ The options are:
* The target is not being cross-compiled (i.e. the
:variable:`CMAKE_CROSSCOMPILING` variable is not set to true).
- * The target is being cross-compiled and an emulator is provided (i.e.
- its :prop_tgt:`CROSSCOMPILING_EMULATOR` target property is set).
- In this case, the contents of :prop_tgt:`CROSSCOMPILING_EMULATOR` will be
- prepended to the command before the location of the target executable.
+ * .. versionadded:: 3.6
+ The target is being cross-compiled and an emulator is provided (i.e.
+ its :prop_tgt:`CROSSCOMPILING_EMULATOR` target property is set).
+ In this case, the contents of :prop_tgt:`CROSSCOMPILING_EMULATOR` will be
+ prepended to the command before the location of the target executable.
If neither of the above conditions are met, it is assumed that the
command name is a program to be found on the ``PATH`` at build time.
Arguments to ``COMMAND`` may use
:manual:`generator expressions <cmake-generator-expressions(7)>`.
- Use the ``TARGET_FILE`` generator expression to refer to the location of
- a target later in the command line (i.e. as a command argument rather
+ Use the :genex:`TARGET_FILE` generator expression to refer to the location
+ of a target later in the command line (i.e. as a command argument rather
than as the command to execute).
Whenever one of the following target based generator expressions are used as
@@ -103,14 +110,18 @@ The options are:
:command:`add_custom_command` command calls in the same directory
(``CMakeLists.txt`` file). They will be brought up to date when
the target is built.
- A target-level dependency is added if any dependency is a byproduct
- of a target or any of its build events in the same directory to ensure
- the byproducts will be available before this target is built.
+
+ .. versionchanged:: 3.16
+ A target-level dependency is added if any dependency is a byproduct
+ of a target or any of its build events in the same directory to ensure
+ the byproducts will be available before this target is built.
Use the :command:`add_dependencies` command to add dependencies
on other targets.
``COMMAND_EXPAND_LISTS``
+ .. versionadded:: 3.8
+
Lists in ``COMMAND`` arguments will be expanded, including those
created with
:manual:`generator expressions <cmake-generator-expressions(7)>`,
@@ -119,6 +130,8 @@ The options are:
to be properly expanded.
``JOB_POOL``
+ .. versionadded:: 3.15
+
Specify a :prop_gbl:`pool <JOB_POOLS>` for the :generator:`Ninja`
generator. Incompatible with ``USES_TERMINAL``, which implies
the ``console`` pool.
@@ -141,6 +154,8 @@ The options are:
tool-specific special characters.
``USES_TERMINAL``
+ .. versionadded:: 3.2
+
The command will be given direct access to the terminal if possible.
With the :generator:`Ninja` generator, this places the command in
the ``console`` :prop_gbl:`pool <JOB_POOLS>`.
@@ -150,5 +165,15 @@ The options are:
If it is a relative path it will be interpreted relative to the
build tree directory corresponding to the current source directory.
- Arguments to ``WORKING_DIRECTORY`` may use
- :manual:`generator expressions <cmake-generator-expressions(7)>`.
+ .. versionadded:: 3.13
+ Arguments to ``WORKING_DIRECTORY`` may use
+ :manual:`generator expressions <cmake-generator-expressions(7)>`.
+
+Ninja Multi-Config
+^^^^^^^^^^^^^^^^^^
+
+.. versionadded:: 3.20
+
+ ``add_custom_target`` supports the :generator:`Ninja Multi-Config`
+ generator's cross-config capabilities. See the generator documentation
+ for more information.
diff --git a/Help/command/add_dependencies.rst b/Help/command/add_dependencies.rst
index de219a508..14c018303 100644
--- a/Help/command/add_dependencies.rst
+++ b/Help/command/add_dependencies.rst
@@ -17,6 +17,9 @@ Dependencies added to an :ref:`imported target <Imported Targets>`
or an :ref:`interface library <Interface Libraries>` are followed
transitively in its place since the target itself does not build.
+.. versionadded:: 3.3
+ Allow adding dependencies to interface libraries.
+
See the ``DEPENDS`` option of :command:`add_custom_target` and
:command:`add_custom_command` commands for adding file-level
dependencies in custom rules. See the :prop_sf:`OBJECT_DEPENDS`
diff --git a/Help/command/add_executable.rst b/Help/command/add_executable.rst
index e073228de..dde94293e 100644
--- a/Help/command/add_executable.rst
+++ b/Help/command/add_executable.rst
@@ -17,13 +17,21 @@ Normal Executables
[source1] [source2 ...])
Adds an executable target called ``<name>`` to be built from the source
-files listed in the command invocation. (The source files can be omitted
-here if they are added later using :command:`target_sources`.) The
+files listed in the command invocation. The
``<name>`` corresponds to the logical target name and must be globally
unique within a project. The actual file name of the executable built is
constructed based on conventions of the native platform (such as
``<name>.exe`` or just ``<name>``).
+.. versionadded:: 3.1
+ Source arguments to ``add_executable`` may use "generator expressions" with
+ the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
+ manual for available expressions.
+
+.. versionadded:: 3.11
+ The source files can be omitted if they are added later using
+ :command:`target_sources`.
+
By default the executable file will be created in the build tree
directory corresponding to the source tree directory in which the
command was invoked. See documentation of the
@@ -43,10 +51,8 @@ If ``EXCLUDE_FROM_ALL`` is given the corresponding property will be set on
the created target. See documentation of the :prop_tgt:`EXCLUDE_FROM_ALL`
target property for details.
-Source arguments to ``add_executable`` may use "generator expressions" 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.
+See the :manual:`cmake-buildsystem(7)` manual for more on defining
+buildsystem properties.
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
@@ -85,10 +91,14 @@ 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 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.
+.. versionadded:: 3.11
+ An ``ALIAS`` can target a ``GLOBAL`` :ref:`Imported Target <Imported Targets>`
+
+.. versionadded:: 3.18
+ An ``ALIAS`` can target a non-``GLOBAL`` Imported Target. Such alias is
+ scoped to the directory in which it is created and subdirectories.
+ 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
diff --git a/Help/command/add_library.rst b/Help/command/add_library.rst
index b7dfabc8e..d3fbdcf19 100644
--- a/Help/command/add_library.rst
+++ b/Help/command/add_library.rst
@@ -17,13 +17,21 @@ Normal Libraries
[<source>...])
Adds a library target called ``<name>`` to be built from the source files
-listed in the command invocation. (The source files can be omitted here
-if they are added later using :command:`target_sources`.) The ``<name>``
+listed in the command invocation. The ``<name>``
corresponds to the logical target name and must be globally unique within
a project. The actual file name of the library built is constructed based
on conventions of the native platform (such as ``lib<name>.a`` or
``<name>.lib``).
+.. versionadded:: 3.1
+ Source arguments to ``add_library`` may use "generator expressions" with
+ the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
+ manual for available expressions.
+
+.. versionadded:: 3.11
+ The source files can be omitted if they are added later using
+ :command:`target_sources`.
+
``STATIC``, ``SHARED``, or ``MODULE`` may be given to specify the type of
library to be created. ``STATIC`` libraries are archives of object files
for use when linking other targets. ``SHARED`` libraries are linked
@@ -34,9 +42,13 @@ type is ``STATIC`` or ``SHARED`` based on whether the current value of the
variable :variable:`BUILD_SHARED_LIBS` is ``ON``. For ``SHARED`` and
``MODULE`` libraries the :prop_tgt:`POSITION_INDEPENDENT_CODE` target
property is set to ``ON`` automatically.
-A ``SHARED`` or ``STATIC`` library may be marked with the :prop_tgt:`FRAMEWORK`
+A ``SHARED`` library may be marked with the :prop_tgt:`FRAMEWORK`
target property to create an macOS Framework.
+.. versionadded:: 3.8
+ A ``STATIC`` library may be marked with the :prop_tgt:`FRAMEWORK`
+ target property to create a static Framework.
+
If a library does not export any symbols, it must not be declared as a
``SHARED`` library. For example, a Windows resource DLL or a managed C++/CLI
DLL that exports no unmanaged symbols would need to be a ``MODULE`` library.
@@ -55,10 +67,8 @@ If ``EXCLUDE_FROM_ALL`` is given the corresponding property will be set on
the created target. See documentation of the :prop_tgt:`EXCLUDE_FROM_ALL`
target property for details.
-Source arguments to ``add_library`` may use "generator expressions" 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.
+See the :manual:`cmake-buildsystem(7)` manual for more on defining
+buildsystem properties.
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
@@ -93,6 +103,9 @@ systems (such as Xcode) may not like targets that have only object files, so
consider adding at least one real source file to any target that references
``$<TARGET_OBJECTS:objlib>``.
+.. versionadded:: 3.12
+ Object libraries can be linked to with :command:`target_link_libraries`.
+
Interface Libraries
^^^^^^^^^^^^^^^^^^^
@@ -121,23 +134,28 @@ like any other target.
An interface library created with the above signature has no source files
itself and is not included as a target in the generated buildsystem.
-Since CMake 3.19, an interface library target may be created with
-source files:
+.. versionadded:: 3.15
+ An interface library can have :prop_tgt:`PUBLIC_HEADER` and
+ :prop_tgt:`PRIVATE_HEADER` properties. The headers specified by those
+ properties can be installed using the :command:`install(TARGETS)` command.
-.. code-block:: cmake
+.. versionadded:: 3.19
+ An interface library target may be created with source files:
+
+ .. code-block:: cmake
- add_library(<name> INTERFACE [<source>...] [EXCLUDE_FROM_ALL])
+ add_library(<name> INTERFACE [<source>...] [EXCLUDE_FROM_ALL])
-Source files may be listed directly in the ``add_library`` call or added
-later by calls to :command:`target_sources` with the ``PRIVATE`` or
-``PUBLIC`` keywords.
+ Source files may be listed directly in the ``add_library`` call or added
+ later by calls to :command:`target_sources` with the ``PRIVATE`` or
+ ``PUBLIC`` keywords.
-If an interface library has source files (i.e. the :prop_tgt:`SOURCES`
-target property is set), it will appear in the generated buildsystem
-as a build target much like a target defined by the
-:command:`add_custom_target` command. It does not compile any sources,
-but does contain build rules for custom commands created by the
-:command:`add_custom_command` command.
+ If an interface library has source files (i.e. the :prop_tgt:`SOURCES`
+ target property is set), it will appear in the generated buildsystem
+ as a build target much like a target defined by the
+ :command:`add_custom_target` command. It does not compile any sources,
+ but does contain build rules for custom commands created by the
+ :command:`add_custom_command` command.
.. note::
In most command signatures where the ``INTERFACE`` keyword appears,
@@ -211,10 +229,14 @@ 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 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.
+.. versionadded:: 3.11
+ An ``ALIAS`` can target a ``GLOBAL`` :ref:`Imported Target <Imported Targets>`
+
+.. versionadded:: 3.18
+ An ``ALIAS`` can target a non-``GLOBAL`` Imported Target. Such alias is
+ scoped to the directory in which it 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
diff --git a/Help/command/add_test.rst b/Help/command/add_test.rst
index 2b4d082d1..95cd0374e 100644
--- a/Help/command/add_test.rst
+++ b/Help/command/add_test.rst
@@ -31,6 +31,8 @@ if necessary. See policy :policy:`CMP0110`. The options are:
current source directory.
``COMMAND_EXPAND_LISTS``
+ .. versionadded:: 3.16
+
Lists in ``COMMAND`` arguments will be expanded, including those
created with
:manual:`generator expressions <cmake-generator-expressions(7)>`.
@@ -43,6 +45,9 @@ unless the :prop_test:`PASS_REGULAR_EXPRESSION`,
:prop_test:`FAIL_REGULAR_EXPRESSION` or
:prop_test:`SKIP_REGULAR_EXPRESSION` test property is used.
+.. versionadded:: 3.16
+ Added :prop_test:`SKIP_REGULAR_EXPRESSION` property.
+
The ``COMMAND`` and ``WORKING_DIRECTORY`` options may use "generator
expressions" with the syntax ``$<...>``. See the
:manual:`cmake-generator-expressions(7)` manual for available expressions.
@@ -52,7 +57,7 @@ Example usage:
.. code-block:: cmake
add_test(NAME mytest
- COMMAND testDriver --config $<CONFIGURATION>
+ COMMAND testDriver --config $<CONFIG>
--exe $<TARGET_FILE:myexe>)
This creates a test ``mytest`` whose command runs a ``testDriver`` tool
diff --git a/Help/command/cmake_host_system_information.rst b/Help/command/cmake_host_system_information.rst
index 2e9563aab..2b902a915 100644
--- a/Help/command/cmake_host_system_information.rst
+++ b/Help/command/cmake_host_system_information.rst
@@ -24,6 +24,14 @@ Key Description
``AVAILABLE_VIRTUAL_MEMORY`` Available virtual memory in MiB [#mebibytes]_
``TOTAL_PHYSICAL_MEMORY`` Total physical memory in MiB [#mebibytes]_
``AVAILABLE_PHYSICAL_MEMORY`` Available physical memory in MiB [#mebibytes]_
+============================= ================================================
+
+.. versionadded:: 3.10
+ Additional ``<key>`` values are available:
+
+============================= ================================================
+Key Description
+============================= ================================================
``IS_64BIT`` One if processor is 64Bit
``HAS_FPU`` One if processor has floating point unit
``HAS_MMX`` One if processor supports MMX instructions
diff --git a/Help/command/cmake_minimum_required.rst b/Help/command/cmake_minimum_required.rst
index f3326b832..c3b3e7370 100644
--- a/Help/command/cmake_minimum_required.rst
+++ b/Help/command/cmake_minimum_required.rst
@@ -7,6 +7,9 @@ Require a minimum version of cmake.
cmake_minimum_required(VERSION <min>[...<max>] [FATAL_ERROR])
+.. versionadded:: 3.12
+ The optional ``<max>`` version.
+
Sets the minimum required version of cmake for a project.
Also updates the policy settings as explained below.
diff --git a/Help/command/cmake_parse_arguments.rst b/Help/command/cmake_parse_arguments.rst
index 8803ec8bd..7c85da610 100644
--- a/Help/command/cmake_parse_arguments.rst
+++ b/Help/command/cmake_parse_arguments.rst
@@ -1,8 +1,6 @@
cmake_parse_arguments
---------------------
-.. versionadded:: 3.5
-
Parse function or macro arguments.
.. code-block:: cmake
@@ -13,6 +11,10 @@ Parse function or macro arguments.
cmake_parse_arguments(PARSE_ARGV <N> <prefix> <options>
<one_value_keywords> <multi_value_keywords>)
+.. versionadded:: 3.5
+ This command is implemented natively. Previously, it has been defined in the
+ module :module:`CMakeParseArguments`.
+
This command is for use in macros or functions.
It processes the arguments given to that macro or function,
and defines a set of variables which hold the values of the
@@ -21,11 +23,12 @@ respective options.
The first signature reads processes arguments passed in the ``<args>...``.
This may be used in either a :command:`macro` or a :command:`function`.
-The ``PARSE_ARGV`` signature is only for use in a :command:`function`
-body. In this case the arguments that are parsed come from the
-``ARGV#`` variables of the calling function. The parsing starts with
-the ``<N>``-th argument, where ``<N>`` is an unsigned integer. This allows for
-the values to have special characters like ``;`` in them.
+.. versionadded:: 3.7
+ The ``PARSE_ARGV`` signature is only for use in a :command:`function`
+ body. In this case the arguments that are parsed come from the
+ ``ARGV#`` variables of the calling function. The parsing starts with
+ the ``<N>``-th argument, where ``<N>`` is an unsigned integer.
+ This allows for the values to have special characters like ``;`` in them.
The ``<options>`` argument contains all options for the respective macro,
i.e. keywords which can be used when calling the macro without any value
@@ -40,12 +43,11 @@ The ``<multi_value_keywords>`` argument contains all keywords for this
macro which can be followed by more than one value, like e.g. the
``TARGETS`` or ``FILES`` keywords of the :command:`install` command.
-.. note::
-
- All keywords shall be unique. I.e. every keyword shall only be specified
- once in either ``<options>``, ``<one_value_keywords>`` or
- ``<multi_value_keywords>``. A warning will be emitted if uniqueness is
- violated.
+.. versionchanged:: 3.5
+ All keywords shall be unique. I.e. every keyword shall only be specified
+ once in either ``<options>``, ``<one_value_keywords>`` or
+ ``<multi_value_keywords>``. A warning will be emitted if uniqueness is
+ violated.
When done, ``cmake_parse_arguments`` will consider for each of the
keywords listed in ``<options>``, ``<one_value_keywords>`` and
@@ -61,10 +63,12 @@ All remaining arguments are collected in a variable
were recognized. This can be checked afterwards to see
whether your macro was called with unrecognized parameters.
-``<one_value_keywords>`` and ``<multi_value_keywords>`` that were given no
-values at all are collected in a variable ``<prefix>_KEYWORDS_MISSING_VALUES``
-that will be undefined if all keywords received values. This can be checked
-to see if there were keywords without any values given.
+.. versionadded:: 3.15
+ ``<one_value_keywords>`` and ``<multi_value_keywords>`` that were given no
+ values at all are collected in a variable
+ ``<prefix>_KEYWORDS_MISSING_VALUES`` that will be undefined if all keywords
+ received values. This can be checked to see if there were keywords without
+ any values given.
Consider the following example macro, ``my_install()``, which takes similar
arguments to the real :command:`install` command:
diff --git a/Help/command/cmake_path.rst b/Help/command/cmake_path.rst
new file mode 100644
index 000000000..a8999f35b
--- /dev/null
+++ b/Help/command/cmake_path.rst
@@ -0,0 +1,784 @@
+cmake_path
+----------
+
+.. versionadded:: 3.20
+
+This command is for the manipulation of paths. Only syntactic aspects of
+paths are handled, there is no interaction of any kind with any underlying
+file system. The path may represent a non-existing path or even one that
+is not allowed to exist on the current file system or platform.
+For operations that do interact with the filesystem, see the :command:`file`
+command.
+
+.. note::
+
+ The ``cmake_path`` command handles paths in the format of the build system
+ (i.e. the host platform), not the target system. When cross-compiling,
+ if the path contains elements that are not representable on the host
+ platform (e.g. a drive letter when the host is not Windows), the results
+ will be unpredictable.
+
+Synopsis
+^^^^^^^^
+
+.. parsed-literal::
+
+ `Conventions`_
+
+ `Path Structure And Terminology`_
+
+ `Normalization`_
+
+ `Decomposition`_
+ cmake_path(`GET`_ <path-var> :ref:`ROOT_NAME <GET_ROOT_NAME>` <out-var>)
+ cmake_path(`GET`_ <path-var> :ref:`ROOT_DIRECTORY <GET_ROOT_DIRECTORY>` <out-var>)
+ cmake_path(`GET`_ <path-var> :ref:`ROOT_PATH <GET_ROOT_PATH>` <out-var>)
+ cmake_path(`GET`_ <path-var> :ref:`FILENAME <GET_FILENAME>` <out-var>)
+ cmake_path(`GET`_ <path-var> :ref:`EXTENSION <GET_EXTENSION>` [LAST_ONLY] <out-var>)
+ cmake_path(`GET`_ <path-var> :ref:`STEM <GET_STEM>` [LAST_ONLY] <out-var>)
+ cmake_path(`GET`_ <path-var> :ref:`RELATIVE_PART <GET_RELATIVE_PART>` <out-var>)
+ cmake_path(`GET`_ <path-var> :ref:`PARENT_PATH <GET_PARENT_PATH>` <out-var>)
+
+ `Query`_
+ cmake_path(`HAS_ROOT_NAME`_ <path-var> <out-var>)
+ cmake_path(`HAS_ROOT_DIRECTORY`_ <path-var> <out-var>)
+ cmake_path(`HAS_ROOT_PATH`_ <path-var> <out-var>)
+ cmake_path(`HAS_FILENAME`_ <path-var> <out-var>)
+ cmake_path(`HAS_EXTENSION`_ <path-var> <out-var>)
+ cmake_path(`HAS_STEM`_ <path-var> <out-var>)
+ cmake_path(`HAS_RELATIVE_PART`_ <path-var> <out-var>)
+ cmake_path(`HAS_PARENT_PATH`_ <path-var> <out-var>)
+ cmake_path(`IS_ABSOLUTE`_ <path-var> <out-var>)
+ cmake_path(`IS_RELATIVE`_ <path-var> <out-var>)
+ cmake_path(`IS_PREFIX`_ <path-var> <input> [NORMALIZE] <out-var>)
+ cmake_path(`COMPARE`_ <input1> <OP> <input2> <out-var>)
+
+ `Modification`_
+ cmake_path(:ref:`SET <cmake_path-SET>` <path-var> [NORMALIZE] <input>)
+ cmake_path(`APPEND`_ <path-var> [<input>...] [OUTPUT_VARIABLE <out-var>])
+ cmake_path(`APPEND_STRING`_ <path-var> [<input>...] [OUTPUT_VARIABLE <out-var>])
+ cmake_path(`REMOVE_FILENAME`_ <path-var> [OUTPUT_VARIABLE <out-var>])
+ cmake_path(`REPLACE_FILENAME`_ <path-var> <input> [OUTPUT_VARIABLE <out-var>])
+ cmake_path(`REMOVE_EXTENSION`_ <path-var> [LAST_ONLY] [OUTPUT_VARIABLE <out-var>])
+ cmake_path(`REPLACE_EXTENSION`_ <path-var> [LAST_ONLY] <input> [OUTPUT_VARIABLE <out-var>])
+
+ `Generation`_
+ cmake_path(`NORMAL_PATH`_ <path-var> [OUTPUT_VARIABLE <out-var>])
+ cmake_path(`RELATIVE_PATH`_ <path-var> [BASE_DIRECTORY <input>] [OUTPUT_VARIABLE <out-var>])
+ cmake_path(`ABSOLUTE_PATH`_ <path-var> [BASE_DIRECTORY <input>] [NORMALIZE] [OUTPUT_VARIABLE <out-var>])
+
+ `Native Conversion`_
+ cmake_path(`NATIVE_PATH`_ <path-var> [NORMALIZE] <out-var>)
+ cmake_path(`CONVERT`_ <input> `TO_CMAKE_PATH_LIST`_ <out-var>)
+ cmake_path(`CONVERT`_ <input> `TO_NATIVE_PATH_LIST`_ <out-var>)
+
+ `Hashing`_
+ cmake_path(`HASH`_ <path-var> <out-var>)
+
+Conventions
+^^^^^^^^^^^
+
+The following conventions are used in this command's documentation:
+
+``<path-var>``
+ Always the name of a variable. For commands that expect a ``<path-var>``
+ as input, the variable must exist and it is expected to hold a single path.
+
+``<input>``
+ A string literal which may contain a path, path fragment, or multiple paths
+ with a special separator depending on the command. See the description of
+ each command to see how this is interpreted.
+
+``<input>...``
+ Zero or more string literal arguments.
+
+``<out-var>``
+ The name of a variable into which the result of a command will be written.
+
+
+Path Structure And Terminology
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+A path has the following structure (all components are optional, with some
+constraints):
+
+::
+
+ root-name root-directory-separator (item-name directory-separator)* filename
+
+``root-name``
+ Identifies the root on a filesystem with multiple roots (such as ``"C:"``
+ or ``"//myserver"``). It is optional.
+
+``root-directory-separator``
+ A directory separator that, if present, indicates that this path is
+ absolute. If it is missing and the first element other than the
+ ``root-name`` is an ``item-name``, then the path is relative.
+
+``item-name``
+ A sequence of characters that aren't directory separators. This name may
+ identify a file, a hard link, a symbolic link, or a directory. Two special
+ cases are recognized:
+
+ * The item name consisting of a single dot character ``.`` is a
+ directory name that refers to the current directory.
+
+ * The item name consisting of two dot characters ``..`` is a
+ directory name that refers to the parent directory.
+
+ The ``(...)*`` pattern shown above is to indicate that there can be zero
+ or more item names, with multiple items separated by a
+ ``directory-separator``. The ``()*`` characters are not part of the path.
+
+``directory-separator``
+ The only recognized directory separator is a forward slash character ``/``.
+ If this character is repeated, it is treated as a single directory
+ separator. In other words, ``/usr///////lib`` is the same as ``/usr/lib``.
+
+.. _FILENAME_DEF:
+.. _EXTENSION_DEF:
+.. _STEM_DEF:
+
+``filename``
+ A path has a ``filename`` if it does not end with a ``directory-separator``.
+ The ``filename`` is effectively the last ``item-name`` of the path, so it
+ can also be a hard link, symbolic link or a directory.
+
+ A ``filename`` can have an *extension*. By default, the extension is
+ defined as the sub-string beginning at the left-most period (including
+ the period) and until the end of the ``filename``. In commands that
+ accept a ``LAST_ONLY`` keyword, ``LAST_ONLY`` changes the interpretation
+ to the sub-string beginning at the right-most period.
+
+ The following exceptions apply to the above interpretation:
+
+ * If the first character in the ``filename`` is a period, that period is
+ ignored (i.e. a ``filename`` like ``".profile"`` is treated as having
+ no extension).
+
+ * If the ``filename`` is either ``.`` or ``..``, it has no extension.
+
+ The *stem* is the part of the ``filename`` before the extension.
+
+Some commands refer to a ``root-path``. This is the concatenation of
+``root-name`` and ``root-directory-separator``, either or both of which can
+be empty. A ``relative-part`` refers to the full path with any ``root-path``
+removed.
+
+
+Creating A Path Variable
+^^^^^^^^^^^^^^^^^^^^^^^^
+
+While a path can be created with care using an ordinary :command:`set`
+command, it is recommended to use :ref:`cmake_path(SET) <cmake_path-SET>`
+instead, as it automatically converts the path to the required form where
+required. The :ref:`cmake_path(APPEND) <APPEND>` subcommand may
+be another suitable alternative where a path needs to be constructed by
+joining fragments. The following example compares the three methods for
+constructing the same path:
+
+.. code-block:: cmake
+
+ set(path1 "${CMAKE_CURRENT_SOURCE_DIR}/data")
+
+ cmake_path(SET path2 "${CMAKE_CURRENT_SOURCE_DIR}/data")
+
+ cmake_path(APPEND path3 "${CMAKE_CURRENT_SOURCE_DIR}" "data")
+
+`Modification`_ and `Generation`_ sub-commands can either store the result
+in-place, or in a separate variable named after an ``OUTPUT_VARIABLE``
+keyword. All other sub-commands store the result in a mandatory ``<out-var>``
+variable.
+
+.. _Normalization:
+
+Normalization
+^^^^^^^^^^^^^
+
+Some sub-commands support *normalizing* a path. The algorithm used to
+normalize a path is as follows:
+
+1. If the path is empty, stop (the normalized form of an empty path is
+ also an empty path).
+2. Replace each ``directory-separator``, which may consist of multiple
+ separators, with a single ``/`` (``/a///b --> /a/b``).
+3. Remove each solitary period (``.``) and any immediately following
+ ``directory-separator`` (``/a/./b/. --> /a/b``).
+4. Remove each ``item-name`` (other than ``..``) that is immediately
+ followed by a ``directory-separator`` and a ``..``, along with any
+ immediately following ``directory-separator`` (``/a/b/../c --> a/c``).
+5. If there is a ``root-directory``, remove any ``..`` and any
+ ``directory-separators`` immediately following them. The parent of the
+ root directory is treated as still the root directory (``/../a --> /a``).
+6. If the last ``item-name`` is ``..``, remove any trailing
+ ``directory-separator`` (``../ --> ..``).
+7. If the path is empty by this stage, add a ``dot`` (normal form of ``./``
+ is ``.``).
+
+
+Decomposition
+^^^^^^^^^^^^^
+
+.. _GET:
+.. _GET_ROOT_NAME:
+.. _GET_ROOT_DIRECTORY:
+.. _GET_ROOT_PATH:
+.. _GET_FILENAME:
+.. _GET_EXTENSION:
+.. _GET_STEM:
+.. _GET_RELATIVE_PART:
+.. _GET_PARENT_PATH:
+
+The following forms of the ``GET`` subcommand each retrieve a different
+component or group of components from a path. See
+`Path Structure And Terminology`_ for the meaning of each path component.
+
+::
+
+ cmake_path(GET <path-var> ROOT_NAME <out-var>)
+ cmake_path(GET <path-var> ROOT_DIRECTORY <out-var>)
+ cmake_path(GET <path-var> ROOT_PATH <out-var>)
+ cmake_path(GET <path-var> FILENAME <out-var>)
+ cmake_path(GET <path-var> EXTENSION [LAST_ONLY] <out-var>)
+ cmake_path(GET <path-var> STEM [LAST_ONLY] <out-var>)
+ cmake_path(GET <path-var> RELATIVE_PART <out-var>)
+ cmake_path(GET <path-var> PARENT_PATH <out-var>)
+
+If a requested component is not present in the path, an empty string will be
+stored in ``<out-var>``. For example, only Windows systems have the concept
+of a ``root-name``, so when the host machine is non-Windows, the ``ROOT_NAME``
+subcommand will always return an empty string.
+
+For ``PARENT_PATH``, if the `HAS_RELATIVE_PART`_ subcommand returns false,
+the result is a copy of ``<path-var>``. Note that this implies that a root
+directory is considered to have a parent, with that parent being itself.
+Where `HAS_RELATIVE_PART`_ returns true, the result will essentially be
+``<path-var>`` with one less element.
+
+Root examples
+"""""""""""""
+
+.. code-block:: cmake
+
+ set(path "c:/a")
+
+ cmake_path(GET path ROOT_NAME rootName)
+ cmake_path(GET path ROOT_DIRECTORY rootDir)
+ cmake_path(GET path ROOT_PATH rootPath)
+
+ message("Root name is \"${rootName}\"")
+ message("Root directory is \"${rootDir}\"")
+ message("Root path is \"${rootPath}\"")
+
+::
+
+ Root name is "c:"
+ Root directory is "/"
+ Root path is "c:/"
+
+Filename examples
+"""""""""""""""""
+
+.. code-block:: cmake
+
+ set(path "/a/b")
+ cmake_path(GET path FILENAME filename)
+ message("First filename is \"${filename}\"")
+
+ # Trailing slash means filename is empty
+ set(path "/a/b/")
+ cmake_path(GET path FILENAME filename)
+ message("Second filename is \"${filename}\"")
+
+::
+
+ First filename is "b"
+ Second filename is ""
+
+Extension and stem examples
+"""""""""""""""""""""""""""
+
+.. code-block:: cmake
+
+ set(path "name.ext1.ext2")
+
+ cmake_path(GET path EXTENSION fullExt)
+ cmake_path(GET path STEM fullStem)
+ message("Full extension is \"${fullExt}\"")
+ message("Full stem is \"${fullStem}\"")
+
+ # Effect of LAST_ONLY
+ cmake_path(GET path EXTENSION LAST_ONLY lastExt)
+ cmake_path(GET path STEM LAST_ONLY lastStem)
+ message("Last extension is \"${lastExt}\"")
+ message("Last stem is \"${lastStem}\"")
+
+ # Special cases
+ set(dotPath "/a/.")
+ set(dotDotPath "/a/..")
+ set(someMorePath "/a/.some.more")
+ cmake_path(GET dotPath EXTENSION dotExt)
+ cmake_path(GET dotPath STEM dotStem)
+ cmake_path(GET dotDotPath EXTENSION dotDotExt)
+ cmake_path(GET dotDotPath STEM dotDotStem)
+ cmake_path(GET dotMorePath EXTENSION someMoreExt)
+ cmake_path(GET dotMorePath STEM someMoreStem)
+ message("Dot extension is \"${dotExt}\"")
+ message("Dot stem is \"${dotStem}\"")
+ message("Dot-dot extension is \"${dotDotExt}\"")
+ message("Dot-dot stem is \"${dotDotStem}\"")
+ message(".some.more extension is \"${someMoreExt}\"")
+ message(".some.more stem is \"${someMoreStem}\"")
+
+::
+
+ Full extension is ".ext1.ext2"
+ Full stem is "name"
+ Last extension is ".ext2"
+ Last stem is "name.ext1"
+ Dot extension is ""
+ Dot stem is "."
+ Dot-dot extension is ""
+ Dot-dot stem is ".."
+ .some.more extension is ".more"
+ .some.more stem is ".some"
+
+Relative part examples
+""""""""""""""""""""""
+
+.. code-block:: cmake
+
+ set(path "c:/a/b")
+ cmake_path(GET path RELATIVE_PART result)
+ message("Relative part is \"${result}\"")
+
+ set(path "c/d")
+ cmake_path(GET path RELATIVE_PART result)
+ message("Relative part is \"${result}\"")
+
+ set(path "/")
+ cmake_path(GET path RELATIVE_PART result)
+ message("Relative part is \"${result}\"")
+
+::
+
+ Relative part is "a/b"
+ Relative part is "c/d"
+ Relative part is ""
+
+Path traversal examples
+"""""""""""""""""""""""
+
+.. code-block:: cmake
+
+ set(path "c:/a/b")
+ cmake_path(GET path PARENT_PATH result)
+ message("Parent path is \"${result}\"")
+
+ set(path "c:/")
+ cmake_path(GET path PARENT_PATH result)
+ message("Parent path is \"${result}\"")
+
+::
+
+ Parent path is "c:/a"
+ Parent path is "c:/"
+
+
+Query
+^^^^^
+
+Each of the ``GET`` subcommands has a corresponding ``HAS_...``
+subcommand which can be used to discover whether a particular path
+component is present. See `Path Structure And Terminology`_ for the
+meaning of each path component.
+
+.. _HAS_ROOT_NAME:
+.. _HAS_ROOT_DIRECTORY:
+.. _HAS_ROOT_PATH:
+.. _HAS_FILENAME:
+.. _HAS_EXTENSION:
+.. _HAS_STEM:
+.. _HAS_RELATIVE_PART:
+.. _HAS_PARENT_PATH:
+
+::
+
+ cmake_path(HAS_ROOT_NAME <path-var> <out-var>)
+ cmake_path(HAS_ROOT_DIRECTORY <path-var> <out-var>)
+ cmake_path(HAS_ROOT_PATH <path-var> <out-var>)
+ cmake_path(HAS_FILENAME <path-var> <out-var>)
+ cmake_path(HAS_EXTENSION <path-var> <out-var>)
+ cmake_path(HAS_STEM <path-var> <out-var>)
+ cmake_path(HAS_RELATIVE_PART <path-var> <out-var>)
+ cmake_path(HAS_PARENT_PATH <path-var> <out-var>)
+
+Each of the above follows the predictable pattern of setting ``<out-var>``
+to true if the path has the associated component, or false otherwise.
+Note the following special cases:
+
+* For ``HAS_ROOT_PATH``, a true result will only be returned if at least one
+ of ``root-name`` or ``root-directory`` is non-empty.
+
+* For ``HAS_PARENT_PATH``, the root directory is also considered to have a
+ parent, which will be itself. The result is true except if the path
+ consists of just a :ref:`filename <FILENAME_DEF>`.
+
+.. _IS_ABSOLUTE:
+
+::
+
+ cmake_path(IS_ABSOLUTE <path-var> <out-var>)
+
+Sets ``<out-var>`` to true if ``<path-var>`` is absolute. An absolute path
+is a path that unambiguously identifies the location of a file without
+reference to an additional starting location. On Windows, this means the
+path must have both a ``root-name`` and a ``root-directory-separator`` to be
+considered absolute. On other platforms, just a ``root-directory-separator``
+is sufficient. Note that this means on Windows, ``IS_ABSOLUTE`` can be
+false while ``HAS_ROOT_DIRECTORY`` can be true.
+
+.. _IS_RELATIVE:
+
+::
+
+ cmake_path(IS_RELATIVE <path-var> <out-var>)
+
+This will store the opposite of ``IS_ABSOLUTE`` in ``<out-var>``.
+
+.. _IS_PREFIX:
+
+::
+
+ cmake_path(IS_PREFIX <path-var> <input> [NORMALIZE] <out-var>)
+
+Checks if ``<path-var>`` is the prefix of ``<input>``.
+
+When the ``NORMALIZE`` option is specified, ``<path-var>`` and ``<input>``
+are :ref:`normalized <Normalization>` before the check.
+
+.. code-block:: cmake
+
+ set(path "/a/b/c/d")
+ cmake_path(IS_PREFIX path "/a/b" result) # result = true
+ cmake_path(IS_PREFIX path "/x/y/z" result) # result = false
+
+ set(path "/a/b")
+ cmake_path(IS_PREFIX path "/a/c/../b" NORMALIZE result) # result = true
+
+.. _COMPARE:
+
+::
+
+ cmake_path(COMPARE <input1> EQUAL <input2> <out-var>)
+ cmake_path(COMPARE <input1> NOT_EQUAL <input2> <out-var>)
+
+Compares the lexical representations of two paths provided as string literals.
+No normalization is performed on either path. Equality is determined
+according to the following pseudo-code logic:
+
+::
+
+ if(NOT <input1>.root_name() STREQUAL <input2>.root_name())
+ return FALSE
+
+ if(<input1>.has_root_directory() XOR <input2>.has_root_directory())
+ return FALSE
+
+ Return FALSE if a relative portion of <input1> is not lexicographically
+ equal to the relative portion of <input2>. This comparison is performed path
+ component-wise. If all of the components compare equal, then return TRUE.
+
+.. note::
+ Unlike most other ``cmake_path()`` subcommands, the ``COMPARE`` subcommand
+ takes literal strings as input, not the names of variables.
+
+
+Modification
+^^^^^^^^^^^^
+
+.. _cmake_path-SET:
+
+::
+
+ cmake_path(SET <path-var> [NORMALIZE] <input>)
+
+Assign the ``<input>`` path to ``<path-var>``. If ``<input>`` is a native
+path, it is converted into a cmake-style path with forward-slashes
+(``/``). On Windows, the long filename marker is taken into account.
+
+When the ``NORMALIZE`` option is specified, the path is :ref:`normalized
+<Normalization>` before the conversion.
+
+For example:
+
+.. code-block:: cmake
+
+ set(native_path "c:\\a\\b/..\\c")
+ cmake_path(SET path "${native_path}")
+ message("CMake path is \"${path}\"")
+
+ cmake_path(SET path NORMALIZE "${native_path}")
+ message("Normalized CMake path is \"${path}\"")
+
+Output::
+
+ CMake path is "c:/a/b/../c"
+ Normalized CMake path is "c:/a/c"
+
+.. _APPEND:
+
+::
+
+ cmake_path(APPEND <path-var> [<input>...] [OUTPUT_VARIABLE <out-var>])
+
+Append all the ``<input>`` arguments to the ``<path-var>`` using ``/`` as
+the ``directory-separator``. Depending on the ``<input>``, the previous
+contents of ``<path-var>`` may be discarded. For each ``<input>`` argument,
+the following algorithm (pseudo-code) applies:
+
+::
+
+ # <path> is the contents of <path-var>
+
+ if(<input>.is_absolute() OR
+ (<input>.has_root_name() AND
+ NOT <input>.root_name() STREQUAL <path>.root_name()))
+ replace <path> with <input>
+ return()
+ endif()
+
+ if(<input>.has_root_directory())
+ remove any root-directory and the entire relative path from <path>
+ elseif(<path>.has_filename() OR
+ (NOT <path-var>.has_root_directory() OR <path>.is_absolute()))
+ append directory-separator to <path>
+ endif()
+
+ append <input> omitting any root-name to <path>
+
+.. _APPEND_STRING:
+
+::
+
+ cmake_path(APPEND_STRING <path-var> [<input>...] [OUTPUT_VARIABLE <out-var>])
+
+Append all the ``<input>`` arguments to the ``<path-var>`` without adding any
+``directory-separator``.
+
+.. _REMOVE_FILENAME:
+
+::
+
+ cmake_path(REMOVE_FILENAME <path-var> [OUTPUT_VARIABLE <out-var>])
+
+Removes the :ref:`filename <FILENAME_DEF>` component (as returned by
+:ref:`GET ... FILENAME <GET_FILENAME>`) from ``<path-var>``. After removal,
+any trailing ``directory-separator`` is left alone, if present.
+
+If ``OUTPUT_VARIABLE`` is not given, then after this function returns,
+`HAS_FILENAME`_ returns false for ``<path-var>``.
+
+For example:
+
+.. code-block:: cmake
+
+ set(path "/a/b")
+ cmake_path(REMOVE_FILENAME path)
+ message("First path is \"${path}\"")
+
+ # filename is now already empty, the following removes nothing
+ cmake_path(REMOVE_FILENAME path)
+ message("Second path is \"${result}\"")
+
+Output::
+
+ First path is "/a/"
+ Second path is "/a/"
+
+.. _REPLACE_FILENAME:
+
+::
+
+ cmake_path(REPLACE_FILENAME <path-var> <input> [OUTPUT_VARIABLE <out-var>])
+
+Replaces the :ref:`filename <FILENAME_DEF>` component from ``<path-var>``
+with ``<input>``. If ``<path-var>`` has no filename component (i.e.
+`HAS_FILENAME`_ returns false), the path is unchanged. The operation is
+equivalent to the following:
+
+.. code-block:: cmake
+
+ cmake_path(HAS_FILENAME path has_filename)
+ if(has_filename)
+ cmake_path(REMOVE_FILENAME path)
+ cmake_path(APPEND path input);
+ endif()
+
+.. _REMOVE_EXTENSION:
+
+::
+
+ cmake_path(REMOVE_EXTENSION <path-var> [LAST_ONLY]
+ [OUTPUT_VARIABLE <out-var>])
+
+Removes the :ref:`extension <EXTENSION_DEF>`, if any, from ``<path-var>``.
+
+.. _REPLACE_EXTENSION:
+
+::
+
+ cmake_path(REPLACE_EXTENSION <path-var> [LAST_ONLY] <input>
+ [OUTPUT_VARIABLE <out-var>])
+
+Replaces the :ref:`extension <EXTENSION_DEF>` with ``<input>``. Its effect
+is equivalent to the following:
+
+.. code-block:: cmake
+
+ cmake_path(REMOVE_EXTENSION path)
+ if(NOT "input" MATCHES "^\\.")
+ cmake_path(APPEND_STRING path ".")
+ endif()
+ cmake_path(APPEND_STRING path "input")
+
+
+Generation
+^^^^^^^^^^
+
+.. _NORMAL_PATH:
+
+::
+
+ cmake_path(NORMAL_PATH <path-var> [OUTPUT_VARIABLE <out-var>])
+
+Normalize ``<path-var>`` according the steps described in :ref:`Normalization`.
+
+.. _cmake_path-RELATIVE_PATH:
+.. _RELATIVE_PATH:
+
+::
+
+ cmake_path(RELATIVE_PATH <path-var> [BASE_DIRECTORY <input>]
+ [OUTPUT_VARIABLE <out-var>])
+
+Modifies ``<path-var>`` to make it relative to the ``BASE_DIRECTORY`` argument.
+If ``BASE_DIRECTORY`` is not specified, the default base directory will be
+:variable:`CMAKE_CURRENT_SOURCE_DIR`.
+
+For reference, the algorithm used to compute the relative path is the same
+as that used by C++
+`std::filesystem::path::lexically_relative
+<https://en.cppreference.com/w/cpp/filesystem/path/lexically_normal>`_.
+
+.. _ABSOLUTE_PATH:
+
+::
+
+ cmake_path(ABSOLUTE_PATH <path-var> [BASE_DIRECTORY <input>] [NORMALIZE]
+ [OUTPUT_VARIABLE <out-var>])
+
+If ``<path-var>`` is a relative path (`IS_RELATIVE`_ is true), it is evaluated
+relative to the given base directory specified by ``BASE_DIRECTORY`` option.
+If ``BASE_DIRECTORY`` is not specified, the default base directory will be
+:variable:`CMAKE_CURRENT_SOURCE_DIR`.
+
+When the ``NORMALIZE`` option is specified, the path is :ref:`normalized
+<Normalization>` after the path computation.
+
+Because ``cmake_path()`` does not access the filesystem, symbolic links are
+not resolved. To compute a real path with symbolic links resolved, use the
+:command:`file(REAL_PATH)` command instead.
+
+Native Conversion
+^^^^^^^^^^^^^^^^^
+
+For commands in this section, *native* refers to the host platform, not the
+target platform when cross-compiling.
+
+.. _cmake_path-NATIVE_PATH:
+.. _NATIVE_PATH:
+
+::
+
+ cmake_path(NATIVE_PATH <path-var> [NORMALIZE] <out-var>)
+
+Converts a cmake-style ``<path-var>`` into a native path with
+platform-specific slashes (``\`` on Windows hosts and ``/`` elsewhere).
+
+When the ``NORMALIZE`` option is specified, the path is :ref:`normalized
+<Normalization>` before the conversion.
+
+.. _CONVERT:
+.. _cmake_path-TO_CMAKE_PATH_LIST:
+.. _TO_CMAKE_PATH_LIST:
+
+::
+
+ cmake_path(CONVERT <input> TO_CMAKE_PATH_LIST <out-var> [NORMALIZE])
+
+Converts a native ``<input>`` path into a cmake-style path with forward
+slashes (``/``). On Windows hosts, the long filename marker is taken into
+account. The input can be a single path or a system search path like
+``$ENV{PATH}``. A search path will be converted to a cmake-style list
+separated by ``;`` characters (on non-Windows platforms, this essentially
+means ``:`` separators are replaced with ``;``). The result of the
+conversion is stored in the ``<out-var>`` variable.
+
+When the ``NORMALIZE`` option is specified, the path is :ref:`normalized
+<Normalization>` before the conversion.
+
+.. note::
+ Unlike most other ``cmake_path()`` subcommands, the ``CONVERT`` subcommand
+ takes a literal string as input, not the name of a variable.
+
+.. _cmake_path-TO_NATIVE_PATH_LIST:
+.. _TO_NATIVE_PATH_LIST:
+
+::
+
+ cmake_path(CONVERT <input> TO_NATIVE_PATH_LIST <out-var> [NORMALIZE])
+
+Converts a cmake-style ``<input>`` path into a native path with
+platform-specific slashes (``\`` on Windows hosts and ``/`` elsewhere).
+The input can be a single path or a cmake-style list. A list will be
+converted into a native search path (``;``-separated on Windows,
+``:``-separated on other platforms). The result of the conversion is
+stored in the ``<out-var>`` variable.
+
+When the ``NORMALIZE`` option is specified, the path is :ref:`normalized
+<Normalization>` before the conversion.
+
+.. note::
+ Unlike most other ``cmake_path()`` subcommands, the ``CONVERT`` subcommand
+ takes a literal string as input, not the name of a variable.
+
+For example:
+
+.. code-block:: cmake
+
+ set(paths "/a/b/c" "/x/y/z")
+ cmake_path(CONVERT "${paths}" TO_NATIVE_PATH_LIST native_paths)
+ message("Native path list is \"${native_paths}\"")
+
+Output on Windows::
+
+ Native path list is "\a\b\c;\x\y\z"
+
+Output on all other platforms::
+
+ Native path list is "/a/b/c:/x/y/z"
+
+Hashing
+^^^^^^^
+
+.. _HASH:
+
+::
+
+ cmake_path(HASH <path-var> <out-var>)
+
+Compute a hash value of ``<path-var>`` such that for two paths ``p1`` and
+``p2`` that compare equal (:ref:`COMPARE ... EQUAL <COMPARE>`), the hash
+value of ``p1`` is equal to the hash value of ``p2``. The path is always
+:ref:`normalized <Normalization>` before the hash is computed.
diff --git a/Help/command/cmake_policy.rst b/Help/command/cmake_policy.rst
index 4bc7807bb..94060d9b8 100644
--- a/Help/command/cmake_policy.rst
+++ b/Help/command/cmake_policy.rst
@@ -28,6 +28,9 @@ encourage projects to set policies based on CMake versions:
cmake_policy(VERSION <min>[...<max>])
+.. versionadded:: 3.12
+ The optional ``<max>`` version.
+
``<min>`` and the optional ``<max>`` are each CMake versions of the form
``major.minor[.patch[.tweak]]``, and the ``...`` is literal. The ``<min>``
version must be at least ``2.4`` and at most the running version of CMake.
diff --git a/Help/command/configure_file.rst b/Help/command/configure_file.rst
index c59995ae2..63ea84d1b 100644
--- a/Help/command/configure_file.rst
+++ b/Help/command/configure_file.rst
@@ -6,8 +6,9 @@ Copy a file to another location and modify its contents.
.. code-block:: cmake
configure_file(<input> <output>
+ [FILE_PERMISSIONS <permissions>...]
[COPYONLY] [ESCAPE_QUOTES] [@ONLY]
- [NO_SOURCE_PERMISSIONS]
+ [NO_SOURCE_PERMISSIONS] [USE_SOURCE_PERMISSIONS]
[NEWLINE_STYLE [UNIX|DOS|WIN32|LF|CRLF] ])
Copies an ``<input>`` file to an ``<output>`` file and substitutes
@@ -37,22 +38,24 @@ a false constant by the :command:`if` command. The "..." content on the
line after the variable name, if any, is processed as above.
Input file lines of the form ``#cmakedefine01 VAR`` will be replaced with
either ``#define VAR 1`` or ``#define VAR 0`` similarly.
-The result lines (with the exception of the ``#undef`` comments) can be
-indented using spaces and/or tabs between the ``#`` character
-and the ``cmakedefine`` or ``cmakedefine01`` words. This whitespace
-indentation will be preserved in the output lines:
-.. code-block:: c
+.. versionadded:: 3.10
+ The result lines (with the exception of the ``#undef`` comments) can be
+ indented using spaces and/or tabs between the ``#`` character
+ and the ``cmakedefine`` or ``cmakedefine01`` words. This whitespace
+ indentation will be preserved in the output lines:
- # cmakedefine VAR
- # cmakedefine01 VAR
+ .. code-block:: c
-will be replaced, if ``VAR`` is defined, with
+ # cmakedefine VAR
+ # cmakedefine01 VAR
-.. code-block:: c
+ will be replaced, if ``VAR`` is defined, with
- # define VAR
- # define VAR 1
+ .. code-block:: c
+
+ # define VAR
+ # define VAR 1
If the input file is modified the build system will re-run CMake to
re-configure the file and generate the build system again.
@@ -72,6 +75,9 @@ The arguments are:
If the path names an existing directory the output file is placed
in that directory with the same file name as the input file.
+``FILE_PERMISSIONS <permissions>...``
+ Use user provided permissions for the output file.
+
``COPYONLY``
Copy the file without replacing any variable references or other
content. This option may not be used with ``NEWLINE_STYLE``.
@@ -84,10 +90,17 @@ The arguments are:
This is useful for configuring scripts that use ``${VAR}`` syntax.
``NO_SOURCE_PERMISSIONS``
+ .. versionadded:: 3.19
+
Does not transfer the file permissions of the original file to the copy.
The copied file permissions default to the standard 644 value
(-rw-r--r--).
+``USE_SOURCE_PERMISSIONS``
+ .. versionadded:: 3.20
+
+ Transfer the file permissions of the original file to the output file.
+
``NEWLINE_STYLE <style>``
Specify the newline style for the output file. Specify
``UNIX`` or ``LF`` for ``\n`` newlines, or specify
diff --git a/Help/command/ctest_build.rst b/Help/command/ctest_build.rst
index 66e1844e9..4d6dc5a43 100644
--- a/Help/command/ctest_build.rst
+++ b/Help/command/ctest_build.rst
@@ -50,7 +50,10 @@ The options are:
for an example.
``PROJECT_NAME <project-name>``
- Ignored. This was once used but is no longer needed.
+ Ignored since CMake 3.0.
+
+ .. versionchanged:: 3.14
+ This value is no longer required.
``TARGET <target-name>``
Specify the name of a target to build. If not specified the
@@ -68,10 +71,14 @@ The options are:
Store the return value of the native build tool in the given variable.
``CAPTURE_CMAKE_ERROR <result-var>``
+ .. versionadded:: 3.7
+
Store in the ``<result-var>`` variable -1 if there are any errors running
the command and prevent ctest from returning non-zero if an error occurs.
``QUIET``
+ .. versionadded:: 3.3
+
Suppress any CTest-specific non-error output that would have been
printed to the console otherwise. The summary of warnings / errors,
as well as the output from the native build tool is unaffected by
diff --git a/Help/command/ctest_configure.rst b/Help/command/ctest_configure.rst
index 2dea07b16..95712aac0 100644
--- a/Help/command/ctest_configure.rst
+++ b/Help/command/ctest_configure.rst
@@ -37,10 +37,14 @@ The options are:
configuration tool.
``CAPTURE_CMAKE_ERROR <result-var>``
+ .. versionadded:: 3.7
+
Store in the ``<result-var>`` variable -1 if there are any errors running
the command and prevent ctest from returning non-zero if an error occurs.
``QUIET``
+ .. versionadded:: 3.3
+
Suppress any CTest-specific non-error messages that would have
otherwise been printed to the console. Output from the underlying
configure command is not affected.
diff --git a/Help/command/ctest_coverage.rst b/Help/command/ctest_coverage.rst
index d50f63498..a6c643bbc 100644
--- a/Help/command/ctest_coverage.rst
+++ b/Help/command/ctest_coverage.rst
@@ -37,10 +37,14 @@ The options are:
ran without error and non-zero otherwise.
``CAPTURE_CMAKE_ERROR <result-var>``
+ .. versionadded:: 3.7
+
Store in the ``<result-var>`` variable -1 if there are any errors running
the command and prevent ctest from returning non-zero if an error occurs.
``QUIET``
+ .. versionadded:: 3.3
+
Suppress any CTest-specific non-error output that would have been
printed to the console otherwise. The summary indicating how many
lines of code were covered is unaffected by this option.
diff --git a/Help/command/ctest_memcheck.rst b/Help/command/ctest_memcheck.rst
index 288b65a25..f655c2eb2 100644
--- a/Help/command/ctest_memcheck.rst
+++ b/Help/command/ctest_memcheck.rst
@@ -35,4 +35,6 @@ Most options are the same as those for the :command:`ctest_test` command.
The options unique to this command are:
``DEFECT_COUNT <defect-count-var>``
+ .. versionadded:: 3.8
+
Store in the ``<defect-count-var>`` the number of defects found.
diff --git a/Help/command/ctest_start.rst b/Help/command/ctest_start.rst
index f0704aca5..c0f3c6d3c 100644
--- a/Help/command/ctest_start.rst
+++ b/Help/command/ctest_start.rst
@@ -29,8 +29,11 @@ The parameters are as follows:
``GROUP <group>``
If ``GROUP`` is used, the submissions will go to the specified group on the
CDash server. If no ``GROUP`` is specified, the name of the model is used by
- default. This replaces the deprecated option ``TRACK``. Despite the name
- change its behavior is unchanged.
+ default.
+
+ .. versionchanged:: 3.16
+ This replaces the deprecated option ``TRACK``. Despite the name
+ change its behavior is unchanged.
``APPEND``
If ``APPEND`` is used, the existing ``TAG`` is used rather than creating a new
@@ -56,6 +59,8 @@ The parameters are as follows:
new model and group will be used.
``QUIET``
+ .. versionadded:: 3.3
+
If ``QUIET`` is used, CTest will suppress any non-error messages that it
otherwise would have printed to the console.
diff --git a/Help/command/ctest_submit.rst b/Help/command/ctest_submit.rst
index 983fc20ce..e6d277f59 100644
--- a/Help/command/ctest_submit.rst
+++ b/Help/command/ctest_submit.rst
@@ -42,14 +42,20 @@ The options are:
Each individual file must exist at the time of the call.
``SUBMIT_URL <url>``
+ .. versionadded:: 3.14
+
The ``http`` or ``https`` URL of the dashboard server to send the submission
to. If not given, the :variable:`CTEST_SUBMIT_URL` variable is used.
``BUILD_ID <result-var>``
+ .. versionadded:: 3.15
+
Store in the ``<result-var>`` variable the ID assigned to this build by
CDash.
``HTTPHEADER <HTTP-header>``
+ .. versionadded:: 3.9
+
Specify HTTP header to be included in the request to CDash during submission.
For example, CDash can be configured to only accept submissions from
authenticated clients. In this case, you should provide a bearer token in your
@@ -73,20 +79,27 @@ The options are:
non-zero on failure.
``CAPTURE_CMAKE_ERROR <result-var>``
+ .. versionadded:: 3.13
+
Store in the ``<result-var>`` variable -1 if there are any errors running
the command and prevent ctest from returning non-zero if an error occurs.
``QUIET``
+ .. versionadded:: 3.3
+
Suppress all non-error messages that would have otherwise been
printed to the console.
Submit to CDash Upload API
^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. versionadded:: 3.2
+
::
ctest_submit(CDASH_UPLOAD <file> [CDASH_UPLOAD_TYPE <type>]
[SUBMIT_URL <url>]
+ [BUILD_ID <result-var>]
[HTTPHEADER <header>]
[RETRY_COUNT <count>]
[RETRY_DELAY <delay>]
@@ -99,6 +112,19 @@ with a content hash of the file. If CDash does not already have the file,
then it is uploaded. Along with the file, a CDash type string is specified
to tell CDash which handler to use to process the data.
-This signature accepts the ``SUBMIT_URL``, ``BUILD_ID``, ``HTTPHEADER``,
-``RETRY_COUNT``, ``RETRY_DELAY``, ``RETURN_VALUE`` and ``QUIET`` options
-as described above.
+This signature interprets options in the same way as the first one.
+
+.. versionadded:: 3.8
+ Added the ``RETRY_COUNT``, ``RETRY_DELAY``, ``QUIET`` options.
+
+.. versionadded:: 3.9
+ Added the ``HTTPHEADER`` option.
+
+.. versionadded:: 3.13
+ Added the ``RETURN_VALUE`` option.
+
+.. versionadded:: 3.14
+ Added the ``SUBMIT_URL`` option.
+
+.. versionadded:: 3.15
+ Added the ``BUILD_ID`` option.
diff --git a/Help/command/ctest_test.rst b/Help/command/ctest_test.rst
index 3589296ad..b4493a03d 100644
--- a/Help/command/ctest_test.rst
+++ b/Help/command/ctest_test.rst
@@ -68,6 +68,8 @@ The options are:
Tests not matching this expression are excluded.
``EXCLUDE_FIXTURE <regex>``
+ .. versionadded:: 3.7
+
If a test in the set of tests to be executed requires a particular fixture,
that fixture's setup and cleanup tests would normally be added to the test
set automatically. This option prevents adding setup or cleanup tests for
@@ -76,9 +78,13 @@ The options are:
setup tests that fail.
``EXCLUDE_FIXTURE_SETUP <regex>``
+ .. versionadded:: 3.7
+
Same as ``EXCLUDE_FIXTURE`` except only matching setup tests are excluded.
``EXCLUDE_FIXTURE_CLEANUP <regex>``
+ .. versionadded:: 3.7
+
Same as ``EXCLUDE_FIXTURE`` except only matching cleanup tests are excluded.
``PARALLEL_LEVEL <level>``
@@ -86,11 +92,15 @@ The options are:
be run in parallel.
``RESOURCE_SPEC_FILE <file>``
+ .. versionadded:: 3.16
+
Specify a
:ref:`resource specification file <ctest-resource-specification-file>`. See
:ref:`ctest-resource-allocation` for more information.
``TEST_LOAD <threshold>``
+ .. versionadded:: 3.4
+
While running tests in parallel, try not to start tests when they
may cause the CPU load to pass above a given threshold. If not
specified the :variable:`CTEST_TEST_LOAD` variable will be checked,
@@ -98,6 +108,8 @@ The options are:
See also the ``TestLoad`` setting in the :ref:`CTest Test Step`.
``REPEAT <mode>:<n>``
+ .. versionadded:: 3.17
+
Run tests repeatedly based on the given ``<mode>`` up to ``<n>`` times.
The modes are:
@@ -121,6 +133,8 @@ The options are:
implicit test dependencies.
``STOP_ON_FAILURE``
+ .. versionadded:: 3.18
+
Stop the execution of the tests once one has failed.
``STOP_TIME <time-of-day>``
@@ -131,10 +145,14 @@ The options are:
Store non-zero if anything went wrong.
``CAPTURE_CMAKE_ERROR <result-var>``
+ .. versionadded:: 3.7
+
Store in the ``<result-var>`` variable -1 if there are any errors running
the command and prevent ctest from returning non-zero if an error occurs.
``QUIET``
+ .. versionadded:: 3.3
+
Suppress any CTest-specific non-error messages that would have otherwise
been printed to the console. Output from the underlying test command is not
affected. Summary info detailing the percentage of passing tests is also
diff --git a/Help/command/ctest_update.rst b/Help/command/ctest_update.rst
index 96a11c913..63f991b5e 100644
--- a/Help/command/ctest_update.rst
+++ b/Help/command/ctest_update.rst
@@ -24,10 +24,14 @@ The options are:
updated or ``-1`` on error.
``CAPTURE_CMAKE_ERROR <result-var>``
+ .. versionadded:: 3.13
+
Store in the ``<result-var>`` variable -1 if there are any errors running
the command and prevent ctest from returning non-zero if an error occurs.
``QUIET``
+ .. versionadded:: 3.3
+
Tell CTest to suppress most non-error messages that it would
have otherwise printed to the console. CTest will still report
the new revision of the repository and any conflicting files
diff --git a/Help/command/ctest_upload.rst b/Help/command/ctest_upload.rst
index 39d9de1a3..ffddd0a43 100644
--- a/Help/command/ctest_upload.rst
+++ b/Help/command/ctest_upload.rst
@@ -14,9 +14,13 @@ The options are:
dashboard server.
``QUIET``
+ .. versionadded:: 3.3
+
Suppress any CTest-specific non-error output that would have been
printed to the console otherwise.
``CAPTURE_CMAKE_ERROR <result-var>``
+ .. versionadded:: 3.7
+
Store in the ``<result-var>`` variable -1 if there are any errors running
the command and prevent ctest from returning non-zero if an error occurs.
diff --git a/Help/command/enable_language.rst b/Help/command/enable_language.rst
index e8640eadc..ce765de68 100644
--- a/Help/command/enable_language.rst
+++ b/Help/command/enable_language.rst
@@ -12,6 +12,15 @@ variables that are created by the project command. Example languages
are ``CXX``, ``C``, ``CUDA``, ``OBJC``, ``OBJCXX``, ``Fortran``,
``ISPC``, and ``ASM``.
+.. versionadded:: 3.8
+ Added ``CUDA`` support.
+
+.. versionadded:: 3.16
+ Added ``OBJC`` and ``OBJCXX`` support.
+
+.. versionadded:: 3.18
+ Added ``ISPC`` support.
+
If enabling ``ASM``, enable it last so that CMake can check whether
compilers for other languages like ``C`` work for assembly too.
diff --git a/Help/command/execute_process.rst b/Help/command/execute_process.rst
index 268c3075b..82fcd46a5 100644
--- a/Help/command/execute_process.rst
+++ b/Help/command/execute_process.rst
@@ -62,6 +62,8 @@ Options:
describing an error condition.
``RESULTS_VARIABLE <variable>``
+ .. versionadded:: 3.10
+
The variable will be set to contain the result of all processes as a
:ref:`semicolon-separated list <CMake Language Lists>`, in order of the
given ``COMMAND`` arguments. Each entry will be an integer return code
@@ -75,19 +77,26 @@ Options:
``INPUT_FILE, OUTPUT_FILE``, ``ERROR_FILE``
The file named will be attached to the standard input of the first
process, standard output of the last process, or standard error of
- all processes, respectively. If the same file is named for both
- output and error then it will be used for both.
+ all processes, respectively.
+
+ .. versionadded:: 3.3
+ If the same file is named for both output and error then it will be used
+ for both.
``OUTPUT_QUIET``, ``ERROR_QUIET``
The standard output or standard error results will be quietly ignored.
``COMMAND_ECHO <where>``
+ .. versionadded:: 3.15
+
The command being run will be echo'ed to ``<where>`` with ``<where>``
being set to one of ``STDERR``, ``STDOUT`` or ``NONE``.
See the :variable:`CMAKE_EXECUTE_PROCESS_COMMAND_ECHO` variable for a way
to control the default behavior when this option is not present.
``ENCODING <name>``
+ .. versionadded:: 3.8
+
On Windows, the encoding that is used to decode output from the process.
Ignored on other platforms.
Valid encoding names are:
@@ -104,11 +113,15 @@ Options:
``OEM``
Use the original equipment manufacturer (OEM) code page.
``UTF8`` or ``UTF-8``
- Use the UTF-8 codepage. Prior to CMake 3.11.0, only ``UTF8`` was accepted
- 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.
+ Use the UTF-8 codepage.
+
+ .. versionadded:: 3.11
+ Accept ``UTF-8`` spelling for consistency with the
+ `UTF-8 RFC <https://www.ietf.org/rfc/rfc3629>`_ naming convention.
``ECHO_OUTPUT_VARIABLE``, ``ECHO_ERROR_VARIABLE``
+ .. versionadded:: 3.18
+
The standard output or standard error will not be exclusively redirected to
the configured variables.
@@ -118,6 +131,8 @@ Options:
This is analogous to the ``tee`` Unix command.
``COMMAND_ERROR_IS_FATAL <ANY|LAST>``
+ .. versionadded:: 3.19
+
The option following ``COMMAND_ERROR_IS_FATAL`` determines the behavior when
an error is encountered:
diff --git a/Help/command/export.rst b/Help/command/export.rst
index 2ca705616..e8a1fa70e 100644
--- a/Help/command/export.rst
+++ b/Help/command/export.rst
@@ -64,16 +64,23 @@ build tree. In some cases, for example for packaging and for system
wide installations, it is not desirable to write the user package
registry.
-By default the ``export(PACKAGE)`` command does nothing (see policy
-:policy:`CMP0090`) because populating the user package registry has effects
-outside the source and build trees. Set the
-:variable:`CMAKE_EXPORT_PACKAGE_REGISTRY` variable to add build directories to
-the CMake user package registry.
+.. versionchanged:: 3.1
+ If the :variable:`CMAKE_EXPORT_NO_PACKAGE_REGISTRY` variable
+ is enabled, the ``export(PACKAGE)`` command will do nothing.
+
+.. versionchanged:: 3.15
+ By default the ``export(PACKAGE)`` command does nothing (see policy
+ :policy:`CMP0090`) because populating the user package registry has effects
+ outside the source and build trees. Set the
+ :variable:`CMAKE_EXPORT_PACKAGE_REGISTRY` variable to add build directories
+ to the CMake user package registry.
.. code-block:: cmake
export(TARGETS [target1 [target2 [...]]] [ANDROID_MK <filename>])
+.. versionadded:: 3.7
+
This signature exports cmake built targets to the android ndk build system
by creating an Android.mk file that references the prebuilt targets. The
Android NDK supports the use of prebuilt libraries, both static and shared.
diff --git a/Help/command/file.rst b/Help/command/file.rst
index e963be0fb..3db605d6a 100644
--- a/Help/command/file.rst
+++ b/Help/command/file.rst
@@ -3,6 +3,21 @@ file
File manipulation command.
+This command is dedicated to file and path manipulation requiring access to the
+filesystem.
+
+For other path manipulation, handling only syntactic aspects, have a look at
+:command:`cmake_path` command.
+
+.. note::
+
+ The sub-commands `RELATIVE_PATH`_, `TO_CMAKE_PATH`_ and `TO_NATIVE_PATH`_ has
+ been superseded, respectively, by sub-commands
+ :ref:`RELATIVE_PATH <cmake_path-RELATIVE_PATH>`,
+ :ref:`CONVERT ... TO_CMAKE_PATH_LIST <cmake_path-TO_CMAKE_PATH_LIST>` and
+ :ref:`CONVERT ... TO_NATIVE_PATH_LIST <cmake_path-TO_NATIVE_PATH_LIST>` of
+ :command:`cmake_path` command.
+
Synopsis
^^^^^^^^
@@ -103,10 +118,15 @@ Parse a list of ASCII strings from ``<filename>`` and store it in
Consider only strings that match the given regular expression.
``ENCODING <encoding-type>``
+ .. versionadded:: 3.1
+
Consider strings of a given encoding. Currently supported encodings are:
- UTF-8, UTF-16LE, UTF-16BE, UTF-32LE, UTF-32BE. If the ENCODING option
- is not provided and the file has a Byte Order Mark, the ENCODING option
- will be defaulted to respect the Byte Order Mark.
+ ``UTF-8``, ``UTF-16LE``, ``UTF-16BE``, ``UTF-32LE``, ``UTF-32BE``.
+ If the ``ENCODING`` option is not provided and the file has a Byte Order Mark,
+ the ``ENCODING`` option will be defaulted to respect the Byte Order Mark.
+
+ .. versionadded:: 3.2
+ Added the ``UTF-16LE``, ``UTF-16BE``, ``UTF-32LE``, ``UTF-32BE`` encodings.
For example, the code
@@ -160,6 +180,8 @@ the ``<format>`` and ``UTC`` options.
[POST_EXCLUDE_REGEXES [<regexes>...]]
)
+.. versionadded:: 3.16
+
Recursively get the list of libraries depended on by the given files.
Please note that this sub-command is not intended to be used in project mode.
@@ -408,6 +430,9 @@ dependency resolution:
If this variable is not specified, it is determined by the value of
``CMAKE_OBJDUMP`` if set, else by system introspection.
+ .. versionadded:: 3.18
+ Use ``CMAKE_OBJDUMP`` if set.
+
Writing
^^^^^^^
@@ -436,6 +461,8 @@ to update the file only when its content changes.
file(TOUCH [<files>...])
file(TOUCH_NOCREATE [<files>...])
+.. versionadded:: 3.12
+
Create a file with no content if it does not yet exist. If the file already
exists, its access and/or modification will be updated to the time when the
function call is executed.
@@ -452,7 +479,10 @@ modified.
file(GENERATE OUTPUT output-file
<INPUT input-file|CONTENT content>
- [CONDITION expression] [TARGET target])
+ [CONDITION expression] [TARGET target]
+ [FILE_PERMISSIONS <permissions>...]
+ [NO_SOURCE_PERMISSIONS] [USE_SOURCE_PERMISSIONS]
+ [NEWLINE_STYLE [UNIX|DOS|WIN32|LF|CRLF] ])
Generate an output file for each build configuration supported by the current
:manual:`CMake Generator <cmake-generators(7)>`. Evaluate
@@ -469,8 +499,10 @@ from the input content to produce the output content. The options are:
``INPUT <input-file>``
Use the content from a given file as input.
- A relative path is treated with respect to the value of
- :variable:`CMAKE_CURRENT_SOURCE_DIR`. See policy :policy:`CMP0070`.
+
+ .. versionchanged:: 3.10
+ A relative path is treated with respect to the value of
+ :variable:`CMAKE_CURRENT_SOURCE_DIR`. See policy :policy:`CMP0070`.
``OUTPUT <output-file>``
Specify the output file name to generate. Use generator expressions
@@ -478,15 +510,37 @@ from the input content to produce the output content. The options are:
name. Multiple configurations may generate the same output file only
if the generated content is identical. Otherwise, the ``<output-file>``
must evaluate to an unique name for each configuration.
- A relative path (after evaluating generator expressions) is treated
- with respect to the value of :variable:`CMAKE_CURRENT_BINARY_DIR`.
- See policy :policy:`CMP0070`.
+
+ .. versionchanged:: 3.10
+ A relative path (after evaluating generator expressions) is treated
+ with respect to the value of :variable:`CMAKE_CURRENT_BINARY_DIR`.
+ See policy :policy:`CMP0070`.
``TARGET <target>``
+ .. versionadded:: 3.19
+
Specify which target to use when evaluating generator expressions that
require a target for evaluation (e.g. ``$<COMPILE_FEATURES:...>``,
``$<TARGET_PROPERTY:prop>``).
+``FILE_PERMISSIONS <permissions>...``
+ Use user provided permissions for the generated file.
+
+``NO_SOURCE_PERMISSIONS``
+ The generated file permissions default to the standard 644 value
+ (-rw-r--r--).
+
+``USE_SOURCE_PERMISSIONS``
+ Transfer the file permissions of the original file to the generated file.
+ This option expects INPUT option.
+
+``NEWLINE_STYLE <style>``
+ .. versionadded:: 3.20
+
+ Specify the newline style for the generated file. Specify
+ ``UNIX`` or ``LF`` for ``\n`` newlines, or specify
+ ``DOS``, ``WIN32``, or ``CRLF`` for ``\r\n`` newlines.
+
Exactly one ``CONTENT`` or ``INPUT`` option must be given. A specific
``OUTPUT`` file may be named by at most one invocation of ``file(GENERATE)``.
Generated files are modified and their timestamp updated on subsequent cmake
@@ -506,6 +560,8 @@ of a project's ``CMakeLists.txt`` files.
[ESCAPE_QUOTES] [@ONLY]
[NEWLINE_STYLE [UNIX|DOS|WIN32|LF|CRLF] ])
+.. versionadded:: 3.18
+
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.
@@ -554,20 +610,25 @@ Generate a list of files that match the ``<globbing-expressions>`` and
store it into the ``<variable>``. Globbing expressions are similar to
regular expressions, but much simpler. If ``RELATIVE`` flag is
specified, the results will be returned as relative paths to the given
-path. The results will be ordered lexicographically.
+path.
+
+.. versionchanged:: 3.6
+ The results will be ordered lexicographically.
On Windows and macOS, globbing is case-insensitive even if the underlying
filesystem is case-sensitive (both filenames and globbing expressions are
converted to lowercase before matching). On other platforms, globbing is
case-sensitive.
-If the ``CONFIGURE_DEPENDS`` flag is specified, CMake will add logic
-to the main build system check target to rerun the flagged ``GLOB`` commands
-at build time. If any of the outputs change, CMake will regenerate the build
-system.
+.. versionadded:: 3.3
+ By default ``GLOB`` lists directories - directories are omitted in result if
+ ``LIST_DIRECTORIES`` is set to false.
-By default ``GLOB`` lists directories - directories are omitted in result if
-``LIST_DIRECTORIES`` is set to false.
+.. versionadded:: 3.12
+ If the ``CONFIGURE_DEPENDS`` flag is specified, CMake will add logic
+ to the main build system check target to rerun the flagged ``GLOB`` commands
+ at build time. If any of the outputs change, CMake will regenerate the build
+ system.
.. note::
We do not recommend using GLOB to collect a list of source files from
@@ -590,10 +651,11 @@ matched directory and match the files. Subdirectories that are symlinks
are only traversed if ``FOLLOW_SYMLINKS`` is given or policy
:policy:`CMP0009` is not set to ``NEW``.
-By default ``GLOB_RECURSE`` omits directories from result list - setting
-``LIST_DIRECTORIES`` to true adds directories to result list.
-If ``FOLLOW_SYMLINKS`` is given or policy :policy:`CMP0009` is not set to
-``NEW`` then ``LIST_DIRECTORIES`` treats symlinks as directories.
+.. versionadded:: 3.3
+ By default ``GLOB_RECURSE`` omits directories from result list - setting
+ ``LIST_DIRECTORIES`` to true adds directories to result list.
+ If ``FOLLOW_SYMLINKS`` is given or policy :policy:`CMP0009` is not set to
+ ``NEW`` then ``LIST_DIRECTORIES`` treats symlinks as directories.
Examples of recursive globbing include::
@@ -619,7 +681,12 @@ Move a file or directory within a filesystem from ``<oldname>`` to
Remove the given files. The ``REMOVE_RECURSE`` mode will remove the given
files and directories, also non-empty directories. No error is emitted if a
given file does not exist. Relative input paths are evaluated with respect
-to the current source directory. Empty input paths are ignored with a warning.
+to the current source directory.
+
+.. versionchanged:: 3.15
+ Empty input paths are ignored with a warning. Previous versions of CMake
+ interpreted empty string as a relative path with respect to the current
+ directory and removed its contents.
.. _MAKE_DIRECTORY:
@@ -652,17 +719,18 @@ at the destination with the same timestamp. Copying preserves input
permissions unless explicit permissions or ``NO_SOURCE_PERMISSIONS``
are given (default is ``USE_SOURCE_PERMISSIONS``).
-If ``FOLLOW_SYMLINK_CHAIN`` is specified, ``COPY`` will recursively resolve
-the symlinks at the paths given until a real file is found, and install
-a corresponding symlink in the destination for each symlink encountered. For
-each symlink that is installed, the resolution is stripped of the directory,
-leaving only the filename, meaning that the new symlink points to a file in
-the same directory as the symlink. This feature is useful on some Unix systems,
-where libraries are installed as a chain of symlinks with version numbers, with
-less specific versions pointing to more specific versions.
-``FOLLOW_SYMLINK_CHAIN`` will install all of these symlinks and the library
-itself into the destination directory. For example, if you have the following
-directory structure:
+.. versionadded:: 3.15
+ If ``FOLLOW_SYMLINK_CHAIN`` is specified, ``COPY`` will recursively resolve
+ the symlinks at the paths given until a real file is found, and install
+ a corresponding symlink in the destination for each symlink encountered. For
+ each symlink that is installed, the resolution is stripped of the directory,
+ leaving only the filename, meaning that the new symlink points to a file in
+ the same directory as the symlink. This feature is useful on some Unix systems,
+ where libraries are installed as a chain of symlinks with version numbers, with
+ less specific versions pointing to more specific versions.
+ ``FOLLOW_SYMLINK_CHAIN`` will install all of these symlinks and the library
+ itself into the destination directory. For example, if you have the following
+ directory structure:
* ``/opt/foo/lib/libfoo.so.1.2.3``
* ``/opt/foo/lib/libfoo.so.1.2 -> libfoo.so.1.2.3``
@@ -696,6 +764,8 @@ use this signature (with some undocumented options for internal use).
file(SIZE <filename> <variable>)
+.. versionadded:: 3.14
+
Determine the file size of the ``<filename>`` and put the result in
``<variable>`` variable. Requires that ``<filename>`` is a valid path
pointing to a file and is readable.
@@ -706,6 +776,8 @@ pointing to a file and is readable.
file(READ_SYMLINK <linkname> <variable>)
+.. versionadded:: 3.14
+
This subcommand queries the symlink ``<linkname>`` and stores the path it
points to in the result ``<variable>``. If ``<linkname>`` does not exist or
is not a symlink, CMake issues a fatal error.
@@ -730,6 +802,8 @@ absolute path is obtained:
file(CREATE_LINK <original> <linkname>
[RESULT <result>] [COPY_ON_ERROR] [SYMBOLIC])
+.. versionadded:: 3.14
+
Create a link ``<linkname>`` that points to ``<original>``.
It will be a hard link by default, but providing the ``SYMBOLIC`` option
results in a symbolic link instead. Hard links require that ``original``
@@ -754,10 +828,12 @@ which would make them unable to support a hard link.
[FILE_PERMISSIONS <permissions>...]
[DIRECTORY_PERMISSIONS <permissions>...])
+.. versionadded:: 3.19
+
Set the permissions for the ``<files>...`` and ``<directories>...`` specified.
Valid permissions are ``OWNER_READ``, ``OWNER_WRITE``, ``OWNER_EXECUTE``,
``GROUP_READ``, ``GROUP_WRITE``, ``GROUP_EXECUTE``, ``WORLD_READ``,
-``WORLD_WRITE``, ``WORLD_EXECUTE``.
+``WORLD_WRITE``, ``WORLD_EXECUTE``, ``SETUID``, ``SETGID``.
Valid combination of keywords are:
@@ -790,6 +866,8 @@ Valid combination of keywords are:
[FILE_PERMISSIONS <permissions>...]
[DIRECTORY_PERMISSIONS <permissions>...])
+.. versionadded:: 3.19
+
Same as `CHMOD`_, but change the permissions of files and directories present in
the ``<directories>...`` recursively.
@@ -802,6 +880,8 @@ Path Conversion
file(REAL_PATH <path> <out-var> [BASE_DIRECTORY <dir>])
+.. versionadded:: 3.19
+
Compute the absolute path to an existing file or directory with symlinks
resolved.
@@ -849,10 +929,12 @@ Transfer
file(UPLOAD <file> <url> [<options>...])
The ``DOWNLOAD`` subcommand downloads the given ``<url>`` to a local ``<file>``.
-If ``<file>`` is not specified for ``file(DOWNLOAD)``, the file is not saved.
-This can be useful if you want to know if a file can be downloaded (for example,
-to check that it exists) without actually saving it anywhere. The ``UPLOAD``
-mode uploads a local ``<file>`` to a given ``<url>``.
+The ``UPLOAD`` mode uploads a local ``<file>`` to a given ``<url>``.
+
+.. versionadded:: 3.19
+ If ``<file>`` is not specified for ``file(DOWNLOAD)``, the file is not saved.
+ This can be useful if you want to know if a file can be downloaded (for example,
+ to check that it exists) without actually saving it anywhere.
Options to both ``DOWNLOAD`` and ``UPLOAD`` are:
@@ -877,12 +959,18 @@ Options to both ``DOWNLOAD`` and ``UPLOAD`` are:
Terminate the operation after a given total time has elapsed.
``USERPWD <username>:<password>``
+ .. versionadded:: 3.7
+
Set username and password for operation.
``HTTPHEADER <HTTP-header>``
+ .. versionadded:: 3.7
+
HTTP header for operation. Suboption can be repeated several times.
``NETRC <level>``
+ .. versionadded:: 3.11
+
Specify whether the .netrc file is to be used for operation. If this
option is not specified, the value of the ``CMAKE_NETRC`` variable
will be used instead.
@@ -899,6 +987,8 @@ Options to both ``DOWNLOAD`` and ``UPLOAD`` are:
The .netrc file is required, and information in the URL is ignored.
``NETRC_FILE <file>``
+ .. versionadded:: 3.11
+
Specify an alternative .netrc file to the one in your home directory,
if the ``NETRC`` level is ``OPTIONAL`` or ``REQUIRED``. If this option
is not specified, the value of the ``CMAKE_NETRC_FILE`` variable will
@@ -911,9 +1001,15 @@ If neither ``NETRC`` option is given CMake will check variables
Specify whether to verify the server certificate for ``https://`` URLs.
The default is to *not* verify.
+ .. versionadded:: 3.18
+ Added support to ``file(UPLOAD)``.
+
``TLS_CAINFO <file>``
Specify a custom Certificate Authority file for ``https://`` URLs.
+ .. versionadded:: 3.18
+ Added support to ``file(UPLOAD)``.
+
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
@@ -944,6 +1040,8 @@ Locking
[RESULT_VARIABLE <variable>]
[TIMEOUT <seconds>])
+.. versionadded:: 3.2
+
Lock a file specified by ``<path>`` if no ``DIRECTORY`` option present and file
``<path>/cmake.lock`` otherwise. File will be locked for scope defined by
``GUARD`` option (default value is ``PROCESS``). ``RELEASE`` option can be used
@@ -979,6 +1077,8 @@ Archiving
[MTIME <mtime>]
[VERBOSE])
+.. versionadded:: 3.18
+
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.
@@ -993,9 +1093,10 @@ 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``.
-The compression level can be specified with the ``COMPRESSION_LEVEL`` option.
-The ``<compression-level>`` should be between 0-9, with the default being 0.
-The ``COMPRESSION`` option must be present when ``COMPRESSION_LEVEL`` is given.
+.. versionadded:: 3.19
+ The compression level can be specified with the ``COMPRESSION_LEVEL`` option.
+ The ``<compression-level>`` should be between 0-9, with the default being 0.
+ The ``COMPRESSION`` option must be present when ``COMPRESSION_LEVEL`` is given.
.. note::
With ``FORMAT`` set to ``raw`` only one file will be compressed with the
@@ -1016,6 +1117,8 @@ the ``MTIME`` option.
[LIST_ONLY]
[VERBOSE])
+.. versionadded:: 3.18
+
Extracts or lists the content of the specified ``<archive>``.
The directory where the content of the archive will be extracted to can
diff --git a/Help/command/find_package.rst b/Help/command/find_package.rst
index 1be2e09ee..3dfd62fc3 100644
--- a/Help/command/find_package.rst
+++ b/Help/command/find_package.rst
@@ -351,15 +351,16 @@ The set of installation prefixes is constructed using the following
steps. If ``NO_DEFAULT_PATH`` is specified all ``NO_*`` options are
enabled.
-1. Search paths specified in the :variable:`<PackageName>_ROOT` CMake
- variable and the :envvar:`<PackageName>_ROOT` environment variable,
- where ``<PackageName>`` is the package to be found.
- The package root variables are maintained as a stack so if
- called from within a find module, root paths from the parent's find
- module will also be searched after paths for the current package.
- This can be skipped if ``NO_PACKAGE_ROOT_PATH`` is passed or by setting
- the :variable:`CMAKE_FIND_USE_PACKAGE_ROOT_PATH` to ``FALSE``.
- See policy :policy:`CMP0074`.
+1. .. versionadded:: 3.12
+ Search paths specified in the :variable:`<PackageName>_ROOT` CMake
+ variable and the :envvar:`<PackageName>_ROOT` environment variable,
+ where ``<PackageName>`` is the package to be found.
+ The package root variables are maintained as a stack so if
+ called from within a find module, root paths from the parent's find
+ module will also be searched after paths for the current package.
+ This can be skipped if ``NO_PACKAGE_ROOT_PATH`` is passed or by setting
+ the :variable:`CMAKE_FIND_USE_PACKAGE_ROOT_PATH` to ``FALSE``.
+ See policy :policy:`CMP0074`.
2. Search paths specified in cmake-specific cache variables. These
are intended to be used on the command line with a ``-DVAR=value``.
@@ -430,6 +431,10 @@ enabled.
9. Search paths specified by the ``PATHS`` option. These are typically
hard-coded guesses.
+.. versionadded:: 3.16
+ Added the ``CMAKE_FIND_USE_<CATEGORY>_PATH`` variables to globally disable
+ various search locations.
+
.. |FIND_XXX| replace:: find_package
.. |FIND_ARGS_XXX| replace:: <PackageName>
.. |CMAKE_FIND_ROOT_PATH_MODE_XXX| replace::
diff --git a/Help/command/foreach.rst b/Help/command/foreach.rst
index a01a1042c..8de6debae 100644
--- a/Help/command/foreach.rst
+++ b/Help/command/foreach.rst
@@ -88,6 +88,8 @@ yields
foreach(<loop_var>... IN ZIP_LISTS <lists>)
+.. versionadded:: 3.17
+
In this variant, ``<lists>`` is a whitespace or semicolon
separated list of list-valued variables. The ``foreach``
command iterates over each list simultaneously setting the
diff --git a/Help/command/function.rst b/Help/command/function.rst
index 7a9b90754..3d25aa45f 100644
--- a/Help/command/function.rst
+++ b/Help/command/function.rst
@@ -50,8 +50,9 @@ 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.
+.. versionadded:: 3.18
+ The :command:`cmake_language(CALL ...)` command can also be used to
+ invoke the function.
Arguments
^^^^^^^^^
diff --git a/Help/command/get_directory_property.rst b/Help/command/get_directory_property.rst
index 39015cc24..0ccbfb027 100644
--- a/Help/command/get_directory_property.rst
+++ b/Help/command/get_directory_property.rst
@@ -11,12 +11,14 @@ Stores a property of directory scope in the named ``<variable>``.
The ``DIRECTORY`` argument specifies another directory from which
to retrieve the property value instead of the current directory.
-It may reference either a source directory, or since CMake 3.19,
-a binary directory. Relative paths are treated as relative to the
+Relative paths are treated as relative to the
current source directory. CMake must already know about the directory,
either by having added it through a call to :command:`add_subdirectory`
or being the top level directory.
+.. versionadded:: 3.19
+ ``<dir>`` may reference a binary directory.
+
If the property is not defined for the nominated directory scope,
an empty string is returned. In the case of ``INHERITED`` properties,
if the property is not found for the nominated directory scope,
diff --git a/Help/command/get_filename_component.rst b/Help/command/get_filename_component.rst
index ea2dedb64..be9d00af3 100644
--- a/Help/command/get_filename_component.rst
+++ b/Help/command/get_filename_component.rst
@@ -3,6 +3,11 @@ get_filename_component
Get a specific component of a full filename.
+.. versionchanged:: 3.19
+ This command been superseded by :command:`cmake_path` command, except
+ ``REALPATH`` now offered by :ref:`file(REAL_PATH) <REAL_PATH>` command and
+ ``PROGRAM`` now available in :command:`separate_arguments(PROGRAM)` command.
+
.. code-block:: cmake
get_filename_component(<var> <FileName> <mode> [CACHE])
@@ -19,6 +24,9 @@ Sets ``<var>`` to a component of ``<FileName>``, where ``<mode>`` is one of:
NAME_WLE = File name with neither the directory nor the last extension
PATH = Legacy alias for DIRECTORY (use for CMake <= 2.8.11)
+.. versionadded:: 3.14
+ Added the ``LAST_EXT`` and ``NAME_WLE`` modes.
+
Paths are returned with forward slashes and have no trailing slashes.
If the optional ``CACHE`` argument is specified, the result variable is
added to the cache.
@@ -27,6 +35,8 @@ added to the cache.
get_filename_component(<var> <FileName> <mode> [BASE_DIR <dir>] [CACHE])
+.. versionadded:: 3.4
+
Sets ``<var>`` to the absolute path of ``<FileName>``, where ``<mode>`` is one
of:
@@ -53,9 +63,3 @@ left as a full path. If ``PROGRAM_ARGS`` is present with ``PROGRAM``, then
any command-line arguments present in the ``<FileName>`` string are split
from the program name and stored in ``<arg_var>``. This is used to
separate a program name from its arguments in a command line string.
-
-.. note::
-
- The ``REALPATH`` and ``PROGRAM`` subcommands had been superseded,
- respectively, by :ref:`file(REAL_PATH) <REAL_PATH>` and
- :command:`separate_arguments(PROGRAM)` commands.
diff --git a/Help/command/get_property.rst b/Help/command/get_property.rst
index 870c934e3..f77d8af78 100644
--- a/Help/command/get_property.rst
+++ b/Help/command/get_property.rst
@@ -30,35 +30,43 @@ It must be one of the following:
``DIRECTORY``
Scope defaults to the current directory but another
directory (already processed by CMake) may be named by the
- full or relative path ``<dir>``. The ``<dir>`` may reference either a
- source directory, or since CMake 3.19, a binary directory.
+ full or relative path ``<dir>``.
Relative paths are treated as relative to the current source directory.
See also the :command:`get_directory_property` command.
+ .. versionadded:: 3.19
+ ``<dir>`` may reference a binary directory.
+
``TARGET``
Scope must name one existing target.
See also the :command:`get_target_property` command.
``SOURCE``
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:
+ will be read from the current source directory's scope.
+
+ .. versionadded:: 3.18
+ Directory scope 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
+ the directory, either by having added it through a call
+ to :command:`add_subdirectory` or ``<dir>`` being the top level directory.
+ Relative paths are treated as relative to the current source directory.
- ``DIRECTORY <dir>``
- The source file property will be read from the ``<dir>`` directory's
- scope. The ``<dir>`` may reference either a source directory, or
- since CMake 3.19, a binary directory. CMake must already know about
- the directory, either by having added it through a call
- to :command:`add_subdirectory` or ``<dir>`` being the top level directory.
- Relative paths are treated as relative to the current source directory.
+ .. versionadded:: 3.19
+ ``<dir>`` may reference a binary 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).
+ ``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``
+ .. versionadded:: 3.1
+
Scope must name one installed file path.
``TEST``
@@ -86,3 +94,8 @@ If ``BRIEF_DOCS`` or ``FULL_DOCS`` is given then the variable is set to a
string containing documentation for the requested property. If
documentation is requested for a property that has not been defined
``NOTFOUND`` is returned.
+
+.. note::
+
+ The :prop_sf:`GENERATED` source file property may be globally visible.
+ See its documentation for details.
diff --git a/Help/command/get_source_file_property.rst b/Help/command/get_source_file_property.rst
index 76ed776c0..ae4156598 100644
--- a/Help/command/get_source_file_property.rst
+++ b/Help/command/get_source_file_property.rst
@@ -19,22 +19,29 @@ 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's scope.
-``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.
+.. versionadded:: 3.18
+ Directory scope can be overridden with one of the following sub-options:
-``TARGET_DIRECTORY <target>``
- The source file property will be read from the directory scope in which
- ``<target>`` was created (``<target>`` must therefore already exist).
+ ``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
always there is :prop_sf:`LOCATION`.
See also the more general :command:`get_property` command.
+
+.. note::
+
+ The :prop_sf:`GENERATED` source file property may be globally visible.
+ See its documentation for details.
diff --git a/Help/command/if.rst b/Help/command/if.rst
index be992df15..f327ca943 100644
--- a/Help/command/if.rst
+++ b/Help/command/if.rst
@@ -39,15 +39,16 @@ the ``if``, ``elseif`` and :command:`while` clauses.
Compound conditions are evaluated in the following order of precedence:
Innermost parentheses are evaluated first. Next come unary tests such
-as ``EXISTS``, ``COMMAND``, and ``DEFINED``. Then binary tests such as
-``EQUAL``, ``LESS``, ``LESS_EQUAL``, ``GREATER``, ``GREATER_EQUAL``,
-``STREQUAL``, ``STRLESS``, ``STRLESS_EQUAL``, ``STRGREATER``,
-``STRGREATER_EQUAL``, ``VERSION_EQUAL``, ``VERSION_LESS``,
-``VERSION_LESS_EQUAL``, ``VERSION_GREATER``, ``VERSION_GREATER_EQUAL``,
-and ``MATCHES``. Then the boolean operators in the order ``NOT``, ``AND``,
-and finally ``OR``.
+as `EXISTS`_, `COMMAND`_, and `DEFINED`_. Then binary tests such as
+`EQUAL`_, `LESS`_, `LESS_EQUAL`_, `GREATER`_, `GREATER_EQUAL`_,
+`STREQUAL`_, `STRLESS`_, `STRLESS_EQUAL`_, `STRGREATER`_,
+`STRGREATER_EQUAL`_, `VERSION_EQUAL`_, `VERSION_LESS`_,
+`VERSION_LESS_EQUAL`_, `VERSION_GREATER`_, `VERSION_GREATER_EQUAL`_,
+and `MATCHES`_. Then the boolean operators in the order `NOT`_, `AND`_,
+and finally `OR`_.
-Possible conditions are:
+Basic Expressions
+"""""""""""""""""
``if(<constant>)``
True if the constant is ``1``, ``ON``, ``YES``, ``TRUE``, ``Y``,
@@ -62,15 +63,35 @@ Possible conditions are:
True if given a variable that is defined to a value that is not a false
constant. False otherwise. (Note macro arguments are not variables.)
+Logic Operators
+"""""""""""""""
+
+.. _NOT:
+
``if(NOT <condition>)``
True if the condition is not true.
+.. _AND:
+
``if(<cond1> AND <cond2>)``
True if both conditions would be considered true individually.
+.. _OR:
+
``if(<cond1> OR <cond2>)``
True if either condition would be considered true individually.
+``if((condition) AND (condition OR (condition)))``
+ The conditions inside the parenthesis are evaluated first and then
+ the remaining condition is evaluated as in the other examples.
+ Where there are nested parenthesis the innermost are evaluated as part
+ of evaluating the condition that contains them.
+
+Existence Checks
+""""""""""""""""
+
+.. _COMMAND:
+
``if(COMMAND command-name)``
True if the given name is a command, macro or function that can be
invoked.
@@ -85,14 +106,35 @@ Possible conditions are:
(in any directory).
``if(TEST test-name)``
- True if the given name is an existing test name created by the
- :command:`add_test` command.
+ .. versionadded:: 3.3
+ True if the given name is an existing test name created by the
+ :command:`add_test` command.
+
+.. _DEFINED:
+
+``if(DEFINED <name>|CACHE{<name>}|ENV{<name>})``
+ True if a variable, cache variable or environment variable
+ with given ``<name>`` is defined. The value of the variable
+ does not matter. Note that macro arguments are not variables.
+
+ .. versionadded:: 3.14
+ Added support for ``CACHE{<name>}`` variables.
+
+``if(<variable|string> IN_LIST <variable>)``
+ .. versionadded:: 3.3
+ True if the given element is contained in the named list variable.
+
+File Operations
+"""""""""""""""
+
+.. _EXISTS:
``if(EXISTS path-to-file-or-directory)``
True if the named file or directory exists. Behavior is well-defined
- only for full paths. Resolves symbolic links, i.e. if the named file or
- directory is a symbolic link, returns true if the target of the
- symbolic link exists.
+ only for explicit full paths (a leading ``~/`` is not expanded as
+ a home directory and is considered a relative path).
+ Resolves symbolic links, i.e. if the named file or directory is a
+ symbolic link, returns true if the target of the symbolic link exists.
``if(file1 IS_NEWER_THAN file2)``
True if ``file1`` is newer than ``file2`` or if one of the two files doesn't
@@ -113,50 +155,86 @@ Possible conditions are:
``if(IS_ABSOLUTE path)``
True if the given path is an absolute path.
+Comparisons
+"""""""""""
+
+.. _MATCHES:
+
``if(<variable|string> MATCHES regex)``
True if the given string or variable's value matches the given regular
condition. See :ref:`Regex Specification` for regex format.
- ``()`` groups are captured in :variable:`CMAKE_MATCH_<n>` variables.
+
+ .. versionadded:: 3.9
+ ``()`` groups are captured in :variable:`CMAKE_MATCH_<n>` variables.
+
+.. _LESS:
``if(<variable|string> LESS <variable|string>)``
True if the given string or variable's value is a valid number and less
than that on the right.
+.. _GREATER:
+
``if(<variable|string> GREATER <variable|string>)``
True if the given string or variable's value is a valid number and greater
than that on the right.
+.. _EQUAL:
+
``if(<variable|string> EQUAL <variable|string>)``
True if the given string or variable's value is a valid number and equal
to that on the right.
+.. _LESS_EQUAL:
+
``if(<variable|string> LESS_EQUAL <variable|string>)``
- True if the given string or variable's value is a valid number and less
- than or equal to that on the right.
+ .. versionadded:: 3.7
+ True if the given string or variable's value is a valid number and less
+ than or equal to that on the right.
+
+.. _GREATER_EQUAL:
``if(<variable|string> GREATER_EQUAL <variable|string>)``
- True if the given string or variable's value is a valid number and greater
- than or equal to that on the right.
+ .. versionadded:: 3.7
+ True if the given string or variable's value is a valid number and greater
+ than or equal to that on the right.
+
+.. _STRLESS:
``if(<variable|string> STRLESS <variable|string>)``
True if the given string or variable's value is lexicographically less
than the string or variable on the right.
+.. _STRGREATER:
+
``if(<variable|string> STRGREATER <variable|string>)``
True if the given string or variable's value is lexicographically greater
than the string or variable on the right.
+.. _STREQUAL:
+
``if(<variable|string> STREQUAL <variable|string>)``
True if the given string or variable's value is lexicographically equal
to the string or variable on the right.
+.. _STRLESS_EQUAL:
+
``if(<variable|string> STRLESS_EQUAL <variable|string>)``
- True if the given string or variable's value is lexicographically less
- than or equal to the string or variable on the right.
+ .. versionadded:: 3.7
+ True if the given string or variable's value is lexicographically less
+ than or equal to the string or variable on the right.
+
+.. _STRGREATER_EQUAL:
``if(<variable|string> STRGREATER_EQUAL <variable|string>)``
- True if the given string or variable's value is lexicographically greater
- than or equal to the string or variable on the right.
+ .. versionadded:: 3.7
+ True if the given string or variable's value is lexicographically greater
+ than or equal to the string or variable on the right.
+
+Version Comparisons
+"""""""""""""""""""
+
+.. _VERSION_LESS:
``if(<variable|string> VERSION_LESS <variable|string>)``
Component-wise integer version number comparison (version format is
@@ -164,43 +242,39 @@ Possible conditions are:
Any non-integer version component or non-integer trailing part of a version
component effectively truncates the string at that point.
+.. _VERSION_GREATER:
+
``if(<variable|string> VERSION_GREATER <variable|string>)``
Component-wise integer version number comparison (version format is
``major[.minor[.patch[.tweak]]]``, omitted components are treated as zero).
Any non-integer version component or non-integer trailing part of a version
component effectively truncates the string at that point.
-``if(<variable|string> VERSION_EQUAL <variable|string>)``
- Component-wise integer version number comparison (version format is
- ``major[.minor[.patch[.tweak]]]``, omitted components are treated as zero).
- Any non-integer version component or non-integer trailing part of a version
- component effectively truncates the string at that point.
+.. _VERSION_EQUAL:
-``if(<variable|string> VERSION_LESS_EQUAL <variable|string>)``
+``if(<variable|string> VERSION_EQUAL <variable|string>)``
Component-wise integer version number comparison (version format is
``major[.minor[.patch[.tweak]]]``, omitted components are treated as zero).
Any non-integer version component or non-integer trailing part of a version
component effectively truncates the string at that point.
-``if(<variable|string> VERSION_GREATER_EQUAL <variable|string>)``
- Component-wise integer version number comparison (version format is
- ``major[.minor[.patch[.tweak]]]``, omitted components are treated as zero).
- Any non-integer version component or non-integer trailing part of a version
- component effectively truncates the string at that point.
+.. _VERSION_LESS_EQUAL:
-``if(<variable|string> IN_LIST <variable>)``
- True if the given element is contained in the named list variable.
+``if(<variable|string> VERSION_LESS_EQUAL <variable|string>)``
+ .. versionadded:: 3.7
+ Component-wise integer version number comparison (version format is
+ ``major[.minor[.patch[.tweak]]]``, omitted components are treated as zero).
+ Any non-integer version component or non-integer trailing part of a version
+ component effectively truncates the string at that point.
-``if(DEFINED <name>|CACHE{<name>}|ENV{<name>})``
- True if a variable, cache variable or environment variable
- with given ``<name>`` is defined. The value of the variable
- does not matter. Note that macro arguments are not variables.
+.. _VERSION_GREATER_EQUAL:
-``if((condition) AND (condition OR (condition)))``
- The conditions inside the parenthesis are evaluated first and then
- the remaining condition is evaluated as in the previous examples.
- Where there are nested parenthesis the innermost are evaluated as part
- of evaluating the condition that contains them.
+``if(<variable|string> VERSION_GREATER_EQUAL <variable|string>)``
+ .. versionadded:: 3.7
+ Component-wise integer version number comparison (version format is
+ ``major[.minor[.patch[.tweak]]]``, omitted components are treated as zero).
+ Any non-integer version component or non-integer trailing part of a version
+ component effectively truncates the string at that point.
Variable Expansion
^^^^^^^^^^^^^^^^^^
@@ -268,11 +342,12 @@ above-documented condition syntax accepts ``<variable|string>``:
tested to see if they are boolean constants, if so they are used as
such, otherwise they are assumed to be variables and are dereferenced.
-To prevent ambiguity, potential variable or keyword names can be
-specified in a :ref:`Quoted Argument` or a :ref:`Bracket Argument`.
-A quoted or bracketed variable or keyword will be interpreted as a
-string and not dereferenced or interpreted.
-See policy :policy:`CMP0054`.
+.. versionchanged:: 3.1
+ To prevent ambiguity, potential variable or keyword names can be
+ specified in a :ref:`Quoted Argument` or a :ref:`Bracket Argument`.
+ A quoted or bracketed variable or keyword will be interpreted as a
+ string and not dereferenced or interpreted.
+ See policy :policy:`CMP0054`.
There is no automatic evaluation for environment or cache
:ref:`Variable References`. Their values must be referenced as
diff --git a/Help/command/include_external_msproject.rst b/Help/command/include_external_msproject.rst
index 540a13af8..435465462 100644
--- a/Help/command/include_external_msproject.rst
+++ b/Help/command/include_external_msproject.rst
@@ -21,6 +21,7 @@ specify the type of project, id (``GUID``) of the project and the name of
the target platform. This is useful for projects requiring values
other than the default (e.g. WIX projects).
-If the imported project has different configuration names than the
-current project, set the :prop_tgt:`MAP_IMPORTED_CONFIG_<CONFIG>`
-target property to specify the mapping.
+.. versionadded:: 3.9
+ If the imported project has different configuration names than the
+ current project, set the :prop_tgt:`MAP_IMPORTED_CONFIG_<CONFIG>`
+ target property to specify the mapping.
diff --git a/Help/command/install.rst b/Help/command/install.rst
index c11eaf429..35207f4c4 100644
--- a/Help/command/install.rst
+++ b/Help/command/install.rst
@@ -20,10 +20,13 @@ Introduction
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`).
+are executed in order during installation.
+
+.. versionchanged:: 3.14
+ 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
@@ -85,6 +88,8 @@ signatures that specify them. The common options are:
:variable:`CMAKE_INSTALL_DEFAULT_COMPONENT_NAME` variable.
``EXCLUDE_FROM_ALL``
+ .. versionadded:: 3.6
+
Specify that the file is excluded from a full installation and only
installed as part of a component-specific installation
@@ -97,16 +102,18 @@ signatures that specify them. The common options are:
Specify that it is not an error if the file to be installed does
not exist.
-Command signatures that install files may print messages during
-installation. Use the :variable:`CMAKE_INSTALL_MESSAGE` variable
-to control which messages are printed.
+.. versionadded:: 3.1
+ Command signatures that install files may print messages during
+ installation. Use the :variable:`CMAKE_INSTALL_MESSAGE` variable
+ to control which messages are printed.
-Many of the ``install()`` variants implicitly create the directories
-containing the installed files. If
-:variable:`CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS` is set, these
-directories will be created with the permissions specified. Otherwise,
-they will be created according to the uname rules on Unix-like platforms.
-Windows platforms are unaffected.
+.. versionadded:: 3.11
+ Many of the ``install()`` variants implicitly create the directories
+ containing the installed files. If
+ :variable:`CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS` is set, these
+ directories will be created with the permissions specified. Otherwise,
+ they will be created according to the uname rules on Unix-like platforms.
+ Windows platforms are unaffected.
Installing Targets
^^^^^^^^^^^^^^^^^^
@@ -162,6 +169,8 @@ that may be installed:
accompanying import libraries are of kind ``ARCHIVE``).
``OBJECTS``
+ .. versionadded:: 3.9
+
Object files associated with *object libraries*.
``FRAMEWORK``
@@ -246,6 +255,8 @@ In addition to the common options listed above, each target can accept
the following additional arguments:
``NAMELINK_COMPONENT``
+ .. versionadded:: 3.12
+
On some platforms a versioned shared library has a symbolic link such
as::
@@ -357,17 +368,19 @@ targets that link to the object libraries in their implementation.
Installing a target with the :prop_tgt:`EXCLUDE_FROM_ALL` target property
set to ``TRUE`` has undefined behavior.
-`install(TARGETS)`_ can install targets that were created in
-other directories. When using such cross-directory install rules, running
-``make install`` (or similar) from a subdirectory will not guarantee that
-targets from other directories are up-to-date. You can use
-:command:`target_link_libraries` or :command:`add_dependencies`
-to ensure that such out-of-directory targets are built before the
-subdirectory-specific install rules are run.
+.. versionadded:: 3.3
+ An install destination given as a ``DESTINATION`` argument may
+ use "generator expressions" with the syntax ``$<...>``. See the
+ :manual:`cmake-generator-expressions(7)` manual for available expressions.
-An install destination given as a ``DESTINATION`` argument may
-use "generator expressions" with the syntax ``$<...>``. See the
-:manual:`cmake-generator-expressions(7)` manual for available expressions.
+.. versionadded:: 3.13
+ `install(TARGETS)`_ can install targets that were created in
+ other directories. When using such cross-directory install rules, running
+ ``make install`` (or similar) from a subdirectory will not guarantee that
+ targets from other directories are up-to-date. You can use
+ :command:`target_link_libraries` or :command:`add_dependencies`
+ to ensure that such out-of-directory targets are built before the
+ subdirectory-specific install rules are run.
Installing Files
^^^^^^^^^^^^^^^^
@@ -455,9 +468,15 @@ this advice while installing headers to a project-specific subdirectory:
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/myproj
)
-An install destination given as a ``DESTINATION`` argument may
-use "generator expressions" with the syntax ``$<...>``. See the
-:manual:`cmake-generator-expressions(7)` manual for available expressions.
+.. versionadded:: 3.4
+ An install destination given as a ``DESTINATION`` argument may
+ use "generator expressions" with the syntax ``$<...>``. See the
+ :manual:`cmake-generator-expressions(7)` manual for available expressions.
+
+.. versionadded:: 3.20
+ An install rename given as a ``RENAME`` argument may
+ use "generator expressions" with the syntax ``$<...>``. See the
+ :manual:`cmake-generator-expressions(7)` manual for available expressions.
Installing Directories
^^^^^^^^^^^^^^^^^^^^^^
@@ -495,7 +514,8 @@ permissions specified in the ``FILES`` form of the command, and the
directories will be given the default permissions specified in the
``PROGRAMS`` form of the command.
-The ``MESSAGE_NEVER`` option disables file installation status output.
+.. versionadded:: 3.1
+ The ``MESSAGE_NEVER`` option disables file installation status output.
Installation of directories may be controlled with fine granularity
using the ``PATTERN`` or ``REGEX`` options. These "match" options specify a
@@ -579,10 +599,14 @@ path that begins with the appropriate :module:`GNUInstallDirs` variable.
This allows package maintainers to control the install destination by setting
the appropriate cache variables.
-The list of ``dirs...`` given to ``DIRECTORY`` and an install destination
-given as a ``DESTINATION`` argument may use "generator expressions"
-with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
-manual for available expressions.
+.. versionadded:: 3.4
+ An install destination given as a ``DESTINATION`` argument may
+ use "generator expressions" with the syntax ``$<...>``. See the
+ :manual:`cmake-generator-expressions(7)` manual for available expressions.
+
+.. versionadded:: 3.5
+ The list of ``dirs...`` given to ``DIRECTORY`` may use
+ "generator expressions" too.
Custom Installation Logic
^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -610,10 +634,11 @@ example, the code
will print a message during installation.
-``<file>`` or ``<code>`` may use "generator expressions" with the syntax
-``$<...>`` (in the case of ``<file>``, this refers to their use in the file
-name, not the file's contents). See the
-:manual:`cmake-generator-expressions(7)` manual for available expressions.
+.. versionadded:: 3.14
+ ``<file>`` or ``<code>`` may use "generator expressions" with the syntax
+ ``$<...>`` (in the case of ``<file>``, this refers to their use in the file
+ name, not the file's contents). See the
+ :manual:`cmake-generator-expressions(7)` manual for available expressions.
Installing Exports
^^^^^^^^^^^^^^^^^^
@@ -673,13 +698,14 @@ RPM, typically handle this by listing the ``Runtime`` component as a dependency
of the ``Development`` component in the package metadata, ensuring that the
library is always installed if the headers and CMake export file are present.
-In addition to cmake language files, the ``EXPORT_ANDROID_MK`` mode maybe
-used to specify an export to the android ndk build system. This mode
-accepts the same options as the normal export mode. The Android
-NDK supports the use of prebuilt libraries, both static and shared. This
-allows cmake to build the libraries of a project and make them available
-to an ndk build system complete with transitive dependencies, include flags
-and defines required to use the libraries.
+.. versionadded:: 3.7
+ In addition to cmake language files, the ``EXPORT_ANDROID_MK`` mode maybe
+ used to specify an export to the android ndk build system. This mode
+ accepts the same options as the normal export mode. The Android
+ NDK supports the use of prebuilt libraries, both static and shared. This
+ allows cmake to build the libraries of a project and make them available
+ to an ndk build system complete with transitive dependencies, include flags
+ and defines required to use the libraries.
The ``EXPORT`` form is useful to help outside projects use targets built
and installed by the current project. For example, the code
diff --git a/Help/command/link_directories.rst b/Help/command/link_directories.rst
index 9cb8faa74..673240234 100644
--- a/Help/command/link_directories.rst
+++ b/Help/command/link_directories.rst
@@ -11,21 +11,25 @@ Adds the paths in which the linker should search for libraries.
Relative paths given to this command are interpreted as relative to
the current source directory, see :policy:`CMP0015`.
-The directories are added to the :prop_dir:`LINK_DIRECTORIES` directory
-property for the current ``CMakeLists.txt`` file, converting relative
-paths to absolute as needed.
The command will apply only to targets created after it is called.
-By default the directories specified are appended onto the current list of
-directories. This default behavior can be changed by setting
-:variable:`CMAKE_LINK_DIRECTORIES_BEFORE` to ``ON``. By using
-``AFTER`` or ``BEFORE`` explicitly, you can select between appending and
-prepending, independent of the default.
-
-Arguments to ``link_directories`` may use "generator expressions" 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.
+.. versionadded:: 3.13
+ The directories are added to the :prop_dir:`LINK_DIRECTORIES` directory
+ property for the current ``CMakeLists.txt`` file, converting relative
+ paths to absolute as needed. See the :manual:`cmake-buildsystem(7)`
+ manual for more on defining buildsystem properties.
+
+.. versionadded:: 3.13
+ By default the directories specified are appended onto the current list of
+ directories. This default behavior can be changed by setting
+ :variable:`CMAKE_LINK_DIRECTORIES_BEFORE` to ``ON``. By using
+ ``AFTER`` or ``BEFORE`` explicitly, you can select between appending and
+ prepending, independent of the default.
+
+.. versionadded:: 3.13
+ Arguments to ``link_directories`` may use "generator expressions" with
+ the syntax "$<...>". See the :manual:`cmake-generator-expressions(7)`
+ manual for available expressions.
.. note::
diff --git a/Help/command/list.rst b/Help/command/list.rst
index 4d339a03c..7accc5a39 100644
--- a/Help/command/list.rst
+++ b/Help/command/list.rst
@@ -88,6 +88,8 @@ Returns the list of elements specified by indices from the list.
list(JOIN <list> <glue> <output variable>)
+.. versionadded:: 3.12
+
Returns a string joining all list's elements using the glue string.
To join multiple strings, which are not part of a list, use ``JOIN`` operator
from :command:`string` command.
@@ -98,6 +100,8 @@ from :command:`string` command.
list(SUBLIST <list> <begin> <length> <output variable>)
+.. versionadded:: 3.12
+
Returns a sublist of the given list.
If ``<length>`` is 0, an empty list will be returned.
If ``<length>`` is -1 or the list is smaller than ``<begin>+<length>`` then
@@ -132,6 +136,8 @@ Appends elements to the list.
list(FILTER <list> <INCLUDE|EXCLUDE> REGEX <regular_expression>)
+.. versionadded:: 3.6
+
Includes or removes items from the list that match the mode's pattern.
In ``REGEX`` mode, items will be matched against the given regular expression.
@@ -152,6 +158,8 @@ Inserts elements to the list to the specified location.
list(POP_BACK <list> [<out-var>...])
+.. versionadded:: 3.15
+
If no variable name is given, removes exactly one element. Otherwise,
assign the last element's value to the given variable and removes it,
up to the last variable name given.
@@ -162,6 +170,8 @@ up to the last variable name given.
list(POP_FRONT <list> [<out-var>...])
+.. versionadded:: 3.15
+
If no variable name is given, removes exactly one element. Otherwise,
assign the first element's value to the given variable and removes it,
up to the last variable name given.
@@ -172,6 +182,8 @@ up to the last variable name given.
list(PREPEND <list> [<element> ...])
+.. versionadded:: 3.15
+
Insert elements to the 0th position in the list.
.. _REMOVE_ITEM:
@@ -206,6 +218,8 @@ but if duplicates are encountered, only the first instance is preserved.
list(TRANSFORM <list> <ACTION> [<SELECTOR>]
[OUTPUT_VARIABLE <output variable>])
+.. versionadded:: 3.12
+
Transforms the list by applying an action to all or, by specifying a
``<SELECTOR>``, to the selected elements of the list, storing the result
in-place or in the specified output variable.
@@ -302,6 +316,13 @@ Reverses the contents of the list in-place.
list(SORT <list> [COMPARE <compare>] [CASE <case>] [ORDER <order>])
Sorts the list in-place alphabetically.
+
+.. versionadded:: 3.13
+ Added the ``COMPARE``, ``CASE``, and ``ORDER`` options.
+
+.. versionadded:: 3.18
+ Added the ``COMPARE NATURAL`` option.
+
Use the ``COMPARE`` keyword to select the comparison method for sorting.
The ``<compare>`` option should be one of:
diff --git a/Help/command/macro.rst b/Help/command/macro.rst
index 797a90d8f..5fe4c00ef 100644
--- a/Help/command/macro.rst
+++ b/Help/command/macro.rst
@@ -48,8 +48,9 @@ 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.
+.. versionadded:: 3.18
+ The :command:`cmake_language(CALL ...)` command can also be used to
+ invoke the macro.
Arguments
^^^^^^^^^
diff --git a/Help/command/mark_as_advanced.rst b/Help/command/mark_as_advanced.rst
index e52e623a7..201363fad 100644
--- a/Help/command/mark_as_advanced.rst
+++ b/Help/command/mark_as_advanced.rst
@@ -23,8 +23,6 @@ new values will be marked as advanced, but if a
variable already has an advanced/non-advanced state,
it will not be changed.
-.. note::
-
- Policy :policy:`CMP0102` affects the behavior of the ``mark_as_advanced``
- call. When set to ``NEW``, variables passed to this command which are not
- already in the cache are ignored. See policy :policy:`CMP0102`.
+.. versionchanged:: 3.17
+ Variables passed to this command which are not already in the cache
+ are ignored. See policy :policy:`CMP0102`.
diff --git a/Help/command/math.rst b/Help/command/math.rst
index ddb1ec63c..8386aabc6 100644
--- a/Help/command/math.rst
+++ b/Help/command/math.rst
@@ -17,17 +17,18 @@ Supported operators are ``+``, ``-``, ``*``, ``/``, ``%``, ``|``, ``&``,
``^``, ``~``, ``<<``, ``>>``, and ``(...)``; they have the same meaning
as in C code.
-Hexadecimal numbers are recognized when prefixed with ``0x``, as in C code.
-
-The result is formatted according to the option ``OUTPUT_FORMAT``,
-where ``<format>`` is one of
-
-``HEXADECIMAL``
- Hexadecimal notation as in C code, i. e. starting with "0x".
-``DECIMAL``
- Decimal notation. Which is also used if no ``OUTPUT_FORMAT`` option
- is specified.
-
+.. versionadded:: 3.13
+ Hexadecimal numbers are recognized when prefixed with ``0x``, as in C code.
+
+.. versionadded:: 3.13
+ The result is formatted according to the option ``OUTPUT_FORMAT``,
+ where ``<format>`` is one of
+
+ ``HEXADECIMAL``
+ Hexadecimal notation as in C code, i. e. starting with "0x".
+ ``DECIMAL``
+ Decimal notation. Which is also used if no ``OUTPUT_FORMAT`` option
+ is specified.
For example
diff --git a/Help/command/message.rst b/Help/command/message.rst
index 6bc0e4cfc..e44803e85 100644
--- a/Help/command/message.rst
+++ b/Help/command/message.rst
@@ -71,6 +71,9 @@ influences the way the message is handled:
using this log level would normally only be temporary and would expect to be
removed before releasing the project, packaging up the files, etc.
+.. versionadded:: 3.15
+ Added the ``NOTICE``, ``VERBOSE``, ``DEBUG``, and ``TRACE`` levels.
+
The CMake command-line tool displays ``STATUS`` to ``TRACE`` messages on stdout
with the message preceded by two hyphens and a space. All other message types
are sent to stderr and are not prefixed with hyphens. The
@@ -79,25 +82,29 @@ The :manual:`curses interface <ccmake(1)>` shows ``STATUS`` to ``TRACE``
messages one at a time on a status line and other messages in an
interactive pop-up box. The ``--log-level`` command-line option to each of
these tools can be used to control which messages will be shown.
-To make a log level persist between CMake runs, the
-:variable:`CMAKE_MESSAGE_LOG_LEVEL` variable can be set instead.
-Note that the command line option takes precedence over the cache variable.
-
-Messages of log levels ``NOTICE`` and below will have each line preceded
-by the content of the :variable:`CMAKE_MESSAGE_INDENT` variable (converted to
-a single string by concatenating its list items). For ``STATUS`` to ``TRACE``
-messages, this indenting content will be inserted after the hyphens.
-
-Messages of log levels ``NOTICE`` and below can also have each line preceded
-with context of the form ``[some.context.example]``. The content between the
-square brackets is obtained by converting the :variable:`CMAKE_MESSAGE_CONTEXT`
-list variable to a dot-separated string. The message context will always
-appear before any indenting content but after any automatically added leading
-hyphens. By default, message context is not shown, it has to be explicitly
-enabled by giving the :manual:`cmake <cmake(1)>` ``--log-context``
-command-line option or by setting the :variable:`CMAKE_MESSAGE_CONTEXT_SHOW`
-variable to true. See the :variable:`CMAKE_MESSAGE_CONTEXT` documentation for
-usage examples.
+
+.. versionadded:: 3.17
+ To make a log level persist between CMake runs, the
+ :variable:`CMAKE_MESSAGE_LOG_LEVEL` variable can be set instead.
+ Note that the command line option takes precedence over the cache variable.
+
+.. versionadded:: 3.16
+ Messages of log levels ``NOTICE`` and below will have each line preceded
+ by the content of the :variable:`CMAKE_MESSAGE_INDENT` variable (converted to
+ a single string by concatenating its list items). For ``STATUS`` to ``TRACE``
+ messages, this indenting content will be inserted after the hyphens.
+
+.. versionadded:: 3.17
+ Messages of log levels ``NOTICE`` and below can also have each line preceded
+ with context of the form ``[some.context.example]``. The content between the
+ square brackets is obtained by converting the :variable:`CMAKE_MESSAGE_CONTEXT`
+ list variable to a dot-separated string. The message context will always
+ appear before any indenting content but after any automatically added leading
+ hyphens. By default, message context is not shown, it has to be explicitly
+ enabled by giving the :manual:`cmake <cmake(1)>` ``--log-context``
+ command-line option or by setting the :variable:`CMAKE_MESSAGE_CONTEXT_SHOW`
+ variable to true. See the :variable:`CMAKE_MESSAGE_CONTEXT` documentation for
+ usage examples.
CMake Warning and Error message text displays using a simple markup
language. Non-indented text is formatted in line-wrapped paragraphs
@@ -107,6 +114,8 @@ delimited by newlines. Indented text is considered pre-formatted.
Reporting checks
^^^^^^^^^^^^^^^^
+.. versionadded:: 3.17
+
A common pattern in CMake output is a message indicating the start of some
sort of check, followed by another message reporting the result of that check.
For example:
diff --git a/Help/command/project.rst b/Help/command/project.rst
index c325050f9..6c931b692 100644
--- a/Help/command/project.rst
+++ b/Help/command/project.rst
@@ -55,10 +55,14 @@ The options are:
* :variable:`PROJECT_VERSION_TWEAK`,
:variable:`<PROJECT-NAME>_VERSION_TWEAK`.
- When the ``project()`` command is called from the top-level ``CMakeLists.txt``,
- then the version is also stored in the variable :variable:`CMAKE_PROJECT_VERSION`.
+ .. versionadded:: 3.12
+ When the ``project()`` command is called from the top-level
+ ``CMakeLists.txt``, then the version is also stored in the variable
+ :variable:`CMAKE_PROJECT_VERSION`.
``DESCRIPTION <project-description-string>``
+ .. versionadded:: 3.9
+
Optional.
Sets the variables
@@ -71,7 +75,12 @@ The options are:
When the ``project()`` command is called from the top-level ``CMakeLists.txt``,
then the description is also stored in the variable :variable:`CMAKE_PROJECT_DESCRIPTION`.
+ .. versionadded:: 3.12
+ Added the ``<PROJECT-NAME>_DESCRIPTION`` variable.
+
``HOMEPAGE_URL <url-string>``
+ .. versionadded:: 3.12
+
Optional.
Sets the variables
@@ -93,6 +102,15 @@ The options are:
Specify language ``NONE``, or use the ``LANGUAGES`` keyword and list no languages,
to skip enabling any languages.
+ .. versionadded:: 3.8
+ Added ``CUDA`` support.
+
+ .. versionadded:: 3.16
+ Added ``OBJC`` and ``OBJCXX`` support.
+
+ .. versionadded:: 3.18
+ Added ``ISPC`` support.
+
If enabling ``ASM``, list it last so that CMake can check whether
compilers for other languages like ``C`` work for assembly too.
@@ -115,6 +133,13 @@ they point to will be included as the last step of the ``project()`` command.
If both are set, then :variable:`CMAKE_PROJECT_INCLUDE` will be included before
:variable:`CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE`.
+.. versionadded:: 3.15
+ Added the ``CMAKE_PROJECT_INCLUDE`` and ``CMAKE_PROJECT_INCLUDE_BEFORE``
+ variables.
+
+.. versionadded:: 3.17
+ Added the ``CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE_BEFORE`` variable.
+
Usage
^^^^^
diff --git a/Help/command/separate_arguments.rst b/Help/command/separate_arguments.rst
index 69fb72672..f66af35a5 100644
--- a/Help/command/separate_arguments.rst
+++ b/Help/command/separate_arguments.rst
@@ -32,10 +32,14 @@ be one of the following keywords:
MSDN article `Parsing C Command-Line Arguments`_ for details.
``NATIVE_COMMAND``
+ .. versionadded:: 3.9
+
Proceeds as in ``WINDOWS_COMMAND`` mode if the host system is Windows.
Otherwise proceeds as in ``UNIX_COMMAND`` mode.
``PROGRAM``
+ .. versionadded:: 3.19
+
The first item in ``<args>`` is assumed to be an executable and will be
searched in the system search path or left as a full path. If not found,
``<variable>`` will be empty. Otherwise, ``<variable>`` is a list of 2
diff --git a/Help/command/set_property.rst b/Help/command/set_property.rst
index b5c1613e3..bf437b434 100644
--- a/Help/command/set_property.rst
+++ b/Help/command/set_property.rst
@@ -28,11 +28,12 @@ It must be one of the following:
``DIRECTORY``
Scope defaults to the current directory but other directories
(already processed by CMake) may be named by full or relative path.
- Each path may reference either a source directory, or since CMake 3.19,
- a binary directory.
Relative paths are treated as relative to the current source directory.
See also the :command:`set_directory_properties` command.
+ .. versionadded:: 3.19
+ ``<dir>`` may reference a binary directory.
+
``TARGET``
Scope may name zero or more existing targets.
See also the :command:`set_target_properties` command.
@@ -40,25 +41,31 @@ It must be one of the following:
``SOURCE``
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. Each path may reference either a source directory,
- or since CMake 3.19, a binary directory. CMake must already know about
- each of these 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).
+
+ .. versionadded:: 3.18
+ 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 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.
+
+ .. versionadded:: 3.19
+ ``<dirs>`` may reference a binary 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``
+ .. versionadded:: 3.1
+
Scope may name zero or more installed file paths.
These are made available to CPack to influence deployment.
@@ -98,3 +105,8 @@ directly set in the nominated scope, the command will behave as though
See the :manual:`cmake-properties(7)` manual for a list of properties
in each scope.
+
+.. note::
+
+ The :prop_sf:`GENERATED` source file property may be globally visible.
+ See its documentation for details.
diff --git a/Help/command/set_source_files_properties.rst b/Help/command/set_source_files_properties.rst
index 9558b4036..61c69a2e9 100644
--- a/Help/command/set_source_files_properties.rst
+++ b/Help/command/set_source_files_properties.rst
@@ -14,9 +14,10 @@ Source files can have properties that affect how they are built.
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:
+.. versionadded:: 3.18
+ 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>``
@@ -35,3 +36,8 @@ See also the :command:`set_property(SOURCE)` command.
See :ref:`Source File Properties` for the list of properties known
to CMake.
+
+.. note::
+
+ The :prop_sf:`GENERATED` source file property may be globally visible.
+ See its documentation for details.
diff --git a/Help/command/site_name.rst b/Help/command/site_name.rst
index 1bcaeada0..09b5a9fbd 100644
--- a/Help/command/site_name.rst
+++ b/Help/command/site_name.rst
@@ -6,3 +6,7 @@ Set the given variable to the name of the computer.
.. code-block:: cmake
site_name(variable)
+
+On UNIX-like platforms, if the variable ``HOSTNAME`` is set, its value
+will be executed as a command expected to print out the host name,
+much like the ``hostname`` command-line tool.
diff --git a/Help/command/source_group.rst b/Help/command/source_group.rst
index 5ae9e5144..5db1ec8c5 100644
--- a/Help/command/source_group.rst
+++ b/Help/command/source_group.rst
@@ -14,12 +14,16 @@ This is intended to set up file tabs in Visual Studio.
The options are:
``TREE``
+ .. versionadded:: 3.8
+
CMake will automatically detect, from ``<src>`` files paths, source groups
it needs to create, to keep structure of source groups analogically to the
actual files and directories structure in the project. Paths of ``<src>``
files will be cut to be relative to ``<root>``.
``PREFIX``
+ .. versionadded:: 3.8
+
Source group and files located directly in ``<root>`` path, will be placed
in ``<prefix>`` source groups.
@@ -47,6 +51,9 @@ appropriately:
source_group(outer\\inner ...)
source_group(TREE <root> PREFIX sources\\inc ...)
+.. versionadded:: 3.18
+ Allow using forward slashes (``/``) to specify subgroups.
+
For backwards compatibility, the short-hand signature
.. code-block:: cmake
diff --git a/Help/command/string.rst b/Help/command/string.rst
index 51f8d821a..8ad0089af 100644
--- a/Help/command/string.rst
+++ b/Help/command/string.rst
@@ -170,10 +170,12 @@ The following characters have special meaning in regular expressions:
Matches a pattern on either side of the ``|``
``()``
Saves a matched subexpression, which can be referenced
- in the ``REGEX REPLACE`` operation. Additionally it is saved
- by all regular expression-related commands, including
- e.g. :command:`if(MATCHES)`, in the variables
- :variable:`CMAKE_MATCH_<n>` for ``<n>`` 0..9.
+ in the ``REGEX REPLACE`` operation.
+
+ .. versionadded:: 3.9
+ All regular expression-related commands, including e.g.
+ :command:`if(MATCHES)`, save subgroup matches in the variables
+ :variable:`CMAKE_MATCH_<n>` for ``<n>`` 0..9.
``*``, ``+`` and ``?`` have higher precedence than concatenation. ``|``
has lower precedence than concatenation. This means that the regular
@@ -205,6 +207,8 @@ Manipulation
string(APPEND <string_variable> [<input>...])
+.. versionadded:: 3.4
+
Append all the ``<input>`` arguments to the string.
.. _PREPEND:
@@ -213,6 +217,8 @@ Append all the ``<input>`` arguments to the string.
string(PREPEND <string_variable> [<input>...])
+.. versionadded:: 3.10
+
Prepend all the ``<input>`` arguments to the string.
.. _CONCAT:
@@ -230,6 +236,8 @@ the result in the named ``<output_variable>``.
string(JOIN <glue> <output_variable> [<input>...])
+.. versionadded:: 3.12
+
Join all the ``<input>`` arguments together using the ``<glue>``
string and store the result in the named ``<output_variable>``.
@@ -271,16 +279,15 @@ result stored in ``<output_variable>`` will *not* be the number of characters.
Store in an ``<output_variable>`` a substring of a given ``<string>``. If
``<length>`` is ``-1`` the remainder of the string starting at ``<begin>``
-will be returned. If ``<string>`` is shorter than ``<length>`` then the
-end of the string is used instead.
+will be returned.
+
+.. versionchanged:: 3.2
+ If ``<string>`` is shorter than ``<length>`` then the end of the string
+ is used instead. Previous versions of CMake reported an error in this case.
Both ``<begin>`` and ``<length>`` are counted in bytes, so care must
be exercised if ``<string>`` could contain multi-byte characters.
-.. note::
- CMake 3.1 and below reported an error if ``<length>`` pointed past
- the end of ``<string>``.
-
.. _STRIP:
.. code-block:: cmake
@@ -296,6 +303,8 @@ leading and trailing spaces removed.
string(GENEX_STRIP <string> <output_variable>)
+.. versionadded:: 3.1
+
Strip any :manual:`generator expressions <cmake-generator-expressions(7)>`
from the input ``<string>`` and store the result in the ``<output_variable>``.
@@ -305,6 +314,8 @@ from the input ``<string>`` and store the result in the ``<output_variable>``.
string(REPEAT <string> <count> <output_variable>)
+.. versionadded:: 3.15
+
Produce the output string as the input ``<string>`` repeated ``<count>`` times.
Comparison
@@ -323,6 +334,9 @@ Comparison
Compare the strings and store true or false in the ``<output_variable>``.
+.. versionadded:: 3.7
+ Added the ``LESS_EQUAL`` and ``GREATER_EQUAL`` options.
+
.. _`Supported Hash Algorithms`:
Hashing
@@ -358,6 +372,9 @@ The supported ``<HASH>`` algorithm names are:
``SHA3_512``
Keccak SHA-3.
+.. versionadded:: 3.8
+ Added the ``SHA3_*`` hash algorithms.
+
Generation
^^^^^^^^^^
@@ -375,6 +392,8 @@ Convert all numbers into corresponding ASCII characters.
string(HEX <string> <output_variable>)
+.. versionadded:: 3.18
+
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.
@@ -451,6 +470,18 @@ specifiers:
%y The last two digits of the current year (00-99)
%Y The current year.
+.. versionadded:: 3.6
+ ``%s`` format specifier (UNIX time).
+
+.. versionadded:: 3.7
+ ``%a`` and ``%b`` format specifiers (abbreviated month and weekday names).
+
+.. versionadded:: 3.8
+ ``%%`` specifier (literal ``%``).
+
+.. versionadded:: 3.7
+ ``%A`` and ``%B`` format specifiers (full month and weekday names).
+
Unknown format specifiers will be ignored and copied to the output
as-is.
@@ -461,8 +492,7 @@ If no explicit ``<format_string>`` is given, it will default to:
%Y-%m-%dT%H:%M:%S for local time.
%Y-%m-%dT%H:%M:%SZ for UTC.
-.. note::
-
+.. versionadded:: 3.8
If the ``SOURCE_DATE_EPOCH`` environment variable is set,
its value will be used instead of the current time.
See https://reproducible-builds.org/specs/source-date-epoch/ for details.
@@ -474,6 +504,8 @@ If no explicit ``<format_string>`` is given, it will default to:
string(UUID <output_variable> NAMESPACE <namespace> NAME <name>
TYPE <MD5|SHA1> [UPPER])
+.. versionadded:: 3.1
+
Create a universally unique identifier (aka GUID) as per RFC4122
based on the hash of the combined values of ``<namespace>``
(which itself has to be a valid UUID) and ``<name>``.
@@ -489,6 +521,8 @@ with the optional ``UPPER`` flag.
JSON
^^^^
+.. versionadded:: 3.19
+
Functionality for querying a JSON string.
.. note::
diff --git a/Help/command/target_compile_definitions.rst b/Help/command/target_compile_definitions.rst
index 9e9c69093..3fb113a92 100644
--- a/Help/command/target_compile_definitions.rst
+++ b/Help/command/target_compile_definitions.rst
@@ -19,10 +19,12 @@ specify the scope of the following arguments. ``PRIVATE`` and ``PUBLIC``
items will populate the :prop_tgt:`COMPILE_DEFINITIONS` property of
``<target>``. ``PUBLIC`` and ``INTERFACE`` items will populate the
:prop_tgt:`INTERFACE_COMPILE_DEFINITIONS` property of ``<target>``.
-(:ref:`IMPORTED targets <Imported Targets>` only support ``INTERFACE`` items.)
The following arguments specify compile definitions. Repeated calls for the
same ``<target>`` append items in the order called.
+.. versionadded:: 3.11
+ Allow setting ``INTERFACE`` items on :ref:`IMPORTED targets <Imported Targets>`.
+
Arguments to ``target_compile_definitions`` may use "generator expressions"
with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
@@ -37,3 +39,12 @@ For example, the following are all equivalent:
target_compile_definitions(foo PUBLIC -DFOO) # -D removed
target_compile_definitions(foo PUBLIC "" FOO) # "" ignored
target_compile_definitions(foo PUBLIC -D FOO) # -D becomes "", then ignored
+
+Definitions may optionally have values:
+
+.. code-block:: cmake
+
+ target_compile_definitions(foo PUBLIC FOO=1)
+
+Note that many compilers treat ``-DFOO`` as equivalent to ``-DFOO=1``, but
+other tools may not recognize this in all circumstances (e.g. IntelliSense).
diff --git a/Help/command/target_compile_features.rst b/Help/command/target_compile_features.rst
index b50be34a6..58502bfc2 100644
--- a/Help/command/target_compile_features.rst
+++ b/Help/command/target_compile_features.rst
@@ -21,9 +21,11 @@ specify the scope of the features. ``PRIVATE`` and ``PUBLIC`` items will
populate the :prop_tgt:`COMPILE_FEATURES` property of ``<target>``.
``PUBLIC`` and ``INTERFACE`` items will populate the
:prop_tgt:`INTERFACE_COMPILE_FEATURES` property of ``<target>``.
-(:ref:`IMPORTED targets <Imported Targets>` only support ``INTERFACE`` items.)
Repeated calls for the same ``<target>`` append items.
+.. versionadded:: 3.11
+ Allow setting ``INTERFACE`` items on :ref:`IMPORTED targets <Imported Targets>`.
+
The named ``<target>`` must have been created by a command such as
:command:`add_executable` or :command:`add_library` and must not be an
:ref:`ALIAS target <Alias Targets>`.
diff --git a/Help/command/target_compile_options.rst b/Help/command/target_compile_options.rst
index 3c733c5d7..e45b209ad 100644
--- a/Help/command/target_compile_options.rst
+++ b/Help/command/target_compile_options.rst
@@ -26,10 +26,12 @@ specify the scope of the following arguments. ``PRIVATE`` and ``PUBLIC``
items will populate the :prop_tgt:`COMPILE_OPTIONS` property of
``<target>``. ``PUBLIC`` and ``INTERFACE`` items will populate the
:prop_tgt:`INTERFACE_COMPILE_OPTIONS` property of ``<target>``.
-(:ref:`IMPORTED targets <Imported Targets>` only support ``INTERFACE`` items.)
The following arguments specify compile options. Repeated calls for the same
``<target>`` append items in the order called.
+.. versionadded:: 3.11
+ Allow setting ``INTERFACE`` items on :ref:`IMPORTED targets <Imported Targets>`.
+
Arguments to ``target_compile_options`` may use "generator expressions"
with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
diff --git a/Help/command/target_include_directories.rst b/Help/command/target_include_directories.rst
index 660e15c9b..3e53b2e4a 100644
--- a/Help/command/target_include_directories.rst
+++ b/Help/command/target_include_directories.rst
@@ -5,7 +5,7 @@ Add include directories to a target.
.. code-block:: cmake
- target_include_directories(<target> [SYSTEM] [BEFORE]
+ target_include_directories(<target> [SYSTEM] [AFTER|BEFORE]
<INTERFACE|PUBLIC|PRIVATE> [items1...]
[<INTERFACE|PUBLIC|PRIVATE> [items2...] ...])
@@ -14,17 +14,19 @@ The named ``<target>`` must have been created by a command such
as :command:`add_executable` or :command:`add_library` and must not be an
:ref:`ALIAS target <Alias Targets>`.
-If ``BEFORE`` is specified, the content will be prepended to the property
-instead of being appended.
+By using ``AFTER`` or ``BEFORE`` explicitly, you can select between appending
+and prepending, independent of the default.
The ``INTERFACE``, ``PUBLIC`` and ``PRIVATE`` keywords are required to specify
the scope of the following arguments. ``PRIVATE`` and ``PUBLIC`` items will
populate the :prop_tgt:`INCLUDE_DIRECTORIES` property of ``<target>``.
``PUBLIC`` and ``INTERFACE`` items will populate the
:prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` property of ``<target>``.
-(:ref:`IMPORTED targets <Imported Targets>` only support ``INTERFACE`` items.)
The following arguments specify include directories.
+.. versionadded:: 3.11
+ Allow setting ``INTERFACE`` items on :ref:`IMPORTED targets <Imported Targets>`.
+
Specified include directories may be absolute paths or relative paths.
Repeated calls for the same <target> append items in the order called. If
``SYSTEM`` is specified, the compiler will be told the
diff --git a/Help/command/target_link_libraries.rst b/Help/command/target_link_libraries.rst
index c2e7e8ac9..872e264e9 100644
--- a/Help/command/target_link_libraries.rst
+++ b/Help/command/target_link_libraries.rst
@@ -27,6 +27,10 @@ set to ``NEW`` then the target must have been created in the current
directory. Repeated calls for the same ``<target>`` append items in
the order called.
+.. versionadded:: 3.13
+ The ``<target>`` doesn't have to be defined in the same directory as the
+ ``target_link_libraries`` call.
+
Each ``<item>`` may be:
* **A library target name**: The generated link line will have the
@@ -62,10 +66,11 @@ Each ``<item>`` may be:
:ref:`usage requirement <Target Usage Requirements>`. This has the same
effect as passing the framework directory as an include directory.
- On :ref:`Visual Studio Generators` for VS 2010 and above, library files
- ending in ``.targets`` will be treated as MSBuild targets files and
- imported into generated project files. This is not supported by other
- generators.
+ .. versionadded:: 3.8
+ On :ref:`Visual Studio Generators` for VS 2010 and above, library files
+ ending in ``.targets`` will be treated as MSBuild targets files and
+ imported into generated project files. This is not supported by other
+ generators.
The full path to the library file will be quoted/escaped for
the shell automatically.
@@ -89,6 +94,11 @@ Each ``<item>`` may be:
flags explicitly. The flags will then be placed at the toolchain-defined
flag position in the link command.
+ .. versionadded:: 3.13
+ :prop_tgt:`LINK_OPTIONS` target property and :command:`target_link_options`
+ command. For earlier versions of CMake, use :prop_tgt:`LINK_FLAGS`
+ property instead.
+
The link flag is treated as a command-line string fragment and
will be used with no extra quoting or escaping.
@@ -216,6 +226,8 @@ is not ``NEW``, they are also appended to the
Linking Object Libraries
^^^^^^^^^^^^^^^^^^^^^^^^
+.. versionadded:: 3.12
+
:ref:`Object Libraries` may be used as the ``<target>`` (first) argument
of ``target_link_libraries`` to specify dependencies of their sources
on other libraries. For example, the code
diff --git a/Help/command/target_link_options.rst b/Help/command/target_link_options.rst
index e59e0e1c6..87dff39ae 100644
--- a/Help/command/target_link_options.rst
+++ b/Help/command/target_link_options.rst
@@ -36,10 +36,12 @@ specify the scope of the following arguments. ``PRIVATE`` and ``PUBLIC``
items will populate the :prop_tgt:`LINK_OPTIONS` property of
``<target>``. ``PUBLIC`` and ``INTERFACE`` items will populate the
:prop_tgt:`INTERFACE_LINK_OPTIONS` property of ``<target>``.
-(:ref:`IMPORTED targets <Imported Targets>` only support ``INTERFACE`` items.)
The following arguments specify link options. Repeated calls for the same
``<target>`` append items in the order called.
+.. note::
+ :ref:`IMPORTED targets <Imported Targets>` only support ``INTERFACE`` items.
+
Arguments to ``target_link_options`` may use "generator expressions"
with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
diff --git a/Help/command/target_precompile_headers.rst b/Help/command/target_precompile_headers.rst
index 700518063..9f7dabbd4 100644
--- a/Help/command/target_precompile_headers.rst
+++ b/Help/command/target_precompile_headers.rst
@@ -34,7 +34,7 @@ Repeated calls for the same ``<target>`` will append items in the order called.
Projects should generally avoid using ``PUBLIC`` or ``INTERFACE`` for targets
that will be :ref:`exported <install(EXPORT)>`, or they should at least use
-the ``$<BUILD_INTERFACE:...>`` generator expression to prevent precompile
+the :genex:`$<BUILD_INTERFACE:...>` generator expression to prevent precompile
headers from appearing in an installed exported target. Consumers of a target
should typically be in control of what precompile headers they use, not have
precompile headers forced on them by the targets being consumed (since
@@ -74,7 +74,7 @@ Arguments to ``target_precompile_headers()`` may use "generator expressions"
with the syntax ``$<...>``.
See the :manual:`cmake-generator-expressions(7)` manual for available
expressions.
-The ``$<COMPILE_LANGUAGE:...>`` generator expression is particularly
+The :genex:`$<COMPILE_LANGUAGE:...>` generator expression is particularly
useful for specifying a language-specific header to precompile for
only one language (e.g. ``CXX`` and not ``C``). In this case, header
file names that are not explicitly in double quotes or angle brackets
diff --git a/Help/command/target_sources.rst b/Help/command/target_sources.rst
index 653b8d7c5..520614a17 100644
--- a/Help/command/target_sources.rst
+++ b/Help/command/target_sources.rst
@@ -12,27 +12,37 @@ Add sources to a target.
[<INTERFACE|PUBLIC|PRIVATE> [items2...] ...])
Specifies sources to use when building a target and/or its dependents.
-Relative source file paths are interpreted as being relative to the current
-source directory (i.e. :variable:`CMAKE_CURRENT_SOURCE_DIR`). The
-named ``<target>`` must have been created by a command such as
-:command:`add_executable` or :command:`add_library` and must not be an
+The named ``<target>`` must have been created by a command such as
+:command:`add_executable` or :command:`add_library` or
+:command:`add_custom_target` and must not be an
:ref:`ALIAS target <Alias Targets>`.
+.. versionchanged:: 3.13
+ Relative source file paths are interpreted as being relative to the current
+ source directory (i.e. :variable:`CMAKE_CURRENT_SOURCE_DIR`).
+ See policy :policy:`CMP0076`.
+
+.. versionadded:: 3.20
+ ``<target>`` can be a custom target.
+
The ``INTERFACE``, ``PUBLIC`` and ``PRIVATE`` keywords are required to
specify the scope of the items following them. ``PRIVATE`` and ``PUBLIC``
items will populate the :prop_tgt:`SOURCES` property of
``<target>``, which are used when building the target itself.
``PUBLIC`` and ``INTERFACE`` items will populate the
:prop_tgt:`INTERFACE_SOURCES` property of ``<target>``, which are used
-when building dependents. (:ref:`IMPORTED targets <Imported Targets>`
-only support ``INTERFACE`` items because they are not build targets.)
+when building dependents.
The following arguments specify sources. Repeated calls for the same
-``<target>`` append items in the order called.
+``<target>`` append items in the order called. The targets created by
+:command:`add_custom_target` can only have ``PRIVATE`` scope.
+
+.. versionadded:: 3.3
+ Allow exporting targets with :prop_tgt:`INTERFACE_SOURCES`.
+
+.. versionadded:: 3.11
+ Allow setting ``INTERFACE`` items on :ref:`IMPORTED targets <Imported Targets>`.
Arguments to ``target_sources`` may use "generator expressions"
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.
-
-See also the :policy:`CMP0076` policy for older behavior related to the
-handling of relative source file paths.
diff --git a/Help/command/try_compile.rst b/Help/command/try_compile.rst
index 323077af1..06da910dd 100644
--- a/Help/command/try_compile.rst
+++ b/Help/command/try_compile.rst
@@ -19,6 +19,10 @@ Try Compiling Whole Projects
Try building a project. The success or failure of the ``try_compile``,
i.e. ``TRUE`` or ``FALSE`` respectively, is returned in ``<resultVar>``.
+.. versionadded:: 3.14
+ The name of the ``<resultVar>`` is defined by the user. Previously, it had
+ a fixed name ``RESULT_VAR``.
+
In this form, ``<srcdir>`` should contain a complete CMake project with a
``CMakeLists.txt`` file and all sources. The ``<bindir>`` and ``<srcdir>``
will not be deleted after this command is run. Specify ``<targetName>`` to
@@ -47,6 +51,10 @@ Try building an executable or static library from one or more source files
variable). The success or failure of the ``try_compile``, i.e. ``TRUE`` or
``FALSE`` respectively, is returned in ``<resultVar>``.
+.. versionadded:: 3.14
+ The name of the ``<resultVar>`` is defined by the user. Previously, it had
+ a fixed name ``RESULT_VAR``.
+
In this form, one or more source files must be provided. If
:variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` is unset or is set to ``EXECUTABLE``,
the sources must include a definition for ``main`` and CMake will create a
@@ -94,6 +102,8 @@ The options are:
given to the ``CMAKE_FLAGS`` option will be ignored.
``LINK_OPTIONS <options>...``
+ .. versionadded:: 3.14
+
Specify link step options to pass to :command:`target_link_options` or to
set the :prop_tgt:`STATIC_LIBRARY_OPTIONS` target property in the generated
project, depending on the :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` variable.
@@ -102,17 +112,23 @@ The options are:
Store the output from the build process in the given variable.
``<LANG>_STANDARD <std>``
+ .. versionadded:: 3.8
+
Specify the :prop_tgt:`C_STANDARD`, :prop_tgt:`CXX_STANDARD`,
:prop_tgt:`OBJC_STANDARD`, :prop_tgt:`OBJCXX_STANDARD`,
or :prop_tgt:`CUDA_STANDARD` target property of the generated project.
``<LANG>_STANDARD_REQUIRED <bool>``
+ .. versionadded:: 3.8
+
Specify the :prop_tgt:`C_STANDARD_REQUIRED`,
:prop_tgt:`CXX_STANDARD_REQUIRED`, :prop_tgt:`OBJC_STANDARD_REQUIRED`,
:prop_tgt:`OBJCXX_STANDARD_REQUIRED`,or :prop_tgt:`CUDA_STANDARD_REQUIRED`
target property of the generated project.
``<LANG>_EXTENSIONS <bool>``
+ .. versionadded:: 3.8
+
Specify the :prop_tgt:`C_EXTENSIONS`, :prop_tgt:`CXX_EXTENSIONS`,
:prop_tgt:`OBJC_EXTENSIONS`, :prop_tgt:`OBJCXX_EXTENSIONS`,
or :prop_tgt:`CUDA_EXTENSIONS` target property of the generated project.
@@ -131,24 +147,26 @@ the try_compile call of interest, and then re-run cmake again with
Other Behavior Settings
^^^^^^^^^^^^^^^^^^^^^^^
-If set, the following variables are passed in to the generated
-try_compile CMakeLists.txt to initialize compile target properties with
-default values:
+.. versionadded:: 3.4
+ If set, the following variables are passed in to the generated
+ try_compile CMakeLists.txt to initialize compile target properties with
+ default values:
-* :variable:`CMAKE_CUDA_RUNTIME_LIBRARY`
-* :variable:`CMAKE_ENABLE_EXPORTS`
-* :variable:`CMAKE_LINK_SEARCH_START_STATIC`
-* :variable:`CMAKE_LINK_SEARCH_END_STATIC`
-* :variable:`CMAKE_MSVC_RUNTIME_LIBRARY`
-* :variable:`CMAKE_POSITION_INDEPENDENT_CODE`
+ * :variable:`CMAKE_CUDA_RUNTIME_LIBRARY`
+ * :variable:`CMAKE_ENABLE_EXPORTS`
+ * :variable:`CMAKE_LINK_SEARCH_START_STATIC`
+ * :variable:`CMAKE_LINK_SEARCH_END_STATIC`
+ * :variable:`CMAKE_MSVC_RUNTIME_LIBRARY`
+ * :variable:`CMAKE_POSITION_INDEPENDENT_CODE`
-If :policy:`CMP0056` is set to ``NEW``, then
-:variable:`CMAKE_EXE_LINKER_FLAGS` is passed in as well.
+ If :policy:`CMP0056` is set to ``NEW``, then
+ :variable:`CMAKE_EXE_LINKER_FLAGS` is passed in as well.
-If :policy:`CMP0083` is set to ``NEW``, then in order to obtain correct
-behavior at link time, the ``check_pie_supported()`` command from the
-:module:`CheckPIESupported` module must be called before using the
-:command:`try_compile` command.
+.. versionchanged:: 3.14
+ If :policy:`CMP0083` is set to ``NEW``, then in order to obtain correct
+ behavior at link time, the ``check_pie_supported()`` command from the
+ :module:`CheckPIESupported` module must be called before using the
+ :command:`try_compile` command.
The current settings of :policy:`CMP0065` and :policy:`CMP0083` are propagated
through to the generated test project.
@@ -156,37 +174,41 @@ through to the generated test project.
Set the :variable:`CMAKE_TRY_COMPILE_CONFIGURATION` variable to choose
a build configuration.
-Set the :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` variable to specify
-the type of target used for the source file signature.
-
-Set the :variable:`CMAKE_TRY_COMPILE_PLATFORM_VARIABLES` variable to specify
-variables that must be propagated into the test project. This variable is
-meant for use only in toolchain files and is only honored by the
-``try_compile()`` command for the source files form, not when given a whole
-project.
-
-If :policy:`CMP0067` is set to ``NEW``, or any of the ``<LANG>_STANDARD``,
-``<LANG>_STANDARD_REQUIRED``, or ``<LANG>_EXTENSIONS`` options are used,
-then the language standard variables are honored:
-
-* :variable:`CMAKE_C_STANDARD`
-* :variable:`CMAKE_C_STANDARD_REQUIRED`
-* :variable:`CMAKE_C_EXTENSIONS`
-* :variable:`CMAKE_CXX_STANDARD`
-* :variable:`CMAKE_CXX_STANDARD_REQUIRED`
-* :variable:`CMAKE_CXX_EXTENSIONS`
-* :variable:`CMAKE_OBJC_STANDARD`
-* :variable:`CMAKE_OBJC_STANDARD_REQUIRED`
-* :variable:`CMAKE_OBJC_EXTENSIONS`
-* :variable:`CMAKE_OBJCXX_STANDARD`
-* :variable:`CMAKE_OBJCXX_STANDARD_REQUIRED`
-* :variable:`CMAKE_OBJCXX_EXTENSIONS`
-* :variable:`CMAKE_CUDA_STANDARD`
-* :variable:`CMAKE_CUDA_STANDARD_REQUIRED`
-* :variable:`CMAKE_CUDA_EXTENSIONS`
-
-Their values are used to set the corresponding target properties in
-the generated project (unless overridden by an explicit option).
-
-For the :generator:`Green Hills MULTI` generator the GHS toolset and target
-system customization cache variables are also propagated into the test project.
+.. versionadded:: 3.6
+ Set the :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` variable to specify
+ the type of target used for the source file signature.
+
+.. versionadded:: 3.6
+ Set the :variable:`CMAKE_TRY_COMPILE_PLATFORM_VARIABLES` variable to specify
+ variables that must be propagated into the test project. This variable is
+ meant for use only in toolchain files and is only honored by the
+ ``try_compile()`` command for the source files form, not when given a whole
+ project.
+
+.. versionchanged:: 3.8
+ If :policy:`CMP0067` is set to ``NEW``, or any of the ``<LANG>_STANDARD``,
+ ``<LANG>_STANDARD_REQUIRED``, or ``<LANG>_EXTENSIONS`` options are used,
+ then the language standard variables are honored:
+
+ * :variable:`CMAKE_C_STANDARD`
+ * :variable:`CMAKE_C_STANDARD_REQUIRED`
+ * :variable:`CMAKE_C_EXTENSIONS`
+ * :variable:`CMAKE_CXX_STANDARD`
+ * :variable:`CMAKE_CXX_STANDARD_REQUIRED`
+ * :variable:`CMAKE_CXX_EXTENSIONS`
+ * :variable:`CMAKE_OBJC_STANDARD`
+ * :variable:`CMAKE_OBJC_STANDARD_REQUIRED`
+ * :variable:`CMAKE_OBJC_EXTENSIONS`
+ * :variable:`CMAKE_OBJCXX_STANDARD`
+ * :variable:`CMAKE_OBJCXX_STANDARD_REQUIRED`
+ * :variable:`CMAKE_OBJCXX_EXTENSIONS`
+ * :variable:`CMAKE_CUDA_STANDARD`
+ * :variable:`CMAKE_CUDA_STANDARD_REQUIRED`
+ * :variable:`CMAKE_CUDA_EXTENSIONS`
+
+ Their values are used to set the corresponding target properties in
+ the generated project (unless overridden by an explicit option).
+
+.. versionchanged:: 3.14
+ For the :generator:`Green Hills MULTI` generator the GHS toolset and target
+ system customization cache variables are also propagated into the test project.
diff --git a/Help/command/try_run.rst b/Help/command/try_run.rst
index d401ebe92..404de985d 100644
--- a/Help/command/try_run.rst
+++ b/Help/command/try_run.rst
@@ -20,6 +20,7 @@ Try Compiling and Running Source Files
[COMPILE_OUTPUT_VARIABLE <var>]
[RUN_OUTPUT_VARIABLE <var>]
[OUTPUT_VARIABLE <var>]
+ [WORKING_DIRECTORY <var>]
[ARGS <args>...])
Try compiling a ``<srcfile>``. Returns ``TRUE`` or ``FALSE`` for success
@@ -29,6 +30,11 @@ executable was built, but failed to run, then ``<runResultVar>`` will be
set to ``FAILED_TO_RUN``. See the :command:`try_compile` command for
information on how the test project is constructed to build the source file.
+.. versionadded:: 3.14
+ The names of the result variables ``<runResultVar>`` and
+ ``<compileResultVar>`` are defined by the user. Previously, they had
+ fixed names ``RUN_RESULT_VAR`` and ``COMPILE_RESULT_VAR``.
+
The options are:
``CMAKE_FLAGS <flags>...``
@@ -46,6 +52,8 @@ The options are:
Report the compile step build output in a given variable.
``LINK_LIBRARIES <libs>...``
+ .. versionadded:: 3.2
+
Specify libraries to be linked in the generated project.
The list of libraries may refer to system libraries and to
:ref:`Imported Targets <Imported Targets>` from the calling project.
@@ -54,6 +62,8 @@ The options are:
given to the ``CMAKE_FLAGS`` option will be ignored.
``LINK_OPTIONS <options>...``
+ .. versionadded:: 3.14
+
Specify link step options to pass to :command:`target_link_options` in the
generated project.
@@ -65,6 +75,12 @@ The options are:
``RUN_OUTPUT_VARIABLE <var>``
Report the output from running the executable in a given variable.
+``WORKING_DIRECTORY <var>``
+ .. versionadded:: 3.20
+
+ Run the executable in the given directory. If no ``WORKING_DIRECTORY`` is
+ specified, the executable will run in ``<bindir>``.
+
Other Behavior Settings
^^^^^^^^^^^^^^^^^^^^^^^
@@ -74,6 +90,10 @@ a build configuration.
Behavior when Cross Compiling
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. versionadded:: 3.3
+ Use ``CMAKE_CROSSCOMPILING_EMULATOR`` when running cross-compiled
+ binaries.
+
When cross compiling, the executable compiled in the first step
usually cannot be run on the build host. The ``try_run`` command checks
the :variable:`CMAKE_CROSSCOMPILING` variable to detect whether CMake is in
diff --git a/Help/cpack_gen/archive.rst b/Help/cpack_gen/archive.rst
index 3656aa2d5..b9418126f 100644
--- a/Help/cpack_gen/archive.rst
+++ b/Help/cpack_gen/archive.rst
@@ -12,6 +12,12 @@ any of the following formats:
- TZST (.tar.zst)
- ZIP (.zip)
+.. versionadded:: 3.1
+ ``7Z`` and ``TXZ`` formats support.
+
+.. versionadded:: 3.16
+ ``TZST`` format support.
+
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
@@ -46,6 +52,9 @@ Variables specific to CPack Archive generator
The default is ``<CPACK_PACKAGE_FILE_NAME>[-<component>]``, with spaces
replaced by '-'.
+ .. versionadded:: 3.9
+ Per-component ``CPACK_ARCHIVE_<component>_FILE_NAME`` variables.
+
.. variable:: CPACK_ARCHIVE_COMPONENT_INSTALL
Enable component packaging. If enabled (ON), then the archive generator
@@ -63,12 +72,16 @@ CPack generators which are essentially archives at their core. These include:
.. variable:: CPACK_ARCHIVE_THREADS
+ .. versionadded:: 3.18
+
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.
+ See also the :variable:`CPACK_THREADS` variable.
+
.. note::
Official CMake binaries available on ``cmake.org`` ship with a ``liblzma``
diff --git a/Help/cpack_gen/bundle.rst b/Help/cpack_gen/bundle.rst
index b16dbda03..5e335c07b 100644
--- a/Help/cpack_gen/bundle.rst
+++ b/Help/cpack_gen/bundle.rst
@@ -36,6 +36,8 @@ Bundle-specific parameters (``CPACK_BUNDLE_xxx``).
.. variable:: CPACK_BUNDLE_APPLE_CERT_APP
+ .. versionadded:: 3.2
+
The name of your Apple supplied code signing certificate for the application.
The name usually takes the form ``Developer ID Application: [Name]`` or
``3rd Party Mac Developer Application: [Name]``. If this variable is not set
@@ -43,23 +45,31 @@ Bundle-specific parameters (``CPACK_BUNDLE_xxx``).
.. variable:: CPACK_BUNDLE_APPLE_ENTITLEMENTS
+ .. versionadded:: 3.2
+
The name of the Property List (``.plist``) file that contains your Apple
entitlements for sandboxing your application. This file is required
for submission to the macOS App Store.
.. variable:: CPACK_BUNDLE_APPLE_CODESIGN_FILES
+ .. versionadded:: 3.2
+
A list of additional files that you wish to be signed. You do not need to
list the main application folder, or the main executable. You should
list any frameworks and plugins that are included in your app bundle.
.. variable:: CPACK_BUNDLE_APPLE_CODESIGN_PARAMETER
+ .. versionadded:: 3.3
+
Additional parameter that will passed to ``codesign``.
Default value: ``--deep -f``
.. variable:: CPACK_COMMAND_CODESIGN
+ .. versionadded:: 3.2
+
Path to the ``codesign(1)`` command used to sign applications with an
Apple cert. This variable can be used to override the automatically
detected command (or specify its location if the auto-detection fails
diff --git a/Help/cpack_gen/cygwin.rst b/Help/cpack_gen/cygwin.rst
index c65653efb..c537a796a 100644
--- a/Help/cpack_gen/cygwin.rst
+++ b/Help/cpack_gen/cygwin.rst
@@ -6,7 +6,9 @@ Cygwin CPack generator (Cygwin).
Variables affecting the CPack Cygwin generator
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- - :variable:`CPACK_ARCHIVE_THREADS`
+- .. versionadded:: 3.18
+ :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 bf50c555d..03c4ea8db 100644
--- a/Help/cpack_gen/deb.rst
+++ b/Help/cpack_gen/deb.rst
@@ -54,11 +54,16 @@ List of CPack DEB generator specific variables:
- :variable:`CPACK_DEBIAN_PACKAGE_NAME` suffixed with -<COMPONENT>
for component-based installations.
+ .. versionadded:: 3.5
+ Per-component ``CPACK_DEBIAN_<COMPONENT>_PACKAGE_NAME`` variables.
+
See https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Source
.. variable:: CPACK_DEBIAN_FILE_NAME
CPACK_DEBIAN_<COMPONENT>_FILE_NAME
+ .. versionadded:: 3.6
+
Package file name.
* Mandatory : YES
@@ -72,6 +77,9 @@ List of CPack DEB generator specific variables:
Alternatively provided package file name must end
with either ``.deb`` or ``.ipk`` suffix.
+ .. versionadded:: 3.10
+ ``.ipk`` suffix used by OPKG packaging system.
+
.. note::
Preferred setting of this variable is ``DEB-DEFAULT`` but for backward
@@ -86,6 +94,8 @@ List of CPack DEB generator specific variables:
.. variable:: CPACK_DEBIAN_PACKAGE_EPOCH
+ .. versionadded:: 3.10
+
The Debian package epoch
* Mandatory : No
@@ -116,6 +126,8 @@ List of CPack DEB generator specific variables:
.. variable:: CPACK_DEBIAN_PACKAGE_RELEASE
+ .. versionadded:: 3.6
+
The Debian package release - Debian revision number.
* Mandatory : No
@@ -136,6 +148,9 @@ List of CPack DEB generator specific variables:
* Default : Output of ``dpkg --print-architecture`` (or ``i386``
if ``dpkg`` is not found)
+ .. versionadded:: 3.6
+ Per-component ``CPACK_DEBIAN_<COMPONENT>_PACKAGE_ARCHITECTURE`` variables.
+
.. variable:: CPACK_DEBIAN_PACKAGE_DEPENDS
CPACK_DEBIAN_<COMPONENT>_PACKAGE_DEPENDS
@@ -148,6 +163,10 @@ List of CPack DEB generator specific variables:
- :variable:`CPACK_DEBIAN_PACKAGE_DEPENDS` for component-based
installations.
+
+ .. versionadded:: 3.3
+ Per-component ``CPACK_DEBIAN_<COMPONENT>_PACKAGE_DEPENDS`` variables.
+
.. note::
If :variable:`CPACK_DEBIAN_PACKAGE_SHLIBDEPS` or
@@ -165,7 +184,9 @@ List of CPack DEB generator specific variables:
.. variable:: CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS
- Sets inter component dependencies if listed with
+ .. versionadded:: 3.6
+
+ Sets inter-component dependencies if listed with
:variable:`CPACK_COMPONENT_<compName>_DEPENDS` variables.
* Mandatory : NO
@@ -196,6 +217,15 @@ List of CPack DEB generator specific variables:
used if set. Otherwise, :variable:`CPACK_PACKAGE_DESCRIPTION_SUMMARY` will be added as the first
line of description as defined in `Debian Policy Manual`_.
+ .. versionadded:: 3.3
+ Per-component ``CPACK_COMPONENT_<compName>_DESCRIPTION`` variables.
+
+ .. versionadded:: 3.16
+ Per-component ``CPACK_DEBIAN_<COMPONENT>_DESCRIPTION`` variables.
+
+ .. versionadded:: 3.16
+ The ``CPACK_PACKAGE_DESCRIPTION_FILE`` variable.
+
.. _Debian Policy Manual: https://www.debian.org/doc/debian-policy/ch-controlfields.html#description
.. variable:: CPACK_DEBIAN_PACKAGE_SECTION
@@ -206,10 +236,17 @@ List of CPack DEB generator specific variables:
* Mandatory : YES
* Default : "devel"
+ .. versionadded:: 3.5
+ Per-component ``CPACK_DEBIAN_<COMPONENT>_PACKAGE_SECTION`` variables.
+
See https://www.debian.org/doc/debian-policy/ch-archive.html#s-subsections
.. variable:: CPACK_DEBIAN_ARCHIVE_TYPE
+ .. versionadded:: 3.7
+
+ .. deprecated:: 3.14
+
The archive format used for creating the Debian package.
* Mandatory : YES
@@ -228,6 +265,8 @@ List of CPack DEB generator specific variables:
.. variable:: CPACK_DEBIAN_COMPRESSION_TYPE
+ .. versionadded:: 3.1
+
The compression used for creating the Debian package.
* Mandatory : YES
@@ -249,6 +288,9 @@ List of CPack DEB generator specific variables:
* Mandatory : YES
* Default : "optional"
+ .. versionadded:: 3.5
+ Per-component ``CPACK_DEBIAN_<COMPONENT>_PACKAGE_PRIORITY`` varables.
+
See https://www.debian.org/doc/debian-policy/ch-archive.html#s-priorities
.. variable:: CPACK_DEBIAN_PACKAGE_HOMEPAGE
@@ -260,6 +302,9 @@ List of CPack DEB generator specific variables:
* Mandatory : NO
* Default : :variable:`CMAKE_PROJECT_HOMEPAGE_URL`
+ .. versionadded:: 3.12
+ The ``CMAKE_PROJECT_HOMEPAGE_URL`` variable.
+
.. note::
The content of this field is a simple URL without any surrounding
@@ -284,6 +329,36 @@ List of CPack DEB generator specific variables:
may fail to find your own shared libs.
See https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling
+ .. note::
+
+ You can also set :variable:`CPACK_DEBIAN_PACKAGE_SHLIBDEPS_PRIVATE_DIRS`
+ to an appropriate value if you use this feature, in order to please
+ ``dpkg-shlibdeps``. However, you should only do this for private
+ shared libraries that could not get resolved otherwise.
+
+ .. versionadded:: 3.3
+ Per-component ``CPACK_DEBIAN_<COMPONENT>_PACKAGE_SHLIBDEPS`` variables.
+
+ .. versionadded:: 3.6
+ Correct handling of ``$ORIGIN`` in :variable:`CMAKE_INSTALL_RPATH`.
+
+.. variable:: CPACK_DEBIAN_PACKAGE_SHLIBDEPS_PRIVATE_DIRS
+
+ .. versionadded:: 3.20
+
+ May be set to a list of directories that will be given to ``dpkg-shlibdeps``
+ via its ``-l`` option. These will be searched by ``dpkg-shlibdeps`` in order
+ to find private shared library dependencies.
+
+ * Mandatory : NO
+ * Default :
+
+ .. note::
+
+ You should prefer to set :variable:`CMAKE_INSTALL_RPATH` to an appropriate
+ value if you use ``dpkg-shlibdeps``. The current option is really only
+ needed for private shared library dependencies.
+
.. variable:: CPACK_DEBIAN_PACKAGE_DEBUG
May be set when invoking cpack in order to trace debug information
@@ -308,6 +383,9 @@ List of CPack DEB generator specific variables:
- :variable:`CPACK_DEBIAN_PACKAGE_PREDEPENDS` for component-based
installations.
+ .. versionadded:: 3.4
+ Per-component ``CPACK_DEBIAN_<COMPONENT>_PACKAGE_PREDEPENDS`` variables.
+
See http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
.. variable:: CPACK_DEBIAN_PACKAGE_ENHANCES
@@ -325,6 +403,9 @@ List of CPack DEB generator specific variables:
- :variable:`CPACK_DEBIAN_PACKAGE_ENHANCES` for component-based
installations.
+ .. versionadded:: 3.4
+ Per-component ``CPACK_DEBIAN_<COMPONENT>_PACKAGE_ENHANCES`` variables.
+
See http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
.. variable:: CPACK_DEBIAN_PACKAGE_BREAKS
@@ -345,6 +426,9 @@ List of CPack DEB generator specific variables:
- :variable:`CPACK_DEBIAN_PACKAGE_BREAKS` for component-based
installations.
+ .. versionadded:: 3.4
+ Per-component ``CPACK_DEBIAN_<COMPONENT>_PACKAGE_BREAKS`` variables.
+
See https://www.debian.org/doc/debian-policy/ch-relationships.html#s-breaks
.. variable:: CPACK_DEBIAN_PACKAGE_CONFLICTS
@@ -362,6 +446,9 @@ List of CPack DEB generator specific variables:
- :variable:`CPACK_DEBIAN_PACKAGE_CONFLICTS` for component-based
installations.
+ .. versionadded:: 3.4
+ Per-component ``CPACK_DEBIAN_<COMPONENT>_PACKAGE_CONFLICTS`` variables.
+
See https://www.debian.org/doc/debian-policy/ch-relationships.html#s-conflicts
.. note::
@@ -386,6 +473,9 @@ List of CPack DEB generator specific variables:
- :variable:`CPACK_DEBIAN_PACKAGE_PROVIDES` for component-based
installations.
+ .. versionadded:: 3.4
+ Per-component ``CPACK_DEBIAN_<COMPONENT>_PACKAGE_PROVIDES`` variables.
+
See https://www.debian.org/doc/debian-policy/ch-relationships.html#s-virtual
.. variable:: CPACK_DEBIAN_PACKAGE_REPLACES
@@ -402,6 +492,9 @@ List of CPack DEB generator specific variables:
- :variable:`CPACK_DEBIAN_PACKAGE_REPLACES` for component-based
installations.
+ .. versionadded:: 3.4
+ Per-component ``CPACK_DEBIAN_<COMPONENT>_PACKAGE_REPLACES`` variables.
+
See http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
.. variable:: CPACK_DEBIAN_PACKAGE_RECOMMENDS
@@ -418,6 +511,9 @@ List of CPack DEB generator specific variables:
- :variable:`CPACK_DEBIAN_PACKAGE_RECOMMENDS` for component-based
installations.
+ .. versionadded:: 3.4
+ Per-component ``CPACK_DEBIAN_<COMPONENT>_PACKAGE_RECOMMENDS`` variables.
+
See http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
.. variable:: CPACK_DEBIAN_PACKAGE_SUGGESTS
@@ -433,10 +529,15 @@ List of CPack DEB generator specific variables:
- :variable:`CPACK_DEBIAN_PACKAGE_SUGGESTS` for component-based
installations.
+ .. versionadded:: 3.4
+ Per-component ``CPACK_DEBIAN_<COMPONENT>_PACKAGE_SUGGESTS`` variables.
+
See http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
.. variable:: CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS
+ .. versionadded:: 3.6
+
* Mandatory : NO
* Default : OFF
@@ -451,6 +552,8 @@ List of CPack DEB generator specific variables:
.. variable:: CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS_POLICY
+ .. versionadded:: 3.6
+
Compatibility policy for auto-generated shlibs control file.
* Mandatory : NO
@@ -476,17 +579,14 @@ List of CPack DEB generator specific variables:
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
"${CMAKE_CURRENT_SOURCE_DIR}/prerm;${CMAKE_CURRENT_SOURCE_DIR}/postrm")
- .. note::
-
- The original permissions of the files will be used in the final
- package unless the variable
- :variable:`CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION` is set.
- In particular, the scripts should have the proper executable
- flag prior to the generation of the package.
+ .. versionadded:: 3.4
+ Per-component ``CPACK_DEBIAN_<COMPONENT>_PACKAGE_CONTROL_EXTRA`` variables.
.. variable:: CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION
CPACK_DEBIAN_<COMPONENT>_PACKAGE_CONTROL_STRICT_PERMISSION
+ .. versionadded:: 3.4
+
This variable indicates if the Debian policy on control files should be
strictly followed.
@@ -497,15 +597,22 @@ List of CPack DEB generator specific variables:
set(CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION TRUE)
+ This overrides the permissions on the original files, following the rules
+ set by Debian policy
+ https://www.debian.org/doc/debian-policy/ch-files.html#s-permissions-owners
+
.. note::
- This overrides the permissions on the original files, following the rules
- set by Debian policy
- https://www.debian.org/doc/debian-policy/ch-files.html#s-permissions-owners
+ The original permissions of the files will be used in the final
+ package unless this variable is set to ``TRUE``.
+ In particular, the scripts should have the proper executable
+ flag prior to the generation of the package.
.. variable:: CPACK_DEBIAN_PACKAGE_SOURCE
CPACK_DEBIAN_<COMPONENT>_PACKAGE_SOURCE
+ .. versionadded:: 3.5
+
Sets the ``Source`` field of the binary Debian package.
When the binary package name is not the same as the source package name
(in particular when several components/binaries are generated from one
@@ -529,6 +636,8 @@ List of CPack DEB generator specific variables:
Packaging of debug information
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. versionadded:: 3.13
+
Dbgsym packages contain debug symbols for debugging packaged binaries.
Dbgsym packaging has its own set of variables:
@@ -549,6 +658,8 @@ Dbgsym packaging has its own set of variables:
Building Debian packages on Windows
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. versionadded:: 3.10
+
To communicate UNIX file permissions from the install stage
to the CPack DEB generator the "cmake_mode_t" NTFS
alternate data stream (ADT) is used.
@@ -559,6 +670,8 @@ permissions can be preserved.
Reproducible packages
^^^^^^^^^^^^^^^^^^^^^
+.. versionadded:: 3.13
+
The environment variable ``SOURCE_DATE_EPOCH`` may be set to a UNIX
timestamp, defined as the number of seconds, excluding leap seconds,
since 01 Jan 1970 00:00:00 UTC. If set, the CPack DEB generator will
diff --git a/Help/cpack_gen/dmg.rst b/Help/cpack_gen/dmg.rst
index cede0f255..4c662a6f8 100644
--- a/Help/cpack_gen/dmg.rst
+++ b/Help/cpack_gen/dmg.rst
@@ -30,6 +30,8 @@ on macOS:
.. variable:: CPACK_DMG_DS_STORE_SETUP_SCRIPT
+ .. versionadded:: 3.5
+
Path to a custom AppleScript file. This AppleScript is used to generate
a ``.DS_Store`` file which specifies the Finder window position/geometry and
layout (such as hidden toolbars, placement of the icons etc.).
@@ -47,11 +49,15 @@ on macOS:
.. variable:: CPACK_DMG_DISABLE_APPLICATIONS_SYMLINK
+ .. versionadded:: 3.6
+
Default behaviour is to include a symlink to ``/Applications`` in the DMG.
Set this option to ``ON`` to avoid adding the symlink.
.. variable:: CPACK_DMG_SLA_DIR
+ .. versionadded:: 3.5
+
Directory where license and menu files for different languages are stored.
Setting this causes CPack to look for a ``<language>.menu.txt`` and
``<language>.license.txt`` or ``<language>.license.rtf`` file for every
@@ -61,8 +67,13 @@ on macOS:
``<language>.license.txt`` and ``<language>.license.rtf`` exist, the ``.txt``
file will be used.
+ .. versionadded:: 3.17
+ RTF support.
+
.. variable:: CPACK_DMG_SLA_LANGUAGES
+ .. versionadded:: 3.5
+
Languages for which a license agreement is provided when mounting the
generated DMG. A menu file consists of 9 lines of text. The first line is
is the name of the language itself, uppercase, in English (e.g. German).
@@ -85,6 +96,8 @@ on macOS:
.. variable:: CPACK_DMG_<component>_FILE_NAME
+ .. versionadded:: 3.17
+
File name when packaging ``<component>`` as its own DMG
(``CPACK_COMPONENTS_GROUPING`` set to IGNORE).
diff --git a/Help/cpack_gen/external.rst b/Help/cpack_gen/external.rst
index e54b356ac..4c083f085 100644
--- a/Help/cpack_gen/external.rst
+++ b/Help/cpack_gen/external.rst
@@ -1,6 +1,8 @@
CPack External Generator
------------------------
+.. versionadded:: 3.13
+
CPack provides many generators to create packages for a variety of platforms
and packaging systems. The intention is for CMake/CPack to be a complete
end-to-end solution for building and packaging a software project. However, it
@@ -284,6 +286,8 @@ Variables specific to CPack External generator
.. variable:: CPACK_EXTERNAL_BUILT_PACKAGES
+ .. versionadded:: 3.19
+
The ``CPACK_EXTERNAL_PACKAGE_SCRIPT`` script may set this list variable to the
full paths of generated package files. CPack will copy these files from the
staging directory back to the top build directory and possibly produce
diff --git a/Help/cpack_gen/freebsd.rst b/Help/cpack_gen/freebsd.rst
index 47a77847a..2c9356956 100644
--- a/Help/cpack_gen/freebsd.rst
+++ b/Help/cpack_gen/freebsd.rst
@@ -1,12 +1,15 @@
CPack FreeBSD Generator
-----------------------
+.. versionadded:: 3.10
+
The built in (binary) CPack FreeBSD (pkg) generator (Unix only)
Variables affecting the CPack FreeBSD (pkg) generator
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- - :variable:`CPACK_ARCHIVE_THREADS`
+- .. versionadded:: 3.18
+ :variable:`CPACK_ARCHIVE_THREADS`
Variables specific to CPack FreeBSD (pkg) generator
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -86,6 +89,9 @@ the RPM information (e.g. package license).
:variable:`CPACK_DEBIAN_PACKAGE_HOMEPAGE` (this may be set already
for Debian packaging, so we may as well re-use it).
+ .. versionadded:: 3.12
+ The ``CMAKE_PROJECT_HOMEPAGE_URL`` variable.
+
.. variable:: CPACK_FREEBSD_PACKAGE_LICENSE
The license, or licenses, which apply to this software package. This must
diff --git a/Help/cpack_gen/ifw.rst b/Help/cpack_gen/ifw.rst
index 5fbbfa27b..6817eac99 100644
--- a/Help/cpack_gen/ifw.rst
+++ b/Help/cpack_gen/ifw.rst
@@ -1,6 +1,8 @@
CPack IFW Generator
-------------------
+.. versionadded:: 3.1
+
Configure and run the Qt Installer Framework to generate a Qt installer.
.. only:: html
@@ -35,6 +37,8 @@ Debug
.. variable:: CPACK_IFW_VERBOSE
+ .. versionadded:: 3.3
+
Set to ``ON`` to enable addition debug output.
By default is ``OFF``.
@@ -71,41 +75,59 @@ Package
.. variable:: CPACK_IFW_PACKAGE_WATERMARK
+ .. versionadded:: 3.8
+
Filename for a watermark is used as QWizard::WatermarkPixmap.
.. variable:: CPACK_IFW_PACKAGE_BANNER
+ .. versionadded:: 3.8
+
Filename for a banner is used as QWizard::BannerPixmap.
.. variable:: CPACK_IFW_PACKAGE_BACKGROUND
+ .. versionadded:: 3.8
+
Filename for an image used as QWizard::BackgroundPixmap (only used by MacStyle).
.. variable:: CPACK_IFW_PACKAGE_WIZARD_STYLE
- Wizard style to be used ("Modern", "Mac", "Aero" or "Classic").
-
-.. variable:: CPACK_IFW_PACKAGE_STYLE_SHEET
+ .. versionadded:: 3.8
- Filename for a stylesheet.
+ Wizard style to be used ("Modern", "Mac", "Aero" or "Classic").
.. variable:: CPACK_IFW_PACKAGE_WIZARD_DEFAULT_WIDTH
+ .. versionadded:: 3.8
+
Default width of the wizard in pixels. Setting a banner image will override this.
.. variable:: CPACK_IFW_PACKAGE_WIZARD_DEFAULT_HEIGHT
+ .. versionadded:: 3.8
+
Default height of the wizard in pixels. Setting a watermark image will override this.
+.. variable:: CPACK_IFW_PACKAGE_WIZARD_SHOW_PAGE_LIST
+
+ .. versionadded:: 3.20
+
+ Set to ``OFF`` if the widget listing installer pages on the left side of the wizard should not be shown.
+
+ It is ``ON`` by default, but will only have an effect if using QtIFW 4.0 or later.
+
.. variable:: CPACK_IFW_PACKAGE_TITLE_COLOR
+ .. versionadded:: 3.8
+
Color of the titles and subtitles (takes an HTML color code, such as "#88FF33").
-.. variable:: CPACK_IFW_PACKAGE_START_MENU_DIRECTORY
+.. variable:: CPACK_IFW_PACKAGE_STYLE_SHEET
- Name of the default program group for the product in the Windows Start menu.
+ .. versionadded:: 3.15
- By default used :variable:`CPACK_IFW_PACKAGE_NAME`.
+ Filename for a stylesheet.
.. variable:: CPACK_IFW_TARGET_DIRECTORY
@@ -123,6 +145,14 @@ Package
You can use predefined variables.
+.. variable:: CPACK_IFW_PACKAGE_REMOVE_TARGET_DIR
+
+ .. versionadded:: 3.11
+
+ Set to ``OFF`` if the target directory should not be deleted when uninstalling.
+
+ Is ``ON`` by default
+
.. variable:: CPACK_IFW_PACKAGE_GROUP
The group, which will be used to configure the root package
@@ -132,43 +162,57 @@ Package
The root package name, which will be used if configuration group is not
specified
+.. variable:: CPACK_IFW_PACKAGE_START_MENU_DIRECTORY
+
+ .. versionadded:: 3.3
+
+ Name of the default program group for the product in the Windows Start menu.
+
+ By default used :variable:`CPACK_IFW_PACKAGE_NAME`.
+
.. variable:: CPACK_IFW_PACKAGE_MAINTENANCE_TOOL_NAME
+ .. versionadded:: 3.3
+
Filename of the generated maintenance tool.
The platform-specific executable file extension is appended.
By default used QtIFW defaults (``maintenancetool``).
-.. variable:: CPACK_IFW_PACKAGE_REMOVE_TARGET_DIR
-
- Set to ``OFF`` if the target directory should not be deleted when uninstalling.
-
- Is ``ON`` by default
-
.. variable:: CPACK_IFW_PACKAGE_MAINTENANCE_TOOL_INI_FILE
+ .. versionadded:: 3.3
+
Filename for the configuration of the generated maintenance tool.
By default used QtIFW defaults (``maintenancetool.ini``).
.. variable:: CPACK_IFW_PACKAGE_ALLOW_NON_ASCII_CHARACTERS
+ .. versionadded:: 3.3
+
Set to ``ON`` if the installation path can contain non-ASCII characters.
Is ``ON`` for QtIFW less 2.0 tools.
.. variable:: CPACK_IFW_PACKAGE_ALLOW_SPACE_IN_PATH
+ .. versionadded:: 3.3
+
Set to ``OFF`` if the installation path cannot contain space characters.
Is ``ON`` for QtIFW less 2.0 tools.
.. variable:: CPACK_IFW_PACKAGE_CONTROL_SCRIPT
+ .. versionadded:: 3.3
+
Filename for a custom installer control script.
.. variable:: CPACK_IFW_PACKAGE_RESOURCES
+ .. versionadded:: 3.7
+
List of additional resources ('.qrc' files) to include in the installer
binary.
@@ -177,6 +221,8 @@ Package
.. variable:: CPACK_IFW_PACKAGE_FILE_EXTENSION
+ .. versionadded:: 3.10
+
The target binary extension.
On Linux, the name of the target binary is automatically extended with
@@ -216,6 +262,8 @@ Components
.. variable:: CPACK_IFW_REPOSITORIES_DIRECTORIES
+ .. versionadded:: 3.10
+
Additional prepared repository dirs that will be used to resolve and
repack dependent components. This feature available only
since QtIFW 3.1.
@@ -225,6 +273,8 @@ QtIFW Tools
.. variable:: CPACK_IFW_FRAMEWORK_VERSION
+ .. versionadded:: 3.3
+
The version of used QtIFW tools.
The following variables provide the locations of the QtIFW
@@ -233,6 +283,8 @@ These variables are cached, and may be configured if needed.
.. variable:: CPACK_IFW_ARCHIVEGEN_EXECUTABLE
+ .. versionadded:: 3.19
+
The path to ``archivegen``.
.. variable:: CPACK_IFW_BINARYCREATOR_EXECUTABLE
@@ -260,6 +312,8 @@ the path may be specified in either a CMake or an environment variable:
.. variable:: CPACK_IFW_ROOT
+ .. versionadded:: 3.9
+
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
@@ -306,6 +360,8 @@ these files accessible from a download URL.
Internationalization
""""""""""""""""""""
+.. versionadded:: 3.9
+
Some variables and command arguments support internationalization via
CMake script. This is an optional feature.
diff --git a/Help/cpack_gen/nsis.rst b/Help/cpack_gen/nsis.rst
index 0dd876eec..eaef8ae73 100644
--- a/Help/cpack_gen/nsis.rst
+++ b/Help/cpack_gen/nsis.rst
@@ -3,7 +3,8 @@ CPack NSIS Generator
CPack Nullsoft Scriptable Install System (NSIS) generator specific options.
-The NSIS generator requires NSIS 3.0 or newer.
+.. versionchanged:: 3.17
+ The NSIS generator requires NSIS 3.0 or newer.
Variables specific to CPack NSIS generator
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -33,10 +34,14 @@ on Windows Nullsoft Scriptable Install System.
.. variable:: CPACK_NSIS_MUI_WELCOMEFINISHPAGE_BITMAP
+ .. versionadded:: 3.5
+
The filename of a bitmap to use as the NSIS ``MUI_WELCOMEFINISHPAGE_BITMAP``.
.. variable:: CPACK_NSIS_MUI_UNWELCOMEFINISHPAGE_BITMAP
+ .. versionadded:: 3.5
+
The filename of a bitmap to use as the NSIS ``MUI_UNWELCOMEFINISHPAGE_BITMAP``.
.. variable:: CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS
@@ -99,6 +104,8 @@ on Windows Nullsoft Scriptable Install System.
.. variable:: CPACK_NSIS_<compName>_INSTALL_DIRECTORY
+ .. versionadded:: 3.7
+
Custom install directory for the specified component ``<compName>`` instead
of ``$INSTDIR``.
@@ -133,29 +140,56 @@ on Windows Nullsoft Scriptable Install System.
.. variable:: CPACK_NSIS_UNINSTALL_NAME
+ .. versionadded:: 3.17
+
Specify the name of the program to uninstall the version.
Default is ``Uninstall``.
.. variable:: CPACK_NSIS_WELCOME_TITLE
+ .. versionadded:: 3.17
+
The title to display on the top of the page for the welcome page.
.. variable:: CPACK_NSIS_WELCOME_TITLE_3LINES
+ .. versionadded:: 3.17
+
Display the title in the welcome page on 3 lines instead of 2.
.. variable:: CPACK_NSIS_FINISH_TITLE
+ .. versionadded:: 3.17
+
The title to display on the top of the page for the finish page.
.. variable:: CPACK_NSIS_FINISH_TITLE_3LINES
+ .. versionadded:: 3.17
+
Display the title in the finish page on 3 lines instead of 2.
.. variable:: CPACK_NSIS_MUI_HEADERIMAGE
+ .. versionadded:: 3.17
+
The image to display on the header of installers pages.
.. variable:: CPACK_NSIS_MANIFEST_DPI_AWARE
+ .. versionadded:: 3.18
+
If set, declares that the installer is DPI-aware.
+
+.. variable:: CPACK_NSIS_BRANDING_TEXT
+
+ .. versionadded:: 3.20
+
+ If set, updates the text at the bottom of the install window.
+ To set the string to blank, use a space (" ").
+
+.. variable:: CPACK_NSIS_BRANDING_TEXT_TRIM_POSITION
+
+ .. versionadded:: 3.20
+
+ If set, trim down the size of the control to the size of the branding text string.
diff --git a/Help/cpack_gen/nuget.rst b/Help/cpack_gen/nuget.rst
index f8aa6266b..c980dd64c 100644
--- a/Help/cpack_gen/nuget.rst
+++ b/Help/cpack_gen/nuget.rst
@@ -1,9 +1,11 @@
CPack NuGet Generator
---------------------
+.. versionadded:: 3.12
+
When build a NuGet package there is no direct way to control an output
filename due a lack of the corresponding CLI option of NuGet, so there
-is no ``CPACK_NUGET_PACKAGE_FILENAME`` variable. To form the output filename
+is no ``CPACK_NUGET_PACKAGE_FILE_NAME`` variable. To form the output filename
NuGet uses the package name and the version according to its built-in rules.
Also, be aware that including a top level directory
@@ -35,7 +37,8 @@ List of CPack NuGet generator specific variables:
.. variable:: CPACK_NUGET_PACKAGE_NAME
CPACK_NUGET_<compName>_PACKAGE_NAME
- The NUGET package name.
+ The NUGET package name. ``CPACK_NUGET_PACKAGE_NAME`` is used as the
+ package ``id`` on nuget.org_
* Mandatory : YES
* Default : :variable:`CPACK_PACKAGE_NAME`
@@ -95,7 +98,7 @@ List of CPack NuGet generator specific variables:
.. variable:: CPACK_NUGET_PACKAGE_HOMEPAGE_URL
CPACK_NUGET_<compName>_PACKAGE_HOMEPAGE_URL
- A URL for the package's home page, often shown in UI displays as well
+ An URL for the package's home page, often shown in UI displays as well
as nuget.org_.
* Mandatory : NO
@@ -104,8 +107,45 @@ List of CPack NuGet generator specific variables:
.. variable:: CPACK_NUGET_PACKAGE_LICENSEURL
CPACK_NUGET_<compName>_PACKAGE_LICENSEURL
- A URL for the package's license, often shown in UI displays as well
- as nuget.org_.
+ .. deprecated:: 3.20
+ Use a local license file
+ (:variable:`CPACK_NUGET_PACKAGE_LICENSE_FILE_NAME`)
+ or a `(SPDX) license identifier`_
+ (:variable:`CPACK_NUGET_PACKAGE_LICENSE_EXPRESSION`) instead.
+
+ An URL for the package's license, often shown in UI displays as well
+ as on nuget.org_.
+
+ * Mandatory : NO
+ * Default : -
+
+.. variable:: CPACK_NUGET_PACKAGE_LICENSE_EXPRESSION
+ CPACK_NUGET_<compName>_PACKAGE_LICENSE_EXPRESSION
+
+ .. versionadded:: 3.20
+
+ A Software Package Data Exchange `(SPDX) license identifier`_ such as
+ ``MIT``, ``BSD-3-Clause``, or ``LGPL-3.0-or-later``. In the case of a
+ choice of licenses or more complex restrictions, compound license
+ expressions may be formed using boolean operators, for example
+ ``MIT OR BSD-3-Clause``. See the `SPDX specification`_ for guidance
+ on forming complex license expressions.
+
+ If ``CPACK_NUGET_PACKAGE_LICENSE_FILE_NAME`` is specified,
+ ``CPACK_NUGET_PACKAGE_LICENSE_EXPRESSION`` is ignored.
+
+ * Mandatory : NO
+ * Default : -
+
+.. variable:: CPACK_NUGET_PACKAGE_LICENSE_FILE_NAME
+ CPACK_NUGET_<compName>_PACKAGE_LICENSE_FILE_NAME
+
+ The package's license file in :file:`.txt` or :file:`.md` format.
+
+ If ``CPACK_NUGET_PACKAGE_LICENSE_FILE_NAME`` is specified,
+ ``CPACK_NUGET_PACKAGE_LICENSE_EXPRESSION`` is ignored.
+
+ .. versionadded:: 3.20
* Mandatory : NO
* Default : -
@@ -113,7 +153,21 @@ List of CPack NuGet generator specific variables:
.. variable:: CPACK_NUGET_PACKAGE_ICONURL
CPACK_NUGET_<compName>_PACKAGE_ICONURL
- A URL for a 64x64 image with transparency background to use as the
+ .. deprecated:: 3.20
+ Use a local icon file (:variable:`CPACK_NUGET_PACKAGE_ICON`) instead.
+
+ An URL for a 64x64 image with transparency background to use as the
+ icon for the package in UI display.
+
+ * Mandatory : NO
+ * Default : -
+
+.. variable:: CPACK_NUGET_PACKAGE_ICON
+ CPACK_NUGET_<compName>_PACKAGE_ICON
+
+ .. versionadded:: 3.20
+
+ The filename of a 64x64 image with transparency background to use as the
icon for the package in UI display.
* Mandatory : NO
@@ -146,6 +200,16 @@ List of CPack NuGet generator specific variables:
* Mandatory : NO
* Default : -
+.. variable:: CPACK_NUGET_PACKAGE_LANGUAGE
+ CPACK_NUGET_<compName>_PACKAGE_LANGUAGE
+
+ .. versionadded:: 3.20
+
+ Locale specifier for the package, for example ``en_CA``.
+
+ * Mandatory : NO
+ * Default : -
+
.. variable:: CPACK_NUGET_PACKAGE_TAGS
CPACK_NUGET_<compName>_PACKAGE_TAGS
@@ -185,5 +249,7 @@ List of CPack NuGet generator specific variables:
.. _nuget.org: http://nuget.org
.. _version specification: https://docs.microsoft.com/en-us/nuget/reference/package-versioning#version-ranges-and-wildcards
+.. _(SPDX) license identifier: https://spdx.org/licenses/
+.. _SPDX specification: https://spdx.github.io/spdx-spec/appendix-IV-SPDX-license-expressions/
.. NuGet spec docs https://docs.microsoft.com/en-us/nuget/reference/nuspec
diff --git a/Help/cpack_gen/packagemaker.rst b/Help/cpack_gen/packagemaker.rst
index 357eb7316..256446dd4 100644
--- a/Help/cpack_gen/packagemaker.rst
+++ b/Help/cpack_gen/packagemaker.rst
@@ -27,6 +27,14 @@ macOS using PackageMaker:
don't mind missing extra features available in the installer shipping with
later versions of macOS.
+Background Image
+""""""""""""""""
+
+.. versionadded:: 3.17
+
+This group of variables controls the background image of the generated
+installer.
+
.. variable:: CPACK_PACKAGEMAKER_BACKGROUND
Adds a background to Distribution XML if specified. The value contains the
diff --git a/Help/cpack_gen/productbuild.rst b/Help/cpack_gen/productbuild.rst
index fd99e5a27..cf3041f30 100644
--- a/Help/cpack_gen/productbuild.rst
+++ b/Help/cpack_gen/productbuild.rst
@@ -1,6 +1,8 @@
CPack productbuild Generator
----------------------------
+.. versionadded:: 3.7
+
productbuild CPack generator (macOS).
Variables specific to CPack productbuild generator
@@ -18,11 +20,15 @@ macOS using ProductBuild:
.. variable:: CPACK_PRODUCTBUILD_IDENTITY_NAME
+ .. versionadded:: 3.8
+
Adds a digital signature to the resulting package.
.. variable:: CPACK_PRODUCTBUILD_KEYCHAIN_PATH
+ .. versionadded:: 3.8
+
Specify a specific keychain to search for the signing identity.
@@ -35,11 +41,15 @@ macOS using ProductBuild:
.. variable:: CPACK_PKGBUILD_IDENTITY_NAME
+ .. versionadded:: 3.8
+
Adds a digital signature to the resulting package.
.. variable:: CPACK_PKGBUILD_KEYCHAIN_PATH
+ .. versionadded:: 3.8
+
Specify a specific keychain to search for the signing identity.
@@ -60,12 +70,22 @@ macOS using ProductBuild:
.. variable:: CPACK_PRODUCTBUILD_RESOURCES_DIR
+ .. versionadded:: 3.9
+
If specified the productbuild generator copies files from this directory
(including subdirectories) to the ``Resources`` directory. This is done
before the :variable:`CPACK_RESOURCE_FILE_WELCOME`,
:variable:`CPACK_RESOURCE_FILE_README`, and
:variable:`CPACK_RESOURCE_FILE_LICENSE` files are copied.
+Background Image
+""""""""""""""""
+
+.. versionadded:: 3.17
+
+This group of variables controls the background image of the generated
+installer.
+
.. variable:: CPACK_PRODUCTBUILD_BACKGROUND
Adds a background to Distribution XML if specified. The value contains the
diff --git a/Help/cpack_gen/rpm.rst b/Help/cpack_gen/rpm.rst
index ccb7ebd7b..5260a1d7c 100644
--- a/Help/cpack_gen/rpm.rst
+++ b/Help/cpack_gen/rpm.rst
@@ -20,7 +20,7 @@ a component GROUP name. Usually those variables correspond to RPM spec file
entities. One may find information about spec files here
http://www.rpm.org/wiki/Docs
-.. note::
+.. versionchanged:: 3.6
`<COMPONENT>` part of variables is preferred to be in upper case (e.g. if
component is named ``foo`` then use ``CPACK_RPM_FOO_XXXX`` variable name format)
@@ -59,6 +59,9 @@ List of CPack RPM generator specific variables:
* Mandatory : YES
* Default : :variable:`CPACK_PACKAGE_DESCRIPTION_SUMMARY`
+ .. versionadded:: 3.2
+ Per-component ``CPACK_RPM_<component>_PACKAGE_SUMMARY`` variables.
+
.. variable:: CPACK_RPM_PACKAGE_NAME
CPACK_RPM_<component>_PACKAGE_NAME
@@ -67,9 +70,14 @@ List of CPack RPM generator specific variables:
* Mandatory : YES
* Default : :variable:`CPACK_PACKAGE_NAME`
+ .. versionadded:: 3.5
+ Per-component ``CPACK_RPM_<component>_PACKAGE_NAME`` variables.
+
.. variable:: CPACK_RPM_FILE_NAME
CPACK_RPM_<component>_FILE_NAME
+ .. versionadded:: 3.6
+
Package file name.
* Mandatory : YES
@@ -93,6 +101,8 @@ List of CPack RPM generator specific variables:
.. variable:: CPACK_RPM_MAIN_COMPONENT
+ .. versionadded:: 3.8
+
Main component that is packaged without component suffix.
* Mandatory : NO
@@ -104,6 +114,8 @@ List of CPack RPM generator specific variables:
.. variable:: CPACK_RPM_PACKAGE_EPOCH
+ .. versionadded:: 3.10
+
The RPM package epoch
* Mandatory : No
@@ -129,6 +141,9 @@ List of CPack RPM generator specific variables:
This may be set to ``noarch`` if you know you are building a ``noarch`` package.
+ .. versionadded:: 3.3
+ Per-component ``CPACK_RPM_<component>_PACKAGE_ARCHITECTURE`` variables.
+
.. variable:: CPACK_RPM_PACKAGE_RELEASE
The RPM package release.
@@ -150,6 +165,8 @@ List of CPack RPM generator specific variables:
.. variable:: CPACK_RPM_PACKAGE_RELEASE_DIST
+ .. versionadded:: 3.6
+
The dist tag that is added RPM ``Release:`` field.
* Mandatory : NO
@@ -174,6 +191,9 @@ List of CPack RPM generator specific variables:
* Mandatory : YES
* Default : "unknown"
+ .. versionadded:: 3.5
+ Per-component ``CPACK_RPM_<component>_PACKAGE_GROUP`` variables.
+
.. variable:: CPACK_RPM_PACKAGE_VENDOR
The RPM package vendor.
@@ -189,6 +209,9 @@ List of CPack RPM generator specific variables:
* Mandatory : NO
* Default : :variable:`CMAKE_PROJECT_HOMEPAGE_URL`
+ .. versionadded:: 3.12
+ The ``CMAKE_PROJECT_HOMEPAGE_URL`` variable.
+
.. variable:: CPACK_RPM_PACKAGE_DESCRIPTION
CPACK_RPM_<component>_PACKAGE_DESCRIPTION
@@ -199,6 +222,9 @@ List of CPack RPM generator specific variables:
based installers only) if set, :variable:`CPACK_PACKAGE_DESCRIPTION_FILE`
if set or "no package description available"
+ .. versionadded:: 3.2
+ Per-component ``CPACK_RPM_<component>_PACKAGE_DESCRIPTION`` variables.
+
.. variable:: CPACK_RPM_COMPRESSION_TYPE
RPM compression type.
@@ -302,6 +328,8 @@ List of CPack RPM generator specific variables:
.. variable:: CPACK_RPM_PACKAGE_REQUIRES_PRE
CPACK_RPM_<component>_PACKAGE_REQUIRES_PRE
+ .. versionadded:: 3.2
+
RPM spec requires(pre) field.
* Mandatory : NO
@@ -315,6 +343,8 @@ List of CPack RPM generator specific variables:
.. variable:: CPACK_RPM_PACKAGE_REQUIRES_POST
CPACK_RPM_<component>_PACKAGE_REQUIRES_POST
+ .. versionadded:: 3.2
+
RPM spec requires(post) field.
* Mandatory : NO
@@ -328,6 +358,8 @@ List of CPack RPM generator specific variables:
.. variable:: CPACK_RPM_PACKAGE_REQUIRES_POSTUN
CPACK_RPM_<component>_PACKAGE_REQUIRES_POSTUN
+ .. versionadded:: 3.2
+
RPM spec requires(postun) field.
* Mandatory : NO
@@ -342,6 +374,8 @@ List of CPack RPM generator specific variables:
.. variable:: CPACK_RPM_PACKAGE_REQUIRES_PREUN
CPACK_RPM_<component>_PACKAGE_REQUIRES_PREUN
+ .. versionadded:: 3.2
+
RPM spec requires(preun) field.
* Mandatory : NO
@@ -492,6 +526,9 @@ List of CPack RPM generator specific variables:
rpm -qp --scripts package.rpm
+ .. versionadded:: 3.18
+ The ``CPACK_RPM_PRE_TRANS_SCRIPT_FILE`` variable.
+
.. variable:: CPACK_RPM_POST_INSTALL_SCRIPT_FILE
CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE
CPACK_RPM_POST_TRANS_SCRIPT_FILE
@@ -513,6 +550,9 @@ List of CPack RPM generator specific variables:
rpm -qp --scripts package.rpm
+ .. versionadded:: 3.18
+ The ``CPACK_RPM_POST_TRANS_SCRIPT_FILE`` variable.
+
.. variable:: CPACK_RPM_USER_FILELIST
CPACK_RPM_<COMPONENT>_USER_FILELIST
@@ -521,13 +561,16 @@ List of CPack RPM generator specific variables:
May be used to explicitly specify ``%(<directive>)`` file line
in the spec file. Like ``%config(noreplace)`` or any other directive
- that be found in the ``%files`` section. You can have multiple directives
- per line, as in ``%attr(600,root,root) %config(noreplace)``. Since
+ that be found in the ``%files`` section. Since
the CPack RPM generator is generating the list of files (and directories) the
user specified files of the ``CPACK_RPM_<COMPONENT>_USER_FILELIST`` list will
be removed from the generated list. If referring to directories do
not add a trailing slash.
+ .. versionadded:: 3.8
+ You can have multiple directives per line, as in
+ ``%attr(600,root,root) %config(noreplace)``.
+
.. variable:: CPACK_RPM_CHANGELOG_FILE
RPM changelog file.
@@ -555,6 +598,9 @@ List of CPack RPM generator specific variables:
the default path. If you want to add some path to the default list then you
can use :variable:`CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION` variable.
+ .. versionadded:: 3.10
+ Added ``/usr/share/aclocal`` to the default list of excludes.
+
.. variable:: CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION
additional list of path to be excluded.
@@ -568,6 +614,8 @@ List of CPack RPM generator specific variables:
.. variable:: CPACK_RPM_RELOCATION_PATHS
+ .. versionadded:: 3.2
+
Packages relocation paths list.
* Mandatory : NO
@@ -591,6 +639,8 @@ List of CPack RPM generator specific variables:
.. variable:: CPACK_RPM_<COMPONENT>_PACKAGE_PREFIX
+ .. versionadded:: 3.2
+
Per component relocation path install prefix.
* Mandatory : NO
@@ -602,6 +652,8 @@ List of CPack RPM generator specific variables:
.. variable:: CPACK_RPM_NO_INSTALL_PREFIX_RELOCATION
CPACK_RPM_NO_<COMPONENT>_INSTALL_PREFIX_RELOCATION
+ .. versionadded:: 3.3
+
Removal of default install prefix from relocation paths list.
* Mandatory : NO
@@ -613,6 +665,8 @@ List of CPack RPM generator specific variables:
.. variable:: CPACK_RPM_ADDITIONAL_MAN_DIRS
+ .. versionadded:: 3.3
+
* Mandatory : NO
* Default : -
@@ -641,6 +695,8 @@ List of CPack RPM generator specific variables:
.. variable:: CPACK_RPM_DEFAULT_USER
CPACK_RPM_<compName>_DEFAULT_USER
+ .. versionadded:: 3.6
+
default user ownership of RPM content
* Mandatory : NO
@@ -652,6 +708,8 @@ List of CPack RPM generator specific variables:
.. variable:: CPACK_RPM_DEFAULT_GROUP
CPACK_RPM_<compName>_DEFAULT_GROUP
+ .. versionadded:: 3.6
+
default group ownership of RPM content
* Mandatory : NO
@@ -663,6 +721,8 @@ List of CPack RPM generator specific variables:
.. variable:: CPACK_RPM_DEFAULT_FILE_PERMISSIONS
CPACK_RPM_<compName>_DEFAULT_FILE_PERMISSIONS
+ .. versionadded:: 3.6
+
default permissions used for packaged files
* Mandatory : NO
@@ -686,6 +746,8 @@ List of CPack RPM generator specific variables:
.. variable:: CPACK_RPM_DEFAULT_DIR_PERMISSIONS
CPACK_RPM_<compName>_DEFAULT_DIR_PERMISSIONS
+ .. versionadded:: 3.6
+
default permissions used for packaged directories
* Mandatory : NO
@@ -697,6 +759,8 @@ List of CPack RPM generator specific variables:
.. variable:: CPACK_RPM_INSTALL_WITH_EXEC
+ .. versionadded:: 3.11
+
force execute permissions on programs and shared libraries
* Mandatory : NO
@@ -714,6 +778,8 @@ List of CPack RPM generator specific variables:
Packaging of Symbolic Links
^^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. versionadded:: 3.3
+
The CPack RPM generator supports packaging of symbolic links::
execute_process(COMMAND ${CMAKE_COMMAND}
@@ -731,8 +797,10 @@ those locations will be treated as if they were a part of the package
while determining if symlink should be either created or present in a
post install script - depending on relocation paths.
-Symbolic links that point to locations outside packaging path produce a
-warning and are treated as non relocatable permanent symbolic links.
+.. versionchanged:: 3.6
+ Symbolic links that point to locations outside packaging path produce a
+ warning and are treated as non relocatable permanent symbolic links.
+ Previous versions of CMake produced an error in this case.
Currently there are a few limitations though:
@@ -750,6 +818,8 @@ Currently there are a few limitations though:
Packaging of debug information
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. versionadded:: 3.7
+
Debuginfo packages contain debug symbols and sources for debugging packaged
binaries.
@@ -832,6 +902,8 @@ Debuginfo RPM packaging has its own set of variables:
.. variable:: CPACK_RPM_DEBUGINFO_SINGLE_PACKAGE
+ .. versionadded:: 3.8
+
Create a single debuginfo package even if components packaging is set.
* Mandatory : NO
@@ -853,6 +925,8 @@ Debuginfo RPM packaging has its own set of variables:
.. variable:: CPACK_RPM_DEBUGINFO_FILE_NAME
CPACK_RPM_<component>_DEBUGINFO_FILE_NAME
+ .. versionadded:: 3.9
+
Debuginfo package file name.
* Mandatory : NO
@@ -877,6 +951,8 @@ Debuginfo RPM packaging has its own set of variables:
Packaging of sources (SRPM)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. versionadded:: 3.7
+
SRPM packaging is enabled by setting :variable:`CPACK_RPM_PACKAGE_SOURCES`
variable while usually using :variable:`CPACK_INSTALLED_DIRECTORIES` variable
to provide directory containing CMakeLists.txt and source files.
diff --git a/Help/cpack_gen/wix.rst b/Help/cpack_gen/wix.rst
index 5b880bac5..79f835e71 100644
--- a/Help/cpack_gen/wix.rst
+++ b/Help/cpack_gen/wix.rst
@@ -3,6 +3,9 @@ CPack WIX Generator
CPack WIX generator specific options
+.. versionadded:: 3.7
+ Support :variable:`CPACK_COMPONENT_<compName>_DISABLED` variable.
+
Variables specific to CPack WIX generator
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -95,9 +98,10 @@ Windows using WiX.
If this variable is not set, it will be initialized with CPACK_PACKAGE_NAME
- If this variable is set to ``.``, then application shortcuts will be
- created directly in the start menu and the uninstaller shortcut will be
- omitted.
+ .. versionadded:: 3.16
+ If this variable is set to ``.``, then application shortcuts will be
+ created directly in the start menu and the uninstaller shortcut will be
+ omitted.
.. variable:: CPACK_WIX_CULTURES
@@ -123,7 +127,10 @@ Windows using WiX.
.. variable:: CPACK_WIX_PATCH_FILE
Optional list of XML files with fragments to be inserted into
- generated WiX sources
+ generated WiX sources.
+
+ .. versionadded:: 3.5
+ Support listing multiple patch files.
This optional variable can be used to specify an XML file that the
WIX generator will use to inject fragments into its generated
@@ -152,10 +159,17 @@ Windows using WiX.
Currently fragments can be injected into most
Component, File, Directory and Feature elements.
- The following additional special Ids can be used:
+ .. versionadded:: 3.3
+ The following additional special Ids can be used:
+
+ * ``#PRODUCT`` for the ``<Product>`` element.
+ * ``#PRODUCTFEATURE`` for the root ``<Feature>`` element.
- * ``#PRODUCT`` for the ``<Product>`` element.
- * ``#PRODUCTFEATURE`` for the root ``<Feature>`` element.
+ .. versionadded:: 3.7
+ Support patching arbitrary ``<Feature>`` elements.
+
+ .. versionadded:: 3.9
+ Allow setting additional attributes.
The following example illustrates how this works.
@@ -227,6 +241,8 @@ Windows using WiX.
.. variable:: CPACK_WIX_PROPERTY_<PROPERTY>
+ .. versionadded:: 3.1
+
This variable can be used to provide a value for
the Windows Installer property ``<PROPERTY>``
@@ -243,16 +259,22 @@ Windows using WiX.
.. variable:: CPACK_WIX_ROOT_FEATURE_TITLE
+ .. versionadded:: 3.7
+
Sets the name of the root install feature in the WIX installer. Same as
CPACK_COMPONENT_<compName>_DISPLAY_NAME for components.
.. variable:: CPACK_WIX_ROOT_FEATURE_DESCRIPTION
+ .. versionadded:: 3.7
+
Sets the description of the root install feature in the WIX installer. Same as
CPACK_COMPONENT_<compName>_DESCRIPTION for components.
.. variable:: CPACK_WIX_SKIP_PROGRAM_FOLDER
+ .. versionadded:: 3.7
+
If this variable is set to true, the default install location
of the generated package will be CPACK_PACKAGE_INSTALL_DIRECTORY directly.
The install location will not be located relatively below
@@ -270,6 +292,8 @@ Windows using WiX.
.. variable:: CPACK_WIX_ROOT_FOLDER_ID
+ .. versionadded:: 3.9
+
This variable allows specification of a custom root folder ID.
The generator specific ``<64>`` token can be used for
folder IDs that come in 32-bit and 64-bit variants.
@@ -289,6 +313,8 @@ Windows using WiX.
.. variable:: CPACK_WIX_CUSTOM_XMLNS
+ .. versionadded:: 3.19
+
This variable provides a list of custom namespace declarations that are necessary
for using WiX extensions. Each declaration should be in the form name=url, where
name is the plain namespace without the usual xmlns: prefix and url is an unquoted
diff --git a/Help/dev/README.rst b/Help/dev/README.rst
index 84da4f1d3..9c3878b0c 100644
--- a/Help/dev/README.rst
+++ b/Help/dev/README.rst
@@ -37,9 +37,11 @@ CMake developer documentation is provided by the following documents:
* The `CMake Source Code Guide`_.
* The `CMake Documentation Guide`_.
+* The `CMake Experimental Features Guide`_.
.. _`CMake Source Code Guide`: source.rst
.. _`CMake Documentation Guide`: documentation.rst
+.. _`CMake Experimental Features Guide`: experimental.rst
Maintainer Documentation
========================
diff --git a/Help/dev/documentation.rst b/Help/dev/documentation.rst
index c302790aa..29fc88033 100644
--- a/Help/dev/documentation.rst
+++ b/Help/dev/documentation.rst
@@ -123,10 +123,23 @@ documentation:
``command``
A CMake language command.
+``cpack_gen``
+ A CPack package generator.
+ See the `cpack(1)`_ command-line tool's ``-G`` option.
+
+``envvar``
+ An environment variable.
+ See the `cmake-env-variables(7)`_ manual
+ and the `set()`_ command.
+
``generator``
A CMake native build system generator.
See the `cmake(1)`_ command-line tool's ``-G`` option.
+``genex``
+ A CMake generator expression.
+ See the `cmake-generator-expressions(7)`_ manual.
+
``manual``
A CMake manual page, like the `cmake(1)`_ manual.
@@ -160,10 +173,12 @@ which is expected to be of the form::
-------------
and to appear at or near the top of the ``.rst`` file before any other
-lines starting in a letter, digit, or ``<``. If no such title appears
+lines starting in a letter, digit, ``<``, or ``$``. If no such title appears
literally in the ``.rst`` file, the object name is the ``<file-name>``.
If a title does appear, it is expected that ``<file-name>`` is equal
-to ``<object-name>`` with any ``<`` and ``>`` characters removed.
+to ``<object-name>`` with any ``<`` and ``>`` characters removed,
+or in the case of a ``$<genex-name>`` or ``$<genex-name:...>``, the
+``genex-name``.
Second, the CMake Domain provides directives to define objects inside
other documents:
@@ -174,6 +189,14 @@ other documents:
This indented block documents <command-name>.
+ .. envvar:: <envvar-name>
+
+ This indented block documents <envvar-name>.
+
+ .. genex:: <genex-name>
+
+ This indented block documents <genex-name>.
+
.. variable:: <variable-name>
This indented block documents <variable-name>.
@@ -183,11 +206,14 @@ the first approach above.
.. _`Sphinx Domain`: http://sphinx-doc.org/domains.html
.. _`cmake(1)`: https://cmake.org/cmake/help/latest/manual/cmake.1.html
+.. _`cmake-env-variables(7)`: https://cmake.org/cmake/help/latest/manual/cmake-env-variables.7.html
+.. _`cmake-generator-expressions(7)`: https://cmake.org/cmake/help/latest/manual/cmake-generator-expressions.7.html
.. _`cmake-modules(7)`: https://cmake.org/cmake/help/latest/manual/cmake-modules.7.html
.. _`cmake-policies(7)`: https://cmake.org/cmake/help/latest/manual/cmake-policies.7.html
.. _`cmake-properties(7)`: https://cmake.org/cmake/help/latest/manual/cmake-properties.7.html
.. _`cmake-variables(7)`: https://cmake.org/cmake/help/latest/manual/cmake-variables.7.html
.. _`cmake_policy()`: https://cmake.org/cmake/help/latest/command/cmake_policy.html
+.. _`cpack(1)`: https://cmake.org/cmake/help/latest/manual/cpack.1.html
.. _`include()`: https://cmake.org/cmake/help/latest/command/include.html
.. _`set()`: https://cmake.org/cmake/help/latest/command/set.html
.. _`set_property()`: https://cmake.org/cmake/help/latest/command/set_property.html
diff --git a/Help/dev/experimental.rst b/Help/dev/experimental.rst
new file mode 100644
index 000000000..d0191615a
--- /dev/null
+++ b/Help/dev/experimental.rst
@@ -0,0 +1,70 @@
+CMake Experimental Features Guide
+*********************************
+
+The following is a guide to CMake experimental features that are
+under development and not yet included in official documentation.
+See documentation on `CMake Development`_ for more information.
+
+.. _`CMake Development`: README.rst
+
+C++20 Module Dependencies
+=========================
+
+The Ninja generator has experimental infrastructure supporting C++20 module
+dependency scanning. This is similar to the Fortran modules support, but
+relies on external tools to scan C++20 translation units for module
+dependencies. The approach is described by Kitware's `D1483r1`_ paper.
+
+The ``CMAKE_EXPERIMENTAL_CXX_MODULE_DYNDEP`` variable can be set to ``1``
+in order to activate this undocumented experimental infrastructure. This
+is **intended to make the functionality available to compiler writers** so
+they can use it to develop and test their dependency scanning tool.
+The ``CMAKE_EXPERIMENTAL_CXX_SCANDEP_SOURCE`` variable must also be set
+to tell CMake how to invoke the C++20 module dependency scanning tool.
+
+For example, add code like the following to a test project:
+
+.. code-block:: cmake
+
+ set(CMAKE_EXPERIMENTAL_CXX_MODULE_DYNDEP 1)
+ string(CONCAT CMAKE_EXPERIMENTAL_CXX_SCANDEP_SOURCE
+ "<CMAKE_CXX_COMPILER> <DEFINES> <INCLUDES> <FLAGS> <SOURCE>"
+ " -MT <DYNDEP_FILE> -MD -MF <DEP_FILE>"
+ " ${flags_to_scan_deps} -fdep-file=<DYNDEP_FILE> -fdep-output=<OBJECT>"
+ )
+
+The tool specified by ``CMAKE_EXPERIMENTAL_CXX_SCANDEP_SOURCE`` is
+expected to process the translation unit, write preprocessor dependencies
+to the file specified by the ``<DEP_FILE>`` placeholder, and write module
+dependencies to the file specified by the ``<DYNDEP_FILE>`` placeholder.
+
+The module dependencies should be written in the format described
+by the `P1689r3`_ paper.
+
+Compiler writers may try out their scanning functionality using
+the `cxx-modules-sandbox`_ test project, modified to set variables
+as above for their compiler.
+
+For compilers that generate module maps, tell CMake as follows:
+
+.. code-block:: cmake
+
+ set(CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FORMAT "gcc")
+ set(CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FLAG
+ "${compiler_flags_for_module_map} -fmodule-mapper=<MODULE_MAP_FILE>")
+
+Currently, the only supported format is ``gcc``. The format is described in
+the GCC documentation, but the relevant section for the purposes of CMake is:
+
+ A mapping file consisting of space-separated module-name, filename
+ pairs, one per line. Only the mappings for the direct imports and any
+ module export name need be provided. If other mappings are provided,
+ they override those stored in any imported CMI files. A repository
+ root may be specified in the mapping file by using ``$root`` as the
+ module name in the first active line.
+
+ -- GCC module mapper documentation
+
+.. _`D1483r1`: https://mathstuf.fedorapeople.org/fortran-modules/fortran-modules.html
+.. _`P1689r3`: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1689r3.html
+.. _`cxx-modules-sandbox`: https://github.com/mathstuf/cxx-modules-sandbox
diff --git a/Help/dev/maint.rst b/Help/dev/maint.rst
index 75d685c61..664b7a409 100644
--- a/Help/dev/maint.rst
+++ b/Help/dev/maint.rst
@@ -357,3 +357,13 @@ policies added for that version. Commit with a message such as::
The files generatd by `install(EXPORT)` and `export()` commands
are known to work with policies as of CMake $prev, so enable them
in sufficiently new CMake versions.
+
+Update the ``cmake_minimum_required`` version range in CMake itself:
+
+* ``CMakeLists.txt``
+* ``Utilities/Doxygen/CMakeLists.txt``
+* ``Utilities/Sphinx/CMakeLists.txt``
+
+to end in the previous release. Commit with a message such as::
+
+ Configure CMake itself with policies through CMake $prev
diff --git a/Help/envvar/CUDAARCHS.rst b/Help/envvar/CUDAARCHS.rst
new file mode 100644
index 000000000..82369cd3b
--- /dev/null
+++ b/Help/envvar/CUDAARCHS.rst
@@ -0,0 +1,13 @@
+CUDAARCHS
+---------
+
+.. versionadded:: 3.20
+
+.. include:: ENV_VAR.txt
+
+Value used to initialize :variable:`CMAKE_CUDA_ARCHITECTURES` on the first
+configuration if it's not already defined. Subsequent runs will use the value
+stored in the cache.
+
+This is a semicolon-separated list of architectures as described in
+:prop_tgt:`CUDA_ARCHITECTURES`.
diff --git a/Help/envvar/CUDAHOSTCXX.rst b/Help/envvar/CUDAHOSTCXX.rst
index 19b15e9fc..963f9d113 100644
--- a/Help/envvar/CUDAHOSTCXX.rst
+++ b/Help/envvar/CUDAHOSTCXX.rst
@@ -13,5 +13,8 @@ configuration run (including the first), the environment variable will be
ignored if the :variable:`CMAKE_CUDA_HOST_COMPILER` variable is defined.
This environment variable is primarily meant for use with projects that
-enable ``CUDA`` as a first-class language. The :module:`FindCUDA`
-module will also use it to initialize its ``CUDA_HOST_COMPILER`` setting.
+enable ``CUDA`` as a first-class language.
+
+.. versionadded:: 3.13
+ The :module:`FindCUDA`
+ module will use this variable to initialize its ``CUDA_HOST_COMPILER`` setting.
diff --git a/Help/generator/CodeBlocks.rst b/Help/generator/CodeBlocks.rst
index d830542eb..85da71543 100644
--- a/Help/generator/CodeBlocks.rst
+++ b/Help/generator/CodeBlocks.rst
@@ -7,13 +7,15 @@ Project files for CodeBlocks will be created in the top directory and
in every subdirectory which features a ``CMakeLists.txt`` file containing
a :command:`project` call. Additionally a hierarchy of makefiles is generated
into the build tree.
-The :variable:`CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES` variable may
-be set to ``ON`` to exclude any files which are located outside of
-the project root directory.
The appropriate make program can build the
project through the default ``all`` target. An ``install`` target is
also provided.
+.. versionadded:: 3.10
+ The :variable:`CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES` variable may
+ be set to ``ON`` to exclude any files which are located outside of
+ the project root directory.
+
This "extra" generator may be specified as:
``CodeBlocks - MinGW Makefiles``
@@ -23,7 +25,8 @@ This "extra" generator may be specified as:
Generate with :generator:`NMake Makefiles`.
``CodeBlocks - NMake Makefiles JOM``
- Generate with :generator:`NMake Makefiles JOM`.
+ .. versionadded:: 3.8
+ Generate with :generator:`NMake Makefiles JOM`.
``CodeBlocks - Ninja``
Generate with :generator:`Ninja`.
diff --git a/Help/generator/CodeLite.rst b/Help/generator/CodeLite.rst
index 46fa5bef7..4f276df71 100644
--- a/Help/generator/CodeLite.rst
+++ b/Help/generator/CodeLite.rst
@@ -6,13 +6,15 @@ Generates CodeLite project files.
Project files for CodeLite will be created in the top directory and
in every subdirectory which features a CMakeLists.txt file containing
a :command:`project` call.
-The :variable:`CMAKE_CODELITE_USE_TARGETS` variable may be set to ``ON``
-to change the default behavior from projects to targets as the basis
-for project files.
The appropriate make program can build the
project through the default ``all`` target. An ``install`` target
is also provided.
+.. versionadded:: 3.7
+ The :variable:`CMAKE_CODELITE_USE_TARGETS` variable may be set to ``ON``
+ to change the default behavior from projects to targets as the basis
+ for project files.
+
This "extra" generator may be specified as:
``CodeLite - MinGW Makefiles``
diff --git a/Help/generator/Green Hills MULTI.rst b/Help/generator/Green Hills MULTI.rst
index 2246699d9..5d2b1cd4d 100644
--- a/Help/generator/Green Hills MULTI.rst
+++ b/Help/generator/Green Hills MULTI.rst
@@ -3,22 +3,36 @@ Green Hills MULTI
.. versionadded:: 3.3
+.. versionadded:: 3.15
+ Linux support.
+
Generates Green Hills MULTI project files (experimental, work-in-progress).
-The buildsystem has predetermined build-configuration settings that can be controlled
-via the :variable:`CMAKE_BUILD_TYPE` variable.
+Customizations are available through the following cache variables:
+
+* ``GHS_CUSTOMIZATION``
+* ``GHS_GPJ_MACROS``
+
+.. versionadded:: 3.14
+ The buildsystem has predetermined build-configuration settings that can be controlled
+ via the :variable:`CMAKE_BUILD_TYPE` variable.
+
+Toolset and Platform Selection
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. versionadded:: 3.13
Customizations that are used to pick toolset and target system:
-The ``-A <arch>`` can be supplied for setting the target architecture.
-``<arch>`` usually is one of ``arm``, ``ppc``, ``86``, etcetera.
-If the target architecture is not specified then
-the default architecture of ``arm`` will be used.
+* The ``-A <arch>`` can be supplied for setting the target architecture.
+ ``<arch>`` usually is one of ``arm``, ``ppc``, ``86``, etcetera.
+ If the target architecture is not specified then
+ the default architecture of ``arm`` will be used.
-The ``-T <toolset>`` option can be used to set the directory location of the toolset.
-Both absolute and relative paths are valid. Relative paths use ``GHS_TOOLSET_ROOT``
-as the root. If the toolset is not specified then the latest toolset found in
-``GHS_TOOLSET_ROOT`` will be used.
+* The ``-T <toolset>`` option can be used to set the directory location of the toolset.
+ Both absolute and relative paths are valid. Relative paths use ``GHS_TOOLSET_ROOT``
+ as the root. If the toolset is not specified then the latest toolset found in
+ ``GHS_TOOLSET_ROOT`` will be used.
Cache variables that are used for toolset and target system customization:
@@ -50,15 +64,18 @@ Cache variables that are used for toolset and target system customization:
a specific RTOS is to be used.
| ``GHS_OS_DIR_OPTION`` default value is ``-os_dir``.
+ .. versionadded:: 3.15
+ The ``GHS_OS_DIR_OPTION`` variable.
+
* ``GHS_BSP_NAME``
| Sets ``-bsp`` entry in project file.
| Defaults to ``sim<arch>`` for ``integrity`` platforms.
-Customizations are available through the following cache variables:
+Target Properties
+^^^^^^^^^^^^^^^^^
-* ``GHS_CUSTOMIZATION``
-* ``GHS_GPJ_MACROS``
+.. versionadded:: 3.14
The following properties are available:
diff --git a/Help/generator/NMake Makefiles JOM.rst b/Help/generator/NMake Makefiles JOM.rst
index 3a8744c1e..e0f4c90b3 100644
--- a/Help/generator/NMake Makefiles JOM.rst
+++ b/Help/generator/NMake Makefiles JOM.rst
@@ -2,3 +2,6 @@ NMake Makefiles JOM
-------------------
Generates JOM makefiles.
+
+.. versionadded:: 3.8
+ :generator:`CodeBlocks` generator can be used as an extra generator.
diff --git a/Help/generator/Ninja Multi-Config.rst b/Help/generator/Ninja Multi-Config.rst
index 112db74f7..89011925f 100644
--- a/Help/generator/Ninja Multi-Config.rst
+++ b/Help/generator/Ninja Multi-Config.rst
@@ -86,3 +86,78 @@ used to generate ``generated.c``, which would be used to build the ``Debug``
configuration of ``generated``. This is useful for running a release-optimized
version of a generator utility while still building the debug version of the
targets built with the generated code.
+
+Custom Commands
+^^^^^^^^^^^^^^^
+
+.. versionadded:: 3.20
+
+The ``Ninja Multi-Config`` generator adds extra capabilities to
+:command:`add_custom_command` and :command:`add_custom_target` through its
+cross-config mode. The ``COMMAND``, ``DEPENDS``, and ``WORKING_DIRECTORY``
+arguments can be evaluated in the context of either the "command config" (the
+"native" configuration of the ``build-<Config>.ninja`` file in use) or the
+"output config" (the configuration used to evaluate the ``OUTPUT`` and
+``BYPRODUCTS``).
+
+If either ``OUTPUT`` or ``BYPRODUCTS`` names a path that is common to
+more than one configuration (e.g. it does not use any generator expressions),
+all arguments are evaluated in the command config by default.
+If all ``OUTPUT`` and ``BYPRODUCTS`` paths are unique to each configuration
+(e.g. by using the ``$<CONFIG>`` generator expression), the first argument of
+``COMMAND`` is still evaluated in the command config by default, while all
+subsequent arguments, as well as the arguments to ``DEPENDS`` and
+``WORKING_DIRECTORY``, are evaluated in the output config. These defaults can
+be overridden with the ``$<OUTPUT_CONFIG:...>`` and ``$<COMMAND_CONFIG:...>``
+generator-expressions. Note that if a target is specified by its name in
+``DEPENDS``, or as the first argument of ``COMMAND``, it is always evaluated
+in the command config, even if it is wrapped in ``$<OUTPUT_CONFIG:...>``
+(because its plain name is not a generator expression).
+
+As an example, consider the following:
+
+.. code-block:: cmake
+
+ add_custom_command(
+ OUTPUT "$<CONFIG>.txt"
+ COMMAND generator "$<CONFIG>.txt" "$<OUTPUT_CONFIG:$<CONFIG>>" "$<COMMAND_CONFIG:$<CONFIG>>"
+ DEPENDS tgt1 "$<TARGET_FILE:tgt2>" "$<OUTPUT_CONFIG:$<TARGET_FILE:tgt3>>" "$<COMMAND_CONFIG:$<TARGET_FILE:tgt4>>"
+ )
+
+Assume that ``generator``, ``tgt1``, ``tgt2``, ``tgt3``, and ``tgt4`` are all
+executable targets, and assume that ``$<CONFIG>.txt`` is built in the ``Debug``
+output config using the ``Release`` command config. The ``Release`` build of
+the ``generator`` target is called with ``Debug.txt Debug Release`` as
+arguments. The command depends on the ``Release`` builds of ``tgt1`` and
+``tgt4``, and the ``Debug`` builds of ``tgt2`` and ``tgt3``.
+
+``PRE_BUILD``, ``PRE_LINK``, and ``POST_BUILD`` custom commands for targets
+only get run in their "native" configuration (the ``Release`` configuration in
+the ``build-Release.ninja`` file) unless they have no ``BYPRODUCTS`` or their
+``BYPRODUCTS`` are unique per config. Consider the following example:
+
+.. code-block:: cmake
+
+ add_executable(exe main.c)
+ add_custom_command(
+ TARGET exe
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E echo "Running no-byproduct command"
+ )
+ add_custom_command(
+ TARGET exe
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E echo "Running separate-byproduct command for $<CONFIG>"
+ BYPRODUCTS $<CONFIG>.txt
+ )
+ add_custom_command(
+ TARGET exe
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E echo "Running common-byproduct command for $<CONFIG>"
+ BYPRODUCTS exe.txt
+ )
+
+In this example, if you build ``exe:Debug`` in ``build-Release.ninja``, the
+first and second custom commands get run, since their byproducts are unique
+per-config, but the last custom command does not. However, if you build
+``exe:Release`` in ``build-Release.ninja``, all three custom commands get run.
diff --git a/Help/generator/Ninja.rst b/Help/generator/Ninja.rst
index 08ee81b52..f3ba2224b 100644
--- a/Help/generator/Ninja.rst
+++ b/Help/generator/Ninja.rst
@@ -11,32 +11,57 @@ For each subdirectory ``sub/dir`` of the project, additional targets
are generated:
``sub/dir/all``
- Depends on all targets required by the subdirectory.
+
+ .. versionadded:: 3.6
+
+ Depends on all targets required by the subdirectory.
``sub/dir/install``
- Runs the install step in the subdirectory, if any.
+
+ .. versionadded:: 3.7
+
+ Runs the install step in the subdirectory, if any.
``sub/dir/install/strip``
- Runs the install step in the subdirectory followed by a ``CMAKE_STRIP`` command,
- if any.
- The ``CMAKE_STRIP`` variable will contain the platform's ``strip`` utility, which
- removes symbols information from generated binaries.
+ .. versionadded:: 3.7
+ Runs the install step in the subdirectory followed by a ``CMAKE_STRIP`` command,
+ if any.
+
+ The ``CMAKE_STRIP`` variable will contain the platform's ``strip`` utility, which
+ removes symbols information from generated binaries.
``sub/dir/test``
- Runs the test step in the subdirectory, if any.
+
+ .. versionadded:: 3.7
+
+ Runs the test step in the subdirectory, if any.
``sub/dir/package``
- Runs the package step in the subdirectory, if any.
+
+ .. versionadded:: 3.7
+
+ Runs the package step in the subdirectory, if any.
Fortran Support
^^^^^^^^^^^^^^^
+.. versionadded:: 3.7
+
The ``Ninja`` generator conditionally supports Fortran when the ``ninja``
tool is at least version 1.10 (which has the required features).
+Swift Support
+^^^^^^^^^^^^^
+
+.. versionadded:: 3.15
+
+The Swift support is experimental, not considered stable, and may change
+in future releases of CMake.
+
See Also
^^^^^^^^
-The :generator:`Ninja Multi-Config` generator is similar to the ``Ninja``
-generator, but generates multiple configurations at once.
+.. versionadded:: 3.17
+ The :generator:`Ninja Multi-Config` generator is similar to the ``Ninja``
+ generator, but generates multiple configurations at once.
diff --git a/Help/generator/VS_TOOLSET_HOST_ARCH.txt b/Help/generator/VS_TOOLSET_HOST_ARCH.txt
index 029363115..e36171999 100644
--- a/Help/generator/VS_TOOLSET_HOST_ARCH.txt
+++ b/Help/generator/VS_TOOLSET_HOST_ARCH.txt
@@ -1,7 +1,11 @@
-For each toolset that comes with this version of Visual Studio, there are
-variants that are themselves compiled for 32-bit (``x86``) and
-64-bit (``x64``) hosts (independent of the architecture they target).
-|VS_TOOLSET_HOST_ARCH_DEFAULT|
-One may explicitly request use of either the 32-bit or 64-bit host tools
-by adding either ``host=x86`` or ``host=x64`` to the toolset specification.
-See the :variable:`CMAKE_GENERATOR_TOOLSET` variable for details.
+.. versionadded:: 3.8
+ For each toolset that comes with this version of Visual Studio, there are
+ variants that are themselves compiled for 32-bit (``x86``) and
+ 64-bit (``x64``) hosts (independent of the architecture they target).
+ |VS_TOOLSET_HOST_ARCH_DEFAULT|
+ One may explicitly request use of either the 32-bit or 64-bit host tools
+ by adding either ``host=x86`` or ``host=x64`` to the toolset specification.
+ See the :variable:`CMAKE_GENERATOR_TOOLSET` variable for details.
+
+.. versionadded:: 3.14
+ Added suport for ``host=x86`` option.
diff --git a/Help/generator/Visual Studio 10 2010.rst b/Help/generator/Visual Studio 10 2010.rst
index 4bf9a8f15..b4376d88b 100644
--- a/Help/generator/Visual Studio 10 2010.rst
+++ b/Help/generator/Visual Studio 10 2010.rst
@@ -17,13 +17,14 @@ Platform Selection
The default target platform name (architecture) is ``Win32``.
-The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set, perhaps
-via the :manual:`cmake(1)` ``-A`` option, to specify a target platform
-name (architecture). For example:
-
-* ``cmake -G "Visual Studio 10 2010" -A Win32``
-* ``cmake -G "Visual Studio 10 2010" -A x64``
-* ``cmake -G "Visual Studio 10 2010" -A Itanium``
+.. versionadded:: 3.1
+ The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set, perhaps
+ via the :manual:`cmake(1)` ``-A`` option, to specify a target platform
+ name (architecture). For example:
+
+ * ``cmake -G "Visual Studio 10 2010" -A Win32``
+ * ``cmake -G "Visual Studio 10 2010" -A x64``
+ * ``cmake -G "Visual Studio 10 2010" -A Itanium``
For compatibility with CMake versions prior to 3.1, one may specify
a target platform name optionally at the end of the generator name.
diff --git a/Help/generator/Visual Studio 11 2012.rst b/Help/generator/Visual Studio 11 2012.rst
index 5d89a6e7c..932548bd2 100644
--- a/Help/generator/Visual Studio 11 2012.rst
+++ b/Help/generator/Visual Studio 11 2012.rst
@@ -17,15 +17,16 @@ Platform Selection
The default target platform name (architecture) is ``Win32``.
-The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set, perhaps
-via the :manual:`cmake(1)` ``-A`` option, to specify a target platform
-name (architecture). For example:
-
-* ``cmake -G "Visual Studio 11 2012" -A Win32``
-* ``cmake -G "Visual Studio 11 2012" -A x64``
-* ``cmake -G "Visual Studio 11 2012" -A ARM``
-* ``cmake -G "Visual Studio 11 2012" -A <WinCE-SDK>``
- (Specify a target platform matching a Windows CE SDK name.)
+.. versionadded:: 3.1
+ The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set, perhaps
+ via the :manual:`cmake(1)` ``-A`` option, to specify a target platform
+ name (architecture). For example:
+
+ * ``cmake -G "Visual Studio 11 2012" -A Win32``
+ * ``cmake -G "Visual Studio 11 2012" -A x64``
+ * ``cmake -G "Visual Studio 11 2012" -A ARM``
+ * ``cmake -G "Visual Studio 11 2012" -A <WinCE-SDK>``
+ (Specify a target platform matching a Windows CE SDK name.)
For compatibility with CMake versions prior to 3.1, one may specify
a target platform name optionally at the end of the generator name.
diff --git a/Help/generator/Visual Studio 12 2013.rst b/Help/generator/Visual Studio 12 2013.rst
index fb8e021bc..b5fa1bf49 100644
--- a/Help/generator/Visual Studio 12 2013.rst
+++ b/Help/generator/Visual Studio 12 2013.rst
@@ -17,13 +17,14 @@ Platform Selection
The default target platform name (architecture) is ``Win32``.
-The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set, perhaps
-via the :manual:`cmake(1)` ``-A`` option, to specify a target platform
-name (architecture). For example:
-
-* ``cmake -G "Visual Studio 12 2013" -A Win32``
-* ``cmake -G "Visual Studio 12 2013" -A x64``
-* ``cmake -G "Visual Studio 12 2013" -A ARM``
+.. versionadded:: 3.1
+ The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set, perhaps
+ via the :manual:`cmake(1)` ``-A`` option, to specify a target platform
+ name (architecture). For example:
+
+ * ``cmake -G "Visual Studio 12 2013" -A Win32``
+ * ``cmake -G "Visual Studio 12 2013" -A x64``
+ * ``cmake -G "Visual Studio 12 2013" -A ARM``
For compatibility with CMake versions prior to 3.1, one may specify
a target platform name optionally at the end of the generator name.
diff --git a/Help/generator/Visual Studio 14 2015.rst b/Help/generator/Visual Studio 14 2015.rst
index 5b319bbff..9c616414f 100644
--- a/Help/generator/Visual Studio 14 2015.rst
+++ b/Help/generator/Visual Studio 14 2015.rst
@@ -51,6 +51,8 @@ via the :manual:`cmake(1)` ``-T`` option, to specify another toolset.
Windows 10 SDK Maximum Version for VS 2015
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. versionadded:: 3.19
+
Microsoft stated in a "Windows 10 October 2018 Update" blog post that Windows
10 SDK versions (15063, 16299, 17134, 17763) are not supported by VS 2015 and
are only supported by VS 2017 and later. Therefore by default CMake
diff --git a/Help/generator/Visual Studio 15 2017.rst b/Help/generator/Visual Studio 15 2017.rst
index e7baaadb6..a002f2ff6 100644
--- a/Help/generator/Visual Studio 15 2017.rst
+++ b/Help/generator/Visual Studio 15 2017.rst
@@ -14,18 +14,20 @@ projects (JavaScript, Powershell, Python, etc.) are not supported.
Instance Selection
^^^^^^^^^^^^^^^^^^
-VS 2017 supports multiple installations on the same machine.
-The :variable:`CMAKE_GENERATOR_INSTANCE` variable may be set as a
-cache entry containing the absolute path to a Visual Studio instance.
-If the value is not specified explicitly by the user or a toolchain file,
-CMake queries the Visual Studio Installer to locate VS instances, chooses
-one, and sets the variable as a cache entry to hold the value persistently.
-
-When CMake first chooses an instance, if the ``VS150COMNTOOLS`` environment
-variable is set and points to the ``Common7/Tools`` directory within
-one of the instances, that instance will be used. Otherwise, if more
-than one instance is installed we do not define which one is chosen
-by default.
+.. versionadded:: 3.9
+ VS 2017 supports multiple installations on the same machine.
+ The :variable:`CMAKE_GENERATOR_INSTANCE` variable may be set as a
+ cache entry containing the absolute path to a Visual Studio instance.
+ If the value is not specified explicitly by the user or a toolchain file,
+ CMake queries the Visual Studio Installer to locate VS instances, chooses
+ one, and sets the variable as a cache entry to hold the value persistently.
+
+.. versionadded:: 3.11
+ When CMake first chooses an instance, if the ``VS150COMNTOOLS`` environment
+ variable is set and points to the ``Common7/Tools`` directory within
+ one of the instances, that instance will be used. Otherwise, if more
+ than one instance is installed we do not define which one is chosen
+ by default.
Platform Selection
^^^^^^^^^^^^^^^^^^
diff --git a/Help/generator/Visual Studio 9 2008.rst b/Help/generator/Visual Studio 9 2008.rst
index a09d047ae..644f9363a 100644
--- a/Help/generator/Visual Studio 9 2008.rst
+++ b/Help/generator/Visual Studio 9 2008.rst
@@ -8,15 +8,16 @@ Platform Selection
The default target platform name (architecture) is ``Win32``.
-The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set, perhaps
-via the :manual:`cmake(1)` ``-A`` option, to specify a target platform
-name (architecture). For example:
-
-* ``cmake -G "Visual Studio 9 2008" -A Win32``
-* ``cmake -G "Visual Studio 9 2008" -A x64``
-* ``cmake -G "Visual Studio 9 2008" -A Itanium``
-* ``cmake -G "Visual Studio 9 2008" -A <WinCE-SDK>``
- (Specify a target platform matching a Windows CE SDK name.)
+.. versionadded:: 3.1
+ The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set, perhaps
+ via the :manual:`cmake(1)` ``-A`` option, to specify a target platform
+ name (architecture). For example:
+
+ * ``cmake -G "Visual Studio 9 2008" -A Win32``
+ * ``cmake -G "Visual Studio 9 2008" -A x64``
+ * ``cmake -G "Visual Studio 9 2008" -A Itanium``
+ * ``cmake -G "Visual Studio 9 2008" -A <WinCE-SDK>``
+ (Specify a target platform matching a Windows CE SDK name.)
For compatibility with CMake versions prior to 3.1, one may specify
a target platform name optionally at the end of the generator name.
diff --git a/Help/generator/Xcode.rst b/Help/generator/Xcode.rst
index be03a2219..e4900a1e0 100644
--- a/Help/generator/Xcode.rst
+++ b/Help/generator/Xcode.rst
@@ -3,7 +3,8 @@ Xcode
Generate Xcode project files.
-This supports Xcode 5.0 and above.
+.. versionchanged:: 3.15
+ This generator supports Xcode 5.0 and above.
.. _`Xcode Build System Selection`:
@@ -14,7 +15,8 @@ By default Xcode is allowed to select its own default toolchain.
The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps
via the :manual:`cmake(1)` ``-T`` option, to specify another toolset.
-This generator supports toolset specification using one of these forms:
+.. versionadded:: 3.19
+ This generator supports toolset specification using one of these forms:
* ``toolset``
* ``toolset[,key=value]*``
@@ -33,3 +35,12 @@ Supported pairs are:
For example, to select the original build system under Xcode 12,
run :manual:`cmake(1)` with the option ``-T buildsystem=1``.
+
+Swift Support
+^^^^^^^^^^^^^
+
+.. versionadded:: 3.4
+
+When using the :generator:`Xcode` generator with Xcode 6.1 or higher,
+one may enable the ``Swift`` language with the :command:`enable_language`
+command or the :command:`project`.
diff --git a/Help/guide/ide-integration/index.rst b/Help/guide/ide-integration/index.rst
index 8ea31a003..addf93215 100644
--- a/Help/guide/ide-integration/index.rst
+++ b/Help/guide/ide-integration/index.rst
@@ -82,8 +82,8 @@ as the include directories, compile definitions, etc. used to build the
artifacts. Such information can be obtained by using the
:manual:`File API <cmake-file-api(7)>`. The manual page for the File API
contains more information about the API and how to invoke it.
-:manual:`Server mode <cmake-server(7)>` is deprecated and should not be
-used on CMake 3.14 or later.
+:manual:`Server mode <cmake-server(7)>` was removed as of CMake 3.20 and
+should not be used on CMake 3.14 or later.
IDEs should avoid creating more build trees than necessary, and only create
multiple build trees if the user wishes to switch to a different compiler,
diff --git a/Help/guide/importing-exporting/MathFunctions/CMakeLists.txt b/Help/guide/importing-exporting/MathFunctions/CMakeLists.txt
index 13c82dd10..9a9e40ee2 100644
--- a/Help/guide/importing-exporting/MathFunctions/CMakeLists.txt
+++ b/Help/guide/importing-exporting/MathFunctions/CMakeLists.txt
@@ -31,7 +31,7 @@ install(FILES MathFunctions.h DESTINATION include)
install(EXPORT MathFunctionsTargets
FILE MathFunctionsTargets.cmake
NAMESPACE MathFunctions::
- DESTINATION lib/cmake
+ DESTINATION lib/cmake/MathFunctions
)
# include CMakePackageConfigHelpers macro
@@ -58,14 +58,14 @@ write_basic_package_version_file(
# create config file
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfig.cmake"
- INSTALL_DESTINATION lib/cmake
+ INSTALL_DESTINATION lib/cmake/MathFunctions
)
# install config files
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfigVersion.cmake"
- DESTINATION lib/cmake
+ DESTINATION lib/cmake/MathFunctions
)
# generate the export targets for the build tree
diff --git a/Help/guide/importing-exporting/MathFunctionsComponents/Addition/CMakeLists.txt b/Help/guide/importing-exporting/MathFunctionsComponents/Addition/CMakeLists.txt
index e3cf711f7..17ad95210 100644
--- a/Help/guide/importing-exporting/MathFunctionsComponents/Addition/CMakeLists.txt
+++ b/Help/guide/importing-exporting/MathFunctionsComponents/Addition/CMakeLists.txt
@@ -26,5 +26,5 @@ install(FILES Addition.h DESTINATION include)
install(EXPORT AdditionTargets
FILE MathFunctionsAdditionTargets.cmake
NAMESPACE MathFunctions::
- DESTINATION lib/cmake
+ DESTINATION lib/cmake/MathFunctions
)
diff --git a/Help/guide/importing-exporting/MathFunctionsComponents/CMakeLists.txt b/Help/guide/importing-exporting/MathFunctionsComponents/CMakeLists.txt
index 4e3496dcc..fd95e28df 100644
--- a/Help/guide/importing-exporting/MathFunctionsComponents/CMakeLists.txt
+++ b/Help/guide/importing-exporting/MathFunctionsComponents/CMakeLists.txt
@@ -24,7 +24,7 @@ write_basic_package_version_file(
# create config file
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfig.cmake"
- INSTALL_DESTINATION lib/cmake
+ INSTALL_DESTINATION lib/cmake/MathFunctions
NO_CHECK_REQUIRED_COMPONENTS_MACRO
)
@@ -32,5 +32,5 @@ configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfigVersion.cmake"
- DESTINATION lib/cmake
+ DESTINATION lib/cmake/MathFunctions
)
diff --git a/Help/guide/importing-exporting/MathFunctionsComponents/SquareRoot/CMakeLists.txt b/Help/guide/importing-exporting/MathFunctionsComponents/SquareRoot/CMakeLists.txt
index ffa1e3def..be5ae65d1 100644
--- a/Help/guide/importing-exporting/MathFunctionsComponents/SquareRoot/CMakeLists.txt
+++ b/Help/guide/importing-exporting/MathFunctionsComponents/SquareRoot/CMakeLists.txt
@@ -26,5 +26,5 @@ install(FILES SquareRoot.h DESTINATION include)
install(EXPORT SquareRootTargets
FILE MathFunctionsSquareRootTargets.cmake
NAMESPACE MathFunctions::
- DESTINATION lib/cmake
+ DESTINATION lib/cmake/MathFunctions
)
diff --git a/Help/guide/tutorial/index.rst b/Help/guide/tutorial/index.rst
index 4b09e53a9..94753d5dc 100644
--- a/Help/guide/tutorial/index.rst
+++ b/Help/guide/tutorial/index.rst
@@ -176,7 +176,7 @@ directory:
To make use of the new library we will add an :command:`add_subdirectory`
call in the top-level ``CMakeLists.txt`` file so that the library will get
built. We add the new library to the executable, and add ``MathFunctions`` as
-an include directory so that the ``mqsqrt.h`` header file can be found. The
+an include directory so that the ``mysqrt.h`` header file can be found. The
last few lines of the top-level ``CMakeLists.txt`` file should now look like:
.. code-block:: cmake
@@ -414,27 +414,23 @@ 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``. 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.
+these functions using the :module:`CheckSymbolExists` module in
+``MathFunctions/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.
.. literalinclude:: Step6/MathFunctions/CMakeLists.txt
:language: cmake
:start-after: # does this system provide the log and exp functions?
:end-before: # add compile definitions
-Now let's add these defines to ``TutorialConfig.h.in`` so that we can use them
-from ``mysqrt.cxx``:
-
-.. code-block:: console
+If available, use :command:`target_compile_definitions` to specify
+``HAVE_LOG`` and ``HAVE_EXP`` as ``PRIVATE`` compile definitions.
- // does the platform provide exp and log functions?
- #cmakedefine HAVE_LOG
- #cmakedefine HAVE_EXP
+.. literalinclude:: Step6/MathFunctions/CMakeLists.txt
+ :language: cmake
+ :start-after: # add compile definitions
+ :end-before: # install rules
If ``log`` and ``exp`` are available on the system, then we will use them to
compute the square root in the ``mysqrt`` function. Add the following code to
@@ -456,51 +452,8 @@ Run the :manual:`cmake <cmake(1)>` executable or the
:manual:`cmake-gui <cmake-gui(1)>` to configure the project and then build it
with your chosen build tool and run the Tutorial executable.
-You will notice that we're not using ``log`` and ``exp``, even if we think they
-should be available. We should realize quickly that we have forgotten to
-include ``TutorialConfig.h`` in ``mysqrt.cxx``.
-
-We will also need to update ``MathFunctions/CMakeLists.txt`` so ``mysqrt.cxx``
-knows where this file is located:
-
-.. code-block:: cmake
-
- target_include_directories(MathFunctions
- INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
- PRIVATE ${CMAKE_BINARY_DIR}
- )
-
-After making this update, go ahead and build the project again and run the
-built Tutorial executable. If ``log`` and ``exp`` are still not being used,
-open the generated ``TutorialConfig.h`` file from the build directory. Maybe
-they aren't available on the current system?
-
Which function gives better results now, sqrt or mysqrt?
-Specify Compile Definition
---------------------------
-
-Is there a better place for us to save the ``HAVE_LOG`` and ``HAVE_EXP`` values
-other than in ``TutorialConfig.h``? Let's try to use
-:command:`target_compile_definitions`.
-
-First, remove the defines from ``TutorialConfig.h.in``. We no longer need to
-include ``TutorialConfig.h`` from ``mysqrt.cxx`` or the extra include in
-``MathFunctions/CMakeLists.txt``.
-
-Next, we can move the check for ``HAVE_LOG`` and ``HAVE_EXP`` to
-``MathFunctions/CMakeLists.txt`` and then specify those values as ``PRIVATE``
-compile definitions.
-
-.. literalinclude:: Step6/MathFunctions/CMakeLists.txt
- :language: cmake
- :start-after: # does this system provide the log and exp functions?
- :end-before: # install rules
-
-After making these updates, go ahead and build the project again. Run the
-built Tutorial executable and verify that the results are same as earlier in
-this step.
-
Adding a Custom Command and Generated File (Step 6)
===================================================
diff --git a/Help/guide/user-interaction/index.rst b/Help/guide/user-interaction/index.rst
index 9e9f2a51f..ba8196bda 100644
--- a/Help/guide/user-interaction/index.rst
+++ b/Help/guide/user-interaction/index.rst
@@ -228,7 +228,7 @@ The Visual Studio toolset can be specified with the
.. code-block:: console
$ # Build with the clang-cl toolset
- $ cmake.exe .. -G "Visual Studio 16 2019" -A x64 -T LLVM
+ $ cmake.exe .. -G "Visual Studio 16 2019" -A x64 -T ClangCL
$ # Build targeting Windows XP
$ cmake.exe .. -G "Visual Studio 16 2019" -A x64 -T v120_xp
diff --git a/Help/manual/cmake-commands.7.rst b/Help/manual/cmake-commands.7.rst
index 0aa4f7517..036fa8fe5 100644
--- a/Help/manual/cmake-commands.7.rst
+++ b/Help/manual/cmake-commands.7.rst
@@ -20,6 +20,7 @@ These commands are always available.
/command/cmake_language
/command/cmake_minimum_required
/command/cmake_parse_arguments
+ /command/cmake_path
/command/cmake_policy
/command/configure_file
/command/continue
diff --git a/Help/manual/cmake-compile-features.7.rst b/Help/manual/cmake-compile-features.7.rst
index 690d293ac..0d15ddfc3 100644
--- a/Help/manual/cmake-compile-features.7.rst
+++ b/Help/manual/cmake-compile-features.7.rst
@@ -89,6 +89,8 @@ Feature requirements are evaluated transitively by consuming the link
implementation. See :manual:`cmake-buildsystem(7)` for more on
transitive behavior of build properties and usage requirements.
+.. _`Requiring Language Standards`:
+
Requiring Language Standards
----------------------------
@@ -358,6 +360,7 @@ versions specified for each:
* ``Cray``: Cray Compiler Environment version 8.1+.
* ``PGI``: PGI version 12.10+.
+* ``NVHPC``: NVIDIA HPC compilers version 11.0+.
* ``TI``: Texas Instruments compiler.
* ``XL``: IBM XL version 10.1+.
@@ -373,4 +376,5 @@ their associated meta-features (e.g. ``cuda_std_11``) available from the
following :variable:`compiler ids <CMAKE_<LANG>_COMPILER_ID>` as of the
versions specified for each:
+* ``Clang``: Clang compiler 5.0+.
* ``NVIDIA``: NVIDIA nvcc compiler 7.5+.
diff --git a/Help/manual/cmake-developer.7.rst b/Help/manual/cmake-developer.7.rst
index 85ed935e6..af9a8ab0d 100644
--- a/Help/manual/cmake-developer.7.rst
+++ b/Help/manual/cmake-developer.7.rst
@@ -23,15 +23,14 @@ in turn link to developer guides for CMake itself.
Find Modules
============
-A "find module" is a ``Find<PackageName>.cmake`` file to be loaded
-by the :command:`find_package` command when invoked for ``<PackageName>``.
+A "find module" is a ``Find<PackageName>.cmake`` file to be loaded by the
+:command:`find_package` command when invoked for ``<PackageName>``.
-The primary task of a find module is to determine whether a package
-exists on the system, set the ``<PackageName>_FOUND`` variable to reflect
-this and provide any variables, macros and imported targets required to
-use the package. A find module is useful in cases where an upstream
-library does not provide a
-:ref:`config file package <Config File Packages>`.
+The primary task of a find module is to determine whether a package is
+available, set the ``<PackageName>_FOUND`` variable to reflect this and
+provide any variables, macros and imported targets required to use the
+package. A find module is useful in cases where an upstream library does
+not provide a :ref:`config file package <Config File Packages>`.
The traditional approach is to use variables for everything, including
libraries and executables: see the `Standard Variable Names`_ section
@@ -91,55 +90,92 @@ Standard Variable Names
For a ``FindXxx.cmake`` module that takes the approach of setting
variables (either instead of or in addition to creating imported
targets), the following variable names should be used to keep things
-consistent between find modules. Note that all variables start with
-``Xxx_`` to make sure they do not interfere with other find modules; the
-same consideration applies to macros, functions and imported targets.
+consistent between Find modules. Note that all variables start with
+``Xxx_``, which (unless otherwise noted) must match exactly the name
+of the ``FindXxx.cmake`` file, including upper/lowercase.
+This prefix on the variable names ensures that they do not conflict with
+variables of other Find modules. The same pattern should also be followed
+for any macros, functions and imported targets defined by the Find module.
``Xxx_INCLUDE_DIRS``
The final set of include directories listed in one variable for use by
- client code. This should not be a cache entry.
+ client code. This should not be a cache entry (note that this also means
+ this variable should not be used as the result variable of a
+ :command:`find_path` command - see ``Xxx_INCLUDE_DIR`` below for that).
``Xxx_LIBRARIES``
- The libraries to link against to use Xxx. These should include full
- paths. This should not be a cache entry.
+ The libraries to use with the module. These may be CMake targets, full
+ absolute paths to a library binary or the name of a library that the
+ linker must find in its search path. This should not be a cache entry
+ (note that this also means this variable should not be used as the
+ result variable of a :command:`find_library` command - see
+ ``Xxx_LIBRARY`` below for that).
``Xxx_DEFINITIONS``
- Definitions to use when compiling code that uses Xxx. This really
- shouldn't include options such as ``-DHAS_JPEG`` that a client
+ The compile definitions to use when compiling code that uses the module.
+ This really shouldn't include options such as ``-DHAS_JPEG`` that a client
source-code file uses to decide whether to ``#include <jpeg.h>``
``Xxx_EXECUTABLE``
- Where to find the Xxx tool.
-
-``Xxx_Yyy_EXECUTABLE``
- Where to find the Yyy tool that comes with Xxx.
+ The full absolute path to an executable. In this case, ``Xxx`` might not
+ be the name of the module, it might be the name of the tool (usually
+ converted to all uppercase), assuming that tool has such a well-known name
+ that it is unlikely that another tool with the same name exists. It would
+ be appropriate to use this as the result variable of a
+ :command:`find_program` command.
+
+``Xxx_YYY_EXECUTABLE``
+ Similar to ``Xxx_EXECUTABLE`` except here the ``Xxx`` is always the module
+ name and ``YYY`` is the tool name (again, usually fully uppercase).
+ Prefer this form if the tool name is not very widely known or has the
+ potential to clash with another tool. For greater consistency, also
+ prefer this form if the module provides more than one executable.
``Xxx_LIBRARY_DIRS``
Optionally, the final set of library directories listed in one
- variable for use by client code. This should not be a cache entry.
+ variable for use by client code. This should not be a cache entry.
``Xxx_ROOT_DIR``
- Where to find the base directory of Xxx.
-
-``Xxx_VERSION_Yy``
- Expect Version Yy if true. Make sure at most one of these is ever true.
-
-``Xxx_WRAP_Yy``
- If False, do not try to use the relevant CMake wrapping command.
+ Where to find the base directory of the module.
+
+``Xxx_VERSION_VV``
+ Variables of this form specify whether the ``Xxx`` module being provided
+ is version ``VV`` of the module. There should not be more than one
+ variable of this form set to true for a given module. For example, a
+ module ``Barry`` might have evolved over many years and gone through a
+ number of different major versions. Version 3 of the ``Barry`` module
+ might set the variable ``Barry_VERSION_3`` to true, whereas an older
+ version of the module might set ``Barry_VERSION_2`` to true instead.
+ It would be an error for both ``Barry_VERSION_3`` and ``Barry_VERSION_2``
+ to both be set to true.
+
+``Xxx_WRAP_YY``
+ When a variable of this form is set to false, it indicates that the
+ relevant wrapping command should not be used. The wrapping command
+ depends on the module, it may be implied by the module name or it might
+ be specified by the ``YY`` part of the variable.
``Xxx_Yy_FOUND``
- If False, optional Yy part of Xxx system is not available.
+ For variables of this form, ``Yy`` is the name of a component for the
+ module. It should match exactly one of the valid component names that
+ may be passed to the :command:`find_package` command for the module.
+ If a variable of this form is set to false, it means that the ``Yy``
+ component of module ``Xxx`` was not found or is not available.
+ Variables of this form would typically be used for optional components
+ so that the caller can check whether an optional component is available.
``Xxx_FOUND``
- Set to false, or undefined, if we haven't found, or don't want to use
- Xxx.
+ When the :command:`find_package` command returns to the caller, this
+ variable will be set to true if the module was deemed to have been found
+ successfully.
``Xxx_NOT_FOUND_MESSAGE``
Should be set by config-files in the case that it has set
``Xxx_FOUND`` to FALSE. The contained message will be printed by the
:command:`find_package` command and by
- ``find_package_handle_standard_args()`` to inform the user about the
- problem.
+ :command:`find_package_handle_standard_args` to inform the user about the
+ problem. Use this instead of calling :command:`message` directly to
+ report a reason for failing to find the module or package.
``Xxx_RUNTIME_LIBRARY_DIRS``
Optionally, the runtime library search path for use when running an
@@ -160,23 +196,36 @@ same consideration applies to macros, functions and imported targets.
``Xxx_VERSION_PATCH``
The patch version of the package found, if any.
-The following names should not usually be used in CMakeLists.txt files, but
-are typically cache variables for users to edit and control the
-behaviour of find modules (like entering the path to a library manually)
+The following names should not usually be used in ``CMakeLists.txt`` files.
+They are intended for use by Find modules to specify and cache the locations
+of specific files or directories. Users are typically able to set and edit
+these variables to control the behavior of Find modules (like entering the
+path to a library manually):
``Xxx_LIBRARY``
- The path of the Xxx library (as used with :command:`find_library`, for
- example).
+ The path of the library. Use this form only when the module provides a
+ single library. It is appropriate to use this as the result variable
+ in a :command:`find_library` command.
``Xxx_Yy_LIBRARY``
- The path of the Yy library that is part of the Xxx system. It may or
- may not be required to use Xxx.
+ The path of library ``Yy`` provided by the module ``Xxx``. Use this form
+ when the module provides more than one library or where other modules may
+ also provide a library of the same name. It is also appropriate to use
+ this form as the result variable in a :command:`find_library` command.
``Xxx_INCLUDE_DIR``
- Where to find headers for using the Xxx library.
+ When the module provides only a single library, this variable can be used
+ to specify where to find headers for using the library (or more accurately,
+ the path that consumers of the library should add to their header search
+ path). It would be appropriate to use this as the result variable in a
+ :command:`find_path` command.
``Xxx_Yy_INCLUDE_DIR``
- Where to find headers for using the Yy library of the Xxx system.
+ If the module provides more than one library or where other modules may
+ also provide a library of the same name, this form is recommended for
+ specifying where to find headers for using library ``Yy`` provided by
+ the module. Again, it would be appropriate to use this as the result
+ variable in a :command:`find_path` command.
To prevent users being overwhelmed with settings to configure, try to
keep as many options as possible out of the cache, leaving at least one
@@ -185,7 +234,8 @@ not-found library (e.g. ``Xxx_ROOT_DIR``). For the same reason, mark
most cache options as advanced. For packages which provide both debug
and release binaries, it is common to create cache variables with a
``_LIBRARY_<CONFIG>`` suffix, such as ``Foo_LIBRARY_RELEASE`` and
-``Foo_LIBRARY_DEBUG``.
+``Foo_LIBRARY_DEBUG``. The :module:`SelectLibraryConfigurations` module
+can be helpful for such cases.
While these are the standard variable names, you should provide
backwards compatibility for any old names that were actually in use.
diff --git a/Help/manual/cmake-env-variables.7.rst b/Help/manual/cmake-env-variables.7.rst
index d9cfa7ae8..bc1fa1d85 100644
--- a/Help/manual/cmake-env-variables.7.rst
+++ b/Help/manual/cmake-env-variables.7.rst
@@ -57,6 +57,7 @@ Environment Variables for Languages
/envvar/CC
/envvar/CFLAGS
/envvar/CSFLAGS
+ /envvar/CUDAARCHS
/envvar/CUDACXX
/envvar/CUDAFLAGS
/envvar/CUDAHOSTCXX
diff --git a/Help/manual/cmake-file-api.7.rst b/Help/manual/cmake-file-api.7.rst
index 6876e1c81..89739b7d5 100644
--- a/Help/manual/cmake-file-api.7.rst
+++ b/Help/manual/cmake-file-api.7.rst
@@ -1154,3 +1154,160 @@ The members specific to ``cmakeFiles`` objects are:
``isCMake``
Optional member that is present with boolean value ``true``
if the path specifies a file in the CMake installation.
+
+Object Kind "toolchains"
+------------------------
+
+The ``toolchains`` object kind lists properties of the toolchains used during
+the build. These include the language, compiler path, ID, and version.
+
+There is only one ``toolchains`` object major version, version 1.
+
+"toolchains" version 1
+^^^^^^^^^^^^^^^^^^^^^^
+
+``toolchains`` object version 1 is a JSON object:
+
+.. code-block:: json
+
+ {
+ "kind": "toolchains",
+ "version": { "major": 1, "minor": 0 },
+ "toolchains": [
+ {
+ "language": "C",
+ "compiler": {
+ "path": "/usr/bin/cc",
+ "id": "GNU",
+ "version": "9.3.0",
+ "implicit": {
+ "includeDirectories": [
+ "/usr/lib/gcc/x86_64-linux-gnu/9/include",
+ "/usr/local/include",
+ "/usr/include/x86_64-linux-gnu",
+ "/usr/include"
+ ],
+ "linkDirectories": [
+ "/usr/lib/gcc/x86_64-linux-gnu/9",
+ "/usr/lib/x86_64-linux-gnu",
+ "/usr/lib",
+ "/lib/x86_64-linux-gnu",
+ "/lib"
+ ],
+ "linkFrameworkDirectories": [],
+ "linkLibraries": [ "gcc", "gcc_s", "c", "gcc", "gcc_s" ]
+ }
+ },
+ "sourceFileExtensions": [ "c", "m" ]
+ },
+ {
+ "language": "CXX",
+ "compiler": {
+ "path": "/usr/bin/c++",
+ "id": "GNU",
+ "version": "9.3.0",
+ "implicit": {
+ "includeDirectories": [
+ "/usr/include/c++/9",
+ "/usr/include/x86_64-linux-gnu/c++/9",
+ "/usr/include/c++/9/backward",
+ "/usr/lib/gcc/x86_64-linux-gnu/9/include",
+ "/usr/local/include",
+ "/usr/include/x86_64-linux-gnu",
+ "/usr/include"
+ ],
+ "linkDirectories": [
+ "/usr/lib/gcc/x86_64-linux-gnu/9",
+ "/usr/lib/x86_64-linux-gnu",
+ "/usr/lib",
+ "/lib/x86_64-linux-gnu",
+ "/lib"
+ ],
+ "linkFrameworkDirectories": [],
+ "linkLibraries": [
+ "stdc++", "m", "gcc_s", "gcc", "c", "gcc_s", "gcc"
+ ]
+ }
+ },
+ "sourceFileExtensions": [
+ "C", "M", "c++", "cc", "cpp", "cxx", "mm", "CPP"
+ ]
+ }
+ ]
+ }
+
+The members specific to ``toolchains`` objects are:
+
+``toolchains``
+ A JSON array whose entries are each a JSON object specifying a toolchain
+ associated with a particular language. The members of each entry are:
+
+ ``language``
+ A JSON string specifying the toolchain language, like C or CXX. Language
+ names are the same as langauge names that can be passed to the
+ :command:`project` command. Because CMake only supports a single toolchain
+ per language, this field can be used as a key.
+
+ ``compiler``
+ A JSON object containing members:
+
+ ``path``
+ Optional member that is present when the
+ :variable:`CMAKE_<LANG>_COMPILER` variable is defined for the current
+ language. Its value is a JSON string holding the path to the compiler.
+
+ ``id``
+ Optional member that is present when the
+ :variable:`CMAKE_<LANG>_COMPILER_ID` variable is defined for the current
+ language. Its value is a JSON string holding the ID (GNU, MSVC, etc.) of
+ the compiler.
+
+ ``version``
+ Optional member that is present when the
+ :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable is defined for the
+ current language. Its value is a JSON string holding the version of the
+ compiler.
+
+ ``target``
+ Optional member that is present when the
+ :variable:`CMAKE_<LANG>_COMPILER_TARGET` variable is defined for the
+ current language. Its value is a JSON string holding the cross-compiling
+ target of the compiler.
+
+ ``implicit``
+ A JSON object containing members:
+
+ ``includeDirectories``
+ Optional member that is present when the
+ :variable:`CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES` variable is
+ defined for the current language. Its value is a JSON array of JSON
+ strings where each string holds a path to an implicit include
+ directory for the compiler.
+
+ ``linkDirectories``
+ Optional member that is present when the
+ :variable:`CMAKE_<LANG>_IMPLICIT_LINK_DIRECTORIES` variable is
+ defined for the current language. Its value is a JSON array of JSON
+ strings where each string holds a path to an implicit link directory
+ for the compiler.
+
+ ``linkFrameworkDirectories``
+ Optional member that is present when the
+ :variable:`CMAKE_<LANG>_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES` variable
+ is defined for the current language. Its value is a JSON array of JSON
+ strings where each string holds a path to an implicit link framework
+ directory for the compiler.
+
+ ``linkLibraries``
+ Optional member that is present when the
+ :variable:`CMAKE_<LANG>_IMPLICIT_LINK_LIBRARIES` variable is defined
+ for the current language. Its value is a JSON array of JSON strings
+ where each string holds a path to an implicit link library for the
+ compiler.
+
+ ``sourceFileExtensions``
+ Optional member that is present when the
+ :variable:`CMAKE_<LANG>_SOURCE_FILE_EXTENSIONS` variable is defined for
+ the current language. Its value is a JSON array of JSON strings where each
+ each string holds a file extension (without the leading dot) for the
+ language.
diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst
index 482b14e31..ca4ea3e0a 100644
--- a/Help/manual/cmake-generator-expressions.7.rst
+++ b/Help/manual/cmake-generator-expressions.7.rst
@@ -46,7 +46,8 @@ Available boolean expressions are:
Logical Operators
-----------------
-``$<BOOL:string>``
+.. genex:: $<BOOL:string>
+
Converts ``string`` to ``0`` or ``1``. Evaluates to ``0`` if any of the
following is true:
@@ -57,23 +58,27 @@ Logical Operators
Otherwise evaluates to ``1``.
-``$<AND:conditions>``
+.. genex:: $<AND:conditions>
+
where ``conditions`` is a comma-separated list of boolean expressions.
Evaluates to ``1`` if all conditions are ``1``.
Otherwise evaluates to ``0``.
-``$<OR:conditions>``
+.. genex:: $<OR:conditions>
+
where ``conditions`` is a comma-separated list of boolean expressions.
Evaluates to ``1`` if at least one of the conditions is ``1``.
Otherwise evaluates to ``0``.
-``$<NOT:condition>``
+.. genex:: $<NOT:condition>
+
``0`` if ``condition`` is ``1``, else ``1``.
String Comparisons
------------------
-``$<STREQUAL:string1,string2>``
+.. genex:: $<STREQUAL:string1,string2>
+
``1`` if ``string1`` and ``string2`` are equal, else ``0``.
The comparison is case-sensitive. For a case-insensitive comparison,
combine with a :ref:`string transforming generator expression
@@ -83,101 +88,150 @@ String Comparisons
$<STREQUAL:$<UPPER_CASE:${foo}>,"BAR"> # "1" if ${foo} is any of "BAR", "Bar", "bar", ...
-``$<EQUAL:value1,value2>``
+.. genex:: $<EQUAL:value1,value2>
+
``1`` if ``value1`` and ``value2`` are numerically equal, else ``0``.
-``$<IN_LIST:string,list>``
+
+.. genex:: $<IN_LIST:string,list>
+
``1`` if ``string`` is member of the semicolon-separated ``list``, else ``0``.
Uses case-sensitive comparisons.
-``$<VERSION_LESS:v1,v2>``
+
+.. genex:: $<VERSION_LESS:v1,v2>
+
``1`` if ``v1`` is a version less than ``v2``, else ``0``.
-``$<VERSION_GREATER:v1,v2>``
+
+.. genex:: $<VERSION_GREATER:v1,v2>
+
``1`` if ``v1`` is a version greater than ``v2``, else ``0``.
-``$<VERSION_EQUAL:v1,v2>``
+
+.. genex:: $<VERSION_EQUAL:v1,v2>
+
``1`` if ``v1`` is the same version as ``v2``, else ``0``.
-``$<VERSION_LESS_EQUAL:v1,v2>``
+
+.. genex:: $<VERSION_LESS_EQUAL:v1,v2>
+
``1`` if ``v1`` is a version less than or equal to ``v2``, else ``0``.
-``$<VERSION_GREATER_EQUAL:v1,v2>``
- ``1`` if ``v1`` is a version greater than or equal to ``v2``, else ``0``.
+.. genex:: $<VERSION_GREATER_EQUAL:v1,v2>
+
+ ``1`` if ``v1`` is a version greater than or equal to ``v2``, else ``0``.
Variable Queries
----------------
-``$<TARGET_EXISTS:target>``
+.. genex:: $<TARGET_EXISTS:target>
+
``1`` if ``target`` exists, else ``0``.
-``$<CONFIG:cfgs>``
+
+.. genex:: $<CONFIG:cfgs>
+
``1`` if config is any one of the entries in ``cfgs``, else ``0``. This is a
case-insensitive comparison. The mapping in
:prop_tgt:`MAP_IMPORTED_CONFIG_<CONFIG>` is also considered by this
expression when it is evaluated on a property on an :prop_tgt:`IMPORTED`
target.
-``$<PLATFORM_ID:platform_ids>``
+
+.. genex:: $<PLATFORM_ID:platform_ids>
+
where ``platform_ids`` is a comma-separated list.
``1`` if the CMake's platform id matches any one of the entries in
``platform_ids``, otherwise ``0``.
See also the :variable:`CMAKE_SYSTEM_NAME` variable.
-``$<C_COMPILER_ID:compiler_ids>``
+
+.. genex:: $<C_COMPILER_ID:compiler_ids>
+
where ``compiler_ids`` is a comma-separated list.
``1`` if the CMake's compiler id of the C compiler matches any one
of the entries in ``compiler_ids``, otherwise ``0``.
See also the :variable:`CMAKE_<LANG>_COMPILER_ID` variable.
-``$<CXX_COMPILER_ID:compiler_ids>``
+
+.. genex:: $<CXX_COMPILER_ID:compiler_ids>
+
where ``compiler_ids`` is a comma-separated list.
``1`` if the CMake's compiler id of the CXX compiler matches any one
of the entries in ``compiler_ids``, otherwise ``0``.
See also the :variable:`CMAKE_<LANG>_COMPILER_ID` variable.
-``$<CUDA_COMPILER_ID:compiler_ids>``
+
+.. genex:: $<CUDA_COMPILER_ID:compiler_ids>
+
where ``compiler_ids`` is a comma-separated list.
``1`` if the CMake's compiler id of the CUDA compiler matches any one
of the entries in ``compiler_ids``, otherwise ``0``.
See also the :variable:`CMAKE_<LANG>_COMPILER_ID` variable.
-``$<OBJC_COMPILER_ID:compiler_ids>``
+
+.. genex:: $<OBJC_COMPILER_ID:compiler_ids>
+
where ``compiler_ids`` is a comma-separated list.
``1`` if the CMake's compiler id of the Objective-C compiler matches any one
of the entries in ``compiler_ids``, otherwise ``0``.
See also the :variable:`CMAKE_<LANG>_COMPILER_ID` variable.
-``$<OBJCXX_COMPILER_ID:compiler_ids>``
+
+.. genex:: $<OBJCXX_COMPILER_ID:compiler_ids>
+
where ``compiler_ids`` is a comma-separated list.
``1`` if the CMake's compiler id of the Objective-C++ compiler matches any one
of the entries in ``compiler_ids``, otherwise ``0``.
See also the :variable:`CMAKE_<LANG>_COMPILER_ID` variable.
-``$<Fortran_COMPILER_ID:compiler_ids>``
+
+.. genex:: $<Fortran_COMPILER_ID:compiler_ids>
+
where ``compiler_ids`` is a comma-separated list.
``1`` if the CMake's compiler id of the Fortran compiler matches any one
of the entries in ``compiler_ids``, otherwise ``0``.
See also the :variable:`CMAKE_<LANG>_COMPILER_ID` variable.
-``$<ISPC_COMPILER_ID:compiler_ids>``
+
+.. genex:: $<ISPC_COMPILER_ID:compiler_ids>
+
where ``compiler_ids`` is a comma-separated list.
``1`` if the CMake's compiler id of the ISPC compiler matches any one
of the entries in ``compiler_ids``, otherwise ``0``.
See also the :variable:`CMAKE_<LANG>_COMPILER_ID` variable.
-``$<C_COMPILER_VERSION:version>``
+
+.. genex:: $<C_COMPILER_VERSION:version>
+
``1`` if the version of the C compiler matches ``version``, otherwise ``0``.
See also the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable.
-``$<CXX_COMPILER_VERSION:version>``
+
+.. genex:: $<CXX_COMPILER_VERSION:version>
+
``1`` if the version of the CXX compiler matches ``version``, otherwise ``0``.
See also the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable.
-``$<CUDA_COMPILER_VERSION:version>``
+
+.. genex:: $<CUDA_COMPILER_VERSION:version>
+
``1`` if the version of the CXX compiler matches ``version``, otherwise ``0``.
See also the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable.
-``$<OBJC_COMPILER_VERSION:version>``
+
+.. genex:: $<OBJC_COMPILER_VERSION:version>
+
``1`` if the version of the OBJC compiler matches ``version``, otherwise ``0``.
See also the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable.
-``$<OBJCXX_COMPILER_VERSION:version>``
+
+.. genex:: $<OBJCXX_COMPILER_VERSION:version>
+
``1`` if the version of the OBJCXX compiler matches ``version``, otherwise ``0``.
See also the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable.
-``$<Fortran_COMPILER_VERSION:version>``
+
+.. genex:: $<Fortran_COMPILER_VERSION:version>
+
``1`` if the version of the Fortran compiler matches ``version``, otherwise ``0``.
See also the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable.
-``$<ISPC_COMPILER_VERSION:version>``
+
+.. genex:: $<ISPC_COMPILER_VERSION:version>
+
``1`` if the version of the ISPC compiler matches ``version``, otherwise ``0``.
See also the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable.
-``$<TARGET_POLICY:policy>``
+
+.. genex:: $<TARGET_POLICY:policy>
+
``1`` if the ``policy`` was NEW when the 'head' target was created,
else ``0``. If the ``policy`` was not set, the warning message for the policy
will be emitted. This generator expression only works for a subset of
policies.
-``$<COMPILE_FEATURES:features>``
+
+.. genex:: $<COMPILE_FEATURES:features>
+
where ``features`` is a comma-spearated list.
Evaluates to ``1`` if all of the ``features`` are available for the 'head'
target, and ``0`` otherwise. If this expression is used while evaluating
@@ -189,7 +243,8 @@ Variable Queries
.. _`Boolean COMPILE_LANGUAGE Generator Expression`:
-``$<COMPILE_LANG_AND_ID:language,compiler_ids>``
+.. genex:: $<COMPILE_LANG_AND_ID:language,compiler_ids>
+
``1`` when the language used for compilation unit matches ``language`` and
the CMake's compiler id of the language compiler matches any one of the
entries in ``compiler_ids``, otherwise ``0``. This expression is a short form
@@ -225,7 +280,8 @@ Variable Queries
$<$<AND:$<COMPILE_LANGUAGE:C>,$<C_COMPILER_ID:Clang>>:COMPILING_C_WITH_CLANG>
)
-``$<COMPILE_LANGUAGE:languages>``
+.. genex:: $<COMPILE_LANGUAGE:languages>
+
``1`` when the language used for compilation unit matches any of the entries
in ``languages``, otherwise ``0``. This expression may be used to specify
compile options, compile definitions, and include directories for source files of a
@@ -270,7 +326,8 @@ Variable Queries
.. _`Boolean LINK_LANGUAGE Generator Expression`:
-``$<LINK_LANG_AND_ID:language,compiler_ids>``
+.. genex:: $<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
@@ -309,7 +366,8 @@ Variable Queries
``$<LINK_LANGUAGE:language>`` for constraints about the usage of this
generator expression.
-``$<LINK_LANGUAGE:languages>``
+.. genex:: $<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
@@ -371,14 +429,16 @@ Variable Queries
evaluation will give ``C`` as link language, so the second pass will
correctly add target ``libother`` as link dependency.
-``$<DEVICE_LINK:list>``
+.. genex:: $<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>``
+.. genex:: $<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
@@ -434,11 +494,16 @@ Escaped Characters
String literals to escape the special meaning a character would otherwise have:
-``$<ANGLE-R>``
+.. genex:: $<ANGLE-R>
+
A literal ``>``. Used for example to compare strings that contain a ``>``.
-``$<COMMA>``
+
+.. genex:: $<COMMA>
+
A literal ``,``. Used for example to compare strings which contain a ``,``.
-``$<SEMICOLON>``
+
+.. genex:: $<SEMICOLON>
+
A literal ``;``. Used to prevent list expansion on an argument with ``;``.
.. _`Conditional Generator Expressions`:
@@ -449,11 +514,13 @@ Conditional Expressions
Conditional generator expressions depend on a boolean condition
that must be ``0`` or ``1``.
-``$<condition:true_string>``
+.. genex:: $<condition:true_string>
+
Evaluates to ``true_string`` if ``condition`` is ``1``.
Otherwise evaluates to the empty string.
-``$<IF:condition,true_string,false_string>``
+.. genex:: $<IF:condition,true_string,false_string>
+
Evaluates to ``true_string`` if ``condition`` is ``1``.
Otherwise evaluates to ``false_string``.
@@ -472,22 +539,34 @@ otherwise expands to the empty string.
String Transformations
----------------------
-``$<JOIN:list,string>``
+.. genex:: $<JOIN:list,string>
+
Joins the list with the content of ``string``.
-``$<REMOVE_DUPLICATES:list>``
+
+.. genex:: $<REMOVE_DUPLICATES:list>
+
Removes duplicated items in the given ``list``.
-``$<FILTER:list,INCLUDE|EXCLUDE,regex>``
+
+.. genex:: $<FILTER:list,INCLUDE|EXCLUDE,regex>
+
Includes or removes items from ``list`` that match the regular expression ``regex``.
-``$<LOWER_CASE:string>``
+
+.. genex:: $<LOWER_CASE:string>
+
Content of ``string`` converted to lower case.
-``$<UPPER_CASE:string>``
+
+.. genex:: $<UPPER_CASE:string>
+
Content of ``string`` converted to upper case.
-``$<GENEX_EVAL:expr>``
+.. genex:: $<GENEX_EVAL:expr>
+
Content of ``expr`` evaluated as a generator expression in the current
context. This enables consumption of generator expressions whose
evaluation results itself in generator expressions.
-``$<TARGET_GENEX_EVAL:tgt,expr>``
+
+.. genex:: $<TARGET_GENEX_EVAL:tgt,expr>
+
Content of ``expr`` evaluated as a generator expression in the context of
``tgt`` target. This enables consumption of custom target properties that
themselves contain generator expressions.
@@ -526,62 +605,99 @@ String Transformations
Variable Queries
----------------
-``$<CONFIG>``
+.. genex:: $<CONFIG>
+
Configuration name.
-``$<CONFIGURATION>``
+
+.. genex:: $<CONFIGURATION>
+
Configuration name. Deprecated since CMake 3.0. Use ``CONFIG`` instead.
-``$<PLATFORM_ID>``
+
+.. genex:: $<PLATFORM_ID>
+
The current system's CMake platform id.
See also the :variable:`CMAKE_SYSTEM_NAME` variable.
-``$<C_COMPILER_ID>``
+
+.. genex:: $<C_COMPILER_ID>
+
The CMake's compiler id of the C compiler used.
See also the :variable:`CMAKE_<LANG>_COMPILER_ID` variable.
-``$<CXX_COMPILER_ID>``
+
+.. genex:: $<CXX_COMPILER_ID>
+
The CMake's compiler id of the CXX compiler used.
See also the :variable:`CMAKE_<LANG>_COMPILER_ID` variable.
-``$<CUDA_COMPILER_ID>``
+
+.. genex:: $<CUDA_COMPILER_ID>
+
The CMake's compiler id of the CUDA compiler used.
See also the :variable:`CMAKE_<LANG>_COMPILER_ID` variable.
-``$<OBJC_COMPILER_ID>``
+
+.. genex:: $<OBJC_COMPILER_ID>
+
The CMake's compiler id of the OBJC compiler used.
See also the :variable:`CMAKE_<LANG>_COMPILER_ID` variable.
-``$<OBJCXX_COMPILER_ID>``
+
+.. genex:: $<OBJCXX_COMPILER_ID>
+
The CMake's compiler id of the OBJCXX compiler used.
See also the :variable:`CMAKE_<LANG>_COMPILER_ID` variable.
-``$<Fortran_COMPILER_ID>``
+
+.. genex:: $<Fortran_COMPILER_ID>
+
The CMake's compiler id of the Fortran compiler used.
See also the :variable:`CMAKE_<LANG>_COMPILER_ID` variable.
-``$<ISPC_COMPILER_ID>``
+
+.. genex:: $<ISPC_COMPILER_ID>
+
The CMake's compiler id of the ISPC compiler used.
See also the :variable:`CMAKE_<LANG>_COMPILER_ID` variable.
-``$<C_COMPILER_VERSION>``
+
+.. genex:: $<C_COMPILER_VERSION>
+
The version of the C compiler used.
See also the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable.
-``$<CXX_COMPILER_VERSION>``
+
+.. genex:: $<CXX_COMPILER_VERSION>
+
The version of the CXX compiler used.
See also the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable.
-``$<CUDA_COMPILER_VERSION>``
+
+.. genex:: $<CUDA_COMPILER_VERSION>
+
The version of the CUDA compiler used.
See also the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable.
-``$<OBJC_COMPILER_VERSION>``
+
+.. genex:: $<OBJC_COMPILER_VERSION>
+
The version of the OBJC compiler used.
See also the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable.
-``$<OBJCXX_COMPILER_VERSION>``
+
+.. genex:: $<OBJCXX_COMPILER_VERSION>
+
The version of the OBJCXX compiler used.
See also the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable.
-``$<Fortran_COMPILER_VERSION>``
+
+.. genex:: $<Fortran_COMPILER_VERSION>
+
The version of the Fortran compiler used.
See also the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable.
-``$<ISPC_COMPILER_VERSION>``
+
+.. genex:: $<ISPC_COMPILER_VERSION>
+
The version of the ISPC compiler used.
See also the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable.
-``$<COMPILE_LANGUAGE>``
+
+.. genex:: $<COMPILE_LANGUAGE>
+
The compile language of source files when evaluating compile options.
See :ref:`the related boolean expression
<Boolean COMPILE_LANGUAGE Generator Expression>`
``$<COMPILE_LANGUAGE:language>``
for notes about the portability of this generator expression.
-``$<LINK_LANGUAGE>``
+
+.. genex:: $<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>``
@@ -608,14 +724,19 @@ 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>``
+.. genex:: $<TARGET_NAME_IF_EXISTS:tgt>
+
The target name ``tgt`` if the target exists, an empty string otherwise.
Note that ``tgt`` is not added as a dependency of the target this
expression is evaluated on.
-``$<TARGET_FILE:tgt>``
+
+.. genex:: $<TARGET_FILE:tgt>
+
Full path to the ``tgt`` binary file.
-``$<TARGET_FILE_BASE_NAME:tgt>``
+
+.. genex:: $<TARGET_FILE_BASE_NAME:tgt>
+
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``.
@@ -632,36 +753,48 @@ which is just the string ``tgt``.
Note that ``tgt`` is not added as a dependency of the target this
expression is evaluated on.
-``$<TARGET_FILE_PREFIX:tgt>``
+
+.. genex:: $<TARGET_FILE_PREFIX:tgt>
+
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>``
+
+.. genex:: $<TARGET_FILE_SUFFIX:tgt>
+
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>``
+
+.. genex:: $<TARGET_FILE_NAME:tgt>
+
The ``tgt`` filename.
Note that ``tgt`` is not added as a dependency of the target this
expression is evaluated on (see policy :policy:`CMP0112`).
-``$<TARGET_FILE_DIR:tgt>``
+
+.. genex:: $<TARGET_FILE_DIR:tgt>
+
Directory of the ``tgt`` binary file.
Note that ``tgt`` is not added as a dependency of the target this
expression is evaluated on (see policy :policy:`CMP0112`).
-``$<TARGET_LINKER_FILE:tgt>``
+
+.. genex:: $<TARGET_LINKER_FILE:tgt>
+
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>``
+
+.. genex:: $<TARGET_LINKER_FILE_BASE_NAME:tgt>
+
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``.
@@ -677,7 +810,9 @@ which is just the string ``tgt``.
Note that ``tgt`` is not added as a dependency of the target this
expression is evaluated on.
-``$<TARGET_LINKER_FILE_PREFIX:tgt>``
+
+.. genex:: $<TARGET_LINKER_FILE_PREFIX:tgt>
+
Prefix of file used to link target ``tgt``.
See also the :prop_tgt:`PREFIX` and :prop_tgt:`IMPORT_PREFIX` target
@@ -685,7 +820,9 @@ which is just the string ``tgt``.
Note that ``tgt`` is not added as a dependency of the target this
expression is evaluated on.
-``$<TARGET_LINKER_FILE_SUFFIX:tgt>``
+
+.. genex:: $<TARGET_LINKER_FILE_SUFFIX:tgt>
+
Suffix of file used to link where ``tgt`` is the name of a target.
The suffix corresponds to the file extension (such as ".so" or ".lib").
@@ -695,36 +832,49 @@ which is just the string ``tgt``.
Note that ``tgt`` is not added as a dependency of the target this
expression is evaluated on.
-``$<TARGET_LINKER_FILE_NAME:tgt>``
+
+.. genex:: $<TARGET_LINKER_FILE_NAME:tgt>
+
Name of file used to link target ``tgt``.
Note that ``tgt`` is not added as a dependency of the target this
expression is evaluated on (see policy :policy:`CMP0112`).
-``$<TARGET_LINKER_FILE_DIR:tgt>``
+
+.. genex:: $<TARGET_LINKER_FILE_DIR:tgt>
+
Directory of file used to link target ``tgt``.
Note that ``tgt`` is not added as a dependency of the target this
expression is evaluated on (see policy :policy:`CMP0112`).
-``$<TARGET_SONAME_FILE:tgt>``
+
+.. genex:: $<TARGET_SONAME_FILE:tgt>
+
File with soname (``.so.3``) where ``tgt`` is the name of a target.
-``$<TARGET_SONAME_FILE_NAME:tgt>``
+.. genex:: $<TARGET_SONAME_FILE_NAME:tgt>
+
Name of file with soname (``.so.3``).
Note that ``tgt`` is not added as a dependency of the target this
expression is evaluated on (see policy :policy:`CMP0112`).
-``$<TARGET_SONAME_FILE_DIR:tgt>``
+
+.. genex:: $<TARGET_SONAME_FILE_DIR:tgt>
+
Directory of with soname (``.so.3``).
Note that ``tgt`` is not added as a dependency of the target this
expression is evaluated on (see policy :policy:`CMP0112`).
-``$<TARGET_PDB_FILE:tgt>``
+
+.. genex:: $<TARGET_PDB_FILE:tgt>
+
Full path to the linker generated program database file (.pdb)
where ``tgt`` is the name of a target.
See also the :prop_tgt:`PDB_NAME` and :prop_tgt:`PDB_OUTPUT_DIRECTORY`
target properties and their configuration specific variants
:prop_tgt:`PDB_NAME_<CONFIG>` and :prop_tgt:`PDB_OUTPUT_DIRECTORY_<CONFIG>`.
-``$<TARGET_PDB_FILE_BASE_NAME:tgt>``
+
+.. genex:: $<TARGET_PDB_FILE_BASE_NAME:tgt>
+
Base name of the linker generated program database file (.pdb)
where ``tgt`` is the name of a target.
@@ -740,23 +890,31 @@ which is just the string ``tgt``.
Note that ``tgt`` is not added as a dependency of the target this
expression is evaluated on.
-``$<TARGET_PDB_FILE_NAME:tgt>``
+
+.. genex:: $<TARGET_PDB_FILE_NAME:tgt>
+
Name of the linker generated program database file (.pdb).
Note that ``tgt`` is not added as a dependency of the target this
expression is evaluated on (see policy :policy:`CMP0112`).
-``$<TARGET_PDB_FILE_DIR:tgt>``
+
+.. genex:: $<TARGET_PDB_FILE_DIR:tgt>
+
Directory of the linker generated program database file (.pdb).
Note that ``tgt`` is not added as a dependency of the target this
expression is evaluated on (see policy :policy:`CMP0112`).
-``$<TARGET_BUNDLE_DIR:tgt>``
+
+.. genex:: $<TARGET_BUNDLE_DIR:tgt>
+
Full path to the bundle directory (``my.app``, ``my.framework``, or
``my.bundle``) where ``tgt`` is the name of a target.
Note that ``tgt`` is not added as a dependency of the target this
expression is evaluated on (see policy :policy:`CMP0112`).
-``$<TARGET_BUNDLE_CONTENT_DIR:tgt>``
+
+.. genex:: $<TARGET_BUNDLE_CONTENT_DIR:tgt>
+
Full path to the bundle content directory where ``tgt`` is the name of a
target. For the macOS SDK it leads to ``my.app/Contents``, ``my.framework``,
or ``my.bundle/Contents``. For all other SDKs (e.g. iOS) it leads to
@@ -765,17 +923,23 @@ which is just the string ``tgt``.
Note that ``tgt`` is not added as a dependency of the target this
expression is evaluated on (see policy :policy:`CMP0112`).
-``$<TARGET_PROPERTY:tgt,prop>``
+
+.. genex:: $<TARGET_PROPERTY:tgt,prop>
+
Value of the property ``prop`` on the target ``tgt``.
Note that ``tgt`` is not added as a dependency of the target this
expression is evaluated on.
-``$<TARGET_PROPERTY:prop>``
+
+.. genex:: $<TARGET_PROPERTY:prop>
+
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>``
+
+.. genex:: $<INSTALL_PREFIX>
+
Content of the install prefix when the target is exported via
:command:`install(EXPORT)`, or when evaluated in
:prop_tgt:`INSTALL_NAME_DIR`, and empty otherwise.
@@ -783,30 +947,43 @@ which is just the string ``tgt``.
Output-Related Expressions
--------------------------
-``$<TARGET_NAME:...>``
+.. genex:: $<TARGET_NAME:...>
+
Marks ``...`` as being the name of a target. This is required if exporting
targets to multiple dependent export sets. The ``...`` must be a literal
name of a target- it may not contain generator expressions.
-``$<LINK_ONLY:...>``
+
+.. genex:: $<LINK_ONLY:...>
+
Content of ``...`` except when evaluated in a link interface while
propagating :ref:`Target Usage Requirements`, in which case it is the
empty string.
Intended for use only in an :prop_tgt:`INTERFACE_LINK_LIBRARIES` target
property, perhaps via the :command:`target_link_libraries` command,
to specify private link dependencies without other usage requirements.
-``$<INSTALL_INTERFACE:...>``
+
+.. genex:: $<INSTALL_INTERFACE:...>
+
Content of ``...`` when the property is exported using :command:`install(EXPORT)`,
and empty otherwise.
-``$<BUILD_INTERFACE:...>``
+
+.. genex:: $<BUILD_INTERFACE:...>
+
Content of ``...`` when the property is exported using :command:`export`, or
when the target is used by another target in the same buildsystem. Expands to
the empty string otherwise.
-``$<MAKE_C_IDENTIFIER:...>``
+
+.. genex:: $<MAKE_C_IDENTIFIER:...>
+
Content of ``...`` converted to a C identifier. The conversion follows the
same behavior as :command:`string(MAKE_C_IDENTIFIER)`.
-``$<TARGET_OBJECTS:objLib>``
+
+.. genex:: $<TARGET_OBJECTS:objLib>
+
List of objects resulting from build of ``objLib``.
-``$<SHELL_PATH:...>``
+
+.. genex:: $<SHELL_PATH:...>
+
Content of ``...`` converted to shell path style. For example, slashes are
converted to backslashes in Windows shells and drive letters are converted
to posix paths in MSYS shells. The ``...`` must be an absolute path.
@@ -816,6 +993,26 @@ Output-Related Expressions
``;`` on Windows). Be sure to enclose the argument containing this genex
in double quotes in CMake source code so that ``;`` does not split arguments.
+.. genex:: $<OUTPUT_CONFIG:...>
+
+ .. versionadded:: 3.20
+
+ Only valid in :command:`add_custom_command` and :command:`add_custom_target`
+ as the outer-most generator expression in an argument.
+ With the :generator:`Ninja Multi-Config` generator, generator expressions
+ in ``...`` are evaluated using the custom command's "output config".
+ With other generators, the content of ``...`` is evaluated normally.
+
+.. genex:: $<COMMAND_CONFIG:...>
+
+ .. versionadded:: 3.20
+
+ Only valid in :command:`add_custom_command` and :command:`add_custom_target`
+ as the outer-most generator expression in an argument.
+ With the :generator:`Ninja Multi-Config` generator, generator expressions
+ in ``...`` are evaluated using the custom command's "command config".
+ With other generators, the content of ``...`` is evaluated normally.
+
Debugging
=========
diff --git a/Help/manual/cmake-modules.7.rst b/Help/manual/cmake-modules.7.rst
index 431797fb9..17c1a1e5c 100644
--- a/Help/manual/cmake-modules.7.rst
+++ b/Help/manual/cmake-modules.7.rst
@@ -15,7 +15,6 @@ These modules are loaded using the :command:`include` command.
.. toctree::
:maxdepth: 1
- /module/AddFileDependencies
/module/AndroidTestUtilities
/module/BundleUtilities
/module/CheckCCompilerFlag
@@ -75,7 +74,6 @@ These modules are loaded using the :command:`include` command.
/module/CTestUseLaunchers
/module/Dart
/module/DeployQt4
- /module/Documentation
/module/ExternalData
/module/ExternalProject
/module/FeatureSummary
@@ -98,11 +96,8 @@ These modules are loaded using the :command:`include` command.
/module/TestForSTDNamespace
/module/UseEcos
/module/UseJava
- /module/UseJavaClassFilelist
- /module/UseJavaSymlinks
/module/UseSWIG
/module/UsewxWidgets
- /module/WriteCompilerDetectionHeader
Find Modules
^^^^^^^^^^^^
@@ -276,15 +271,20 @@ Deprecated Utility Modules
.. toctree::
:maxdepth: 1
+ /module/AddFileDependencies
/module/CMakeDetermineVSServicePack
/module/CMakeExpandImportedTargets
/module/CMakeForceCompiler
/module/CMakeParseArguments
+ /module/Documentation
/module/MacroAddFileDependencies
/module/TestCXXAcceptsFlag
+ /module/UseJavaClassFilelist
+ /module/UseJavaSymlinks
/module/UsePkgConfig
/module/Use_wxWindows
/module/WriteBasicConfigVersionFile
+ /module/WriteCompilerDetectionHeader
Deprecated Find Modules
=======================
diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst
index fa10f664c..bd6b2f0ca 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.20
+=================================
+
+.. toctree::
+ :maxdepth: 1
+
+ CMP0120: The WriteCompilerDetectionHeader module is removed. </policy/CMP0120>
+ CMP0119: LANGUAGE source file property explicitly compiles as language. </policy/CMP0119>
+ CMP0118: The GENERATED source file property is now visible in all directories. </policy/CMP0118>
+ CMP0117: MSVC RTTI flag /GR is not added to CMAKE_CXX_FLAGS by default. </policy/CMP0117>
+ CMP0116: Ninja generators transform DEPFILEs from add_custom_command(). </policy/CMP0116>
+ CMP0115: Source file extensions must be explicit. </policy/CMP0115>
+
Policies Introduced by CMake 3.19
=================================
diff --git a/Help/manual/cmake-presets.7.rst b/Help/manual/cmake-presets.7.rst
index 6f137c459..467818dfa 100644
--- a/Help/manual/cmake-presets.7.rst
+++ b/Help/manual/cmake-presets.7.rst
@@ -29,337 +29,839 @@ is using Git, ``CMakePresets.json`` may be tracked, and
Format
======
- The files are a JSON document with an object as the root:
+The files are a JSON document with an object as the root:
- .. literalinclude:: presets/example.json
- :language: json
+.. literalinclude:: presets/example.json
+ :language: json
- The root object recognizes the following fields:
+The root object recognizes the following fields:
- ``version``
+``version``
- A required integer representing the version of the JSON schema. Currently,
- the only supported version is 1.
+ A required integer representing the version of the JSON schema.
+ The supported versions are ``1`` and ``2``.
- ``cmakeMinimumRequired``
+``cmakeMinimumRequired``
- An optional object representing the minimum version of CMake needed to
- build this project. This object consists of the following fields:
+ An optional object representing the minimum version of CMake needed to
+ build this project. This object consists of the following fields:
- ``major``
+ ``major``
- An optional integer representing the major version.
+ An optional integer representing the major version.
- ``minor``
+ ``minor``
- An optional integer representing the minor version.
+ An optional integer representing the minor version.
- ``patch``
+ ``patch``
- An optional integer representing the patch version.
+ An optional integer representing the patch version.
- ``vendor``
+``vendor``
- An optional map containing vendor-specific information. CMake does not
- interpret the contents of this field except to verify that it is a map if
- it does exist. However, the keys should be a vendor-specific domain name
- followed by a ``/``-separated path. For example, the Example IDE 1.0 could
- use ``example.com/ExampleIDE/1.0``. The value of each field can be anything
- desired by the vendor, though will typically be a map.
+ An optional map containing vendor-specific information. CMake does not
+ interpret the contents of this field except to verify that it is a map if
+ it does exist. However, the keys should be a vendor-specific domain name
+ followed by a ``/``-separated path. For example, the Example IDE 1.0 could
+ use ``example.com/ExampleIDE/1.0``. The value of each field can be anything
+ desired by the vendor, though will typically be a map.
- ``configurePresets``
+``configurePresets``
- An optional array of configure preset objects. Each preset may contain the
- following fields:
+ An optional array of `Configure Preset`_ objects.
+ This is allowed in preset files specifying version 1 or above.
- ``name``
+``buildPresets``
+
+ An optional array of `Build Preset`_ objects.
+ This is allowed in preset files specifying version 2 or above.
+
+``testPresets``
+
+ An optional array of `Test Preset`_ objects.
+ This is allowed in preset files specifying version 2 or above.
+
+Configure Preset
+^^^^^^^^^^^^^^^^
+
+Each entry of the ``configurePresets`` array is a JSON object
+that may contain the following fields:
+
+``name``
+
+ A required string representing the machine-friendly name of the preset.
+ This identifier is used in the :ref:`cmake --preset <CMake Options>` option.
+ There must not be two configure presets in the union of ``CMakePresets.json``
+ and ``CMakeUserPresets.json`` in the same directory with the same name.
+ However, a configure preset may have the same name as a build or test preset.
+
+``hidden``
+
+ An optional boolean specifying whether or not a preset should be hidden.
+ If a preset is hidden, it cannot be used in the ``--preset=`` argument,
+ will not show up in the :manual:`CMake GUI <cmake-gui(1)>`, and does not
+ have to have a valid ``generator`` or ``binaryDir``, even from
+ inheritance. ``hidden`` presets are intended to be used as a base for
+ other presets to inherit via the ``inherits`` field.
+
+``inherits``
+
+ An optional array of strings representing the names of presets to inherit
+ from. The preset will inherit all of the fields from the ``inherits``
+ presets by default (except ``name``, ``hidden``, ``inherits``,
+ ``description``, and ``displayName``), but can override them as
+ desired. If multiple ``inherits`` presets provide conflicting values for
+ the same field, the earlier preset in the ``inherits`` list will be
+ preferred. Presets in ``CMakePresets.json`` may not inherit from presets
+ in ``CMakeUserPresets.json``.
+
+ This field can also be a string, which is equivalent to an array
+ containing one string.
+
+``vendor``
+
+ An optional map containing vendor-specific information. CMake does not
+ interpret the contents of this field except to verify that it is a map
+ if it does exist. However, it should follow the same conventions as the
+ root-level ``vendor`` field. If vendors use their own per-preset
+ ``vendor`` field, they should implement inheritance in a sensible manner
+ when appropriate.
+
+``displayName``
+
+ An optional string with a human-friendly name of the preset.
+
+``description``
+
+ An optional string with a human-friendly description of the preset.
+
+``generator``
+
+ An optional string representing the generator to use for the preset. If
+ ``generator`` is not specified, it must be inherited from the
+ ``inherits`` preset (unless this preset is ``hidden``).
+
+ Note that for Visual Studio generators, unlike in the command line ``-G``
+ argument, you cannot include the platform name in the generator name. Use
+ the ``architecture`` field instead.
+
+``architecture``, ``toolset``
+
+ Optional fields representing the platform and toolset, respectively, for
+ generators that support them. Each may be either a string or an object
+ with the following fields:
+
+ ``value``
+
+ An optional string representing the value.
+
+ ``strategy``
+
+ An optional string telling CMake how to handle the ``architecture`` or
+ ``toolset`` field. Valid values are:
+
+ ``"set"``
+
+ Set the respective value. This will result in an error for generators
+ that do not support the respective field.
+
+ ``"external"``
+
+ Do not set the value, even if the generator supports it. This is
+ useful if, for example, a preset uses the Ninja generator, and an IDE
+ knows how to set up the Visual C++ environment from the
+ ``architecture`` and ``toolset`` fields. In that case, CMake will
+ ignore the field, but the IDE can use them to set up the environment
+ before invoking CMake.
+
+``binaryDir``
+
+ An optional string representing the path to the output binary directory.
+ This field supports `macro expansion`_. If a relative path is specified,
+ it is calculated relative to the source directory. If ``binaryDir`` is not
+ specified, it must be inherited from the ``inherits`` preset (unless this
+ preset is ``hidden``).
+
+``cmakeExecutable``
+
+ An optional string representing the path to the CMake executable to use
+ for this preset. This is reserved for use by IDEs, and is not used by
+ CMake itself. IDEs that use this field should expand any macros in it.
+
+``cacheVariables``
+
+ An optional map of cache variables. The key is the variable name (which
+ may not be an empty string), and the value is either ``null``, a boolean
+ (which is equivalent to a value of ``"TRUE"`` or ``"FALSE"`` and a type
+ of ``BOOL``), a string representing the value of the variable (which
+ supports `macro expansion`_), or an object with the following fields:
+
+ ``type``
+
+ An optional string representing the type of the variable.
+
+ ``value``
+
+ A required string or boolean representing the value of the variable.
+ A boolean is equivalent to ``"TRUE"`` or ``"FALSE"``. This field
+ supports `macro expansion`_.
+
+ Cache variables are inherited through the ``inherits`` field, and the
+ preset's variables will be the union of its own ``cacheVariables`` and
+ the ``cacheVariables`` from all its parents. If multiple presets in this
+ union define the same variable, the standard rules of ``inherits`` are
+ applied. Setting a variable to ``null`` causes it to not be set, even if
+ a value was inherited from another preset.
+
+``environment``
+
+ An optional map of environment variables. The key is the variable name
+ (which may not be an empty string), and the value is either ``null`` or
+ a string representing the value of the variable. Each variable is set
+ regardless of whether or not a value was given to it by the process's
+ environment. This field supports `macro expansion`_, and environment
+ variables in this map may reference each other, and may be listed in any
+ order, as long as such references do not cause a cycle (for example,
+ if ``ENV_1`` is ``$env{ENV_2}``, ``ENV_2`` may not be ``$env{ENV_1}``.)
+
+ Environment variables are inherited through the ``inherits`` field, and
+ the preset's environment will be the union of its own ``environment`` and
+ the ``environment`` from all its parents. If multiple presets in this
+ union define the same variable, the standard rules of ``inherits`` are
+ applied. Setting a variable to ``null`` causes it to not be set, even if
+ a value was inherited from another preset.
+
+``warnings``
+
+ An optional object specifying the warnings to enable. The object may
+ contain the following fields:
+
+ ``dev``
+
+ An optional boolean. Equivalent to passing ``-Wdev`` or ``-Wno-dev``
+ on the command line. This may not be set to ``false`` if ``errors.dev``
+ is set to ``true``.
+
+ ``deprecated``
+
+ An optional boolean. Equivalent to passing ``-Wdeprecated`` or
+ ``-Wno-deprecated`` on the command line. This may not be set to
+ ``false`` if ``errors.deprecated`` is set to ``true``.
+
+ ``uninitialized``
+
+ An optional boolean. Setting this to ``true`` is equivalent to passing
+ ``--warn-uninitialized`` on the command line.
+
+ ``unusedCli``
+
+ An optional boolean. Setting this to ``false`` is equivalent to passing
+ ``--no-warn-unused-cli`` on the command line.
+
+ ``systemVars``
+
+ An optional boolean. Setting this to ``true`` is equivalent to passing
+ ``--check-system-vars`` on the command line.
+
+``errors``
+
+ An optional object specifying the errors to enable. The object may
+ contain the following fields:
+
+ ``dev``
+
+ An optional boolean. Equivalent to passing ``-Werror=dev`` or
+ ``-Wno-error=dev`` on the command line. This may not be set to ``true``
+ if ``warnings.dev`` is set to ``false``.
+
+ ``deprecated``
+
+ An optional boolean. Equivalent to passing ``-Werror=deprecated`` or
+ ``-Wno-error=deprecated`` on the command line. This may not be set to
+ ``true`` if ``warnings.deprecated`` is set to ``false``.
+
+``debug``
+
+ An optional object specifying debug options. The object may contain the
+ following fields:
+
+ ``output``
+
+ An optional boolean. Setting this to ``true`` is equivalent to passing
+ ``--debug-output`` on the command line.
+
+ ``tryCompile``
+
+ An optional boolean. Setting this to ``true`` is equivalent to passing
+ ``--debug-trycompile`` on the command line.
+
+ ``find``
+
+ An optional boolean. Setting this to ``true`` is equivalent to passing
+ ``--debug-find`` on the command line.
+
+Build Preset
+^^^^^^^^^^^^
+
+Each entry of the ``buildPresets`` array is a JSON object
+that may contain the following fields:
+
+``name``
+
+ A required string representing the machine-friendly name of the preset.
+ This identifier is used in the
+ :ref:`cmake --build --preset <Build Tool Mode>` option.
+ There must not be two build presets in the union of ``CMakePresets.json``
+ and ``CMakeUserPresets.json`` in the same directory with the same name.
+ However, a build preset may have the same name as a configure or test preset.
+
+``hidden``
+
+ An optional boolean specifying whether or not a preset should be hidden.
+ If a preset is hidden, it cannot be used in the ``--preset`` argument
+ and does not have to have a valid ``configurePreset``, even from
+ inheritance. ``hidden`` presets are intended to be used as a base for
+ other presets to inherit via the ``inherits`` field.
+
+``inherits``
+
+ An optional array of strings representing the names of presets to
+ inherit from. The preset will inherit all of the fields from the
+ ``inherits`` presets by default (except ``name``, ``hidden``,
+ ``inherits``, ``description``, and ``displayName``), but can override
+ them as desired. If multiple ``inherits`` presets provide conflicting
+ values for the same field, the earlier preset in the ``inherits`` list
+ will be preferred. Presets in ``CMakePresets.json`` may not inherit from
+ presets in ``CMakeUserPresets.json``.
+
+ This field can also be a string, which is equivalent to an array
+ containing one string.
+
+``vendor``
+
+ An optional map containing vendor-specific information. CMake does not
+ interpret the contents of this field except to verify that it is a map
+ if it does exist. However, it should follow the same conventions as the
+ root-level ``vendor`` field. If vendors use their own per-preset
+ ``vendor`` field, they should implement inheritance in a sensible manner
+ when appropriate.
+
+``displayName``
+
+ An optional string with a human-friendly name of the preset.
+
+``description``
+
+ An optional string with a human-friendly description of the preset.
- A required string representing the machine-friendly name of the preset.
- This identifier is used in the ``--preset`` argument. There must not be
- two presets in the union of ``CMakePresets.json`` and
- ``CMakeUserPresets.json`` in the same directory with the same name.
+``environment``
- ``hidden``
+ An optional map of environment variables. The key is the variable name
+ (which may not be an empty string), and the value is either ``null`` or
+ a string representing the value of the variable. Each variable is set
+ regardless of whether or not a value was given to it by the process's
+ environment. This field supports macro expansion, and environment
+ variables in this map may reference each other, and may be listed in any
+ order, as long as such references do not cause a cycle (for example, if
+ ``ENV_1`` is ``$env{ENV_2}``, ``ENV_2`` may not be ``$env{ENV_1}``.)
- An optional boolean specifying whether or not a preset should be hidden.
- If a preset is hidden, it cannot be used in the ``--preset=`` argument,
- will not show up in the :manual:`CMake GUI <cmake-gui(1)>`, and does not
- have to have a valid ``generator`` or ``binaryDir``, even from
- inheritance. ``hidden`` presets are intended to be used as a base for
- other presets to inherit via the ``inherits`` field.
+ Environment variables are inherited through the ``inherits`` field, and
+ the preset's environment will be the union of its own ``environment``
+ and the ``environment`` from all its parents. If multiple presets in
+ this union define the same variable, the standard rules of ``inherits``
+ are applied. Setting a variable to ``null`` causes it to not be set,
+ even if a value was inherited from another preset.
- ``inherits``
+``configurePreset``
- An optional array of strings representing the names of presets to inherit
- from. The preset will inherit all of the fields from the ``inherits``
- presets by default (except ``name``, ``hidden``, ``inherits``,
- ``description``, and ``displayName``), but can override them as
- desired. If multiple ``inherits`` presets provide conflicting values for
- the same field, the earlier preset in the ``inherits`` list will be
- preferred. Presets in ``CMakePresets.json`` may not inherit from presets
- in ``CMakeUserPresets.json``.
+ An optional string specifying the name of a configure preset to
+ associate with this build preset. If ``configurePreset`` is not
+ specified, it must be inherited from the inherits preset (unless this
+ preset is hidden). The build directory is inferred from the configure
+ preset, so the build will take place in the same ``binaryDir`` that the
+ configuration did.
- This field can also be a string, which is equivalent to an array
- containing one string.
+``inheritConfigureEnvironment``
- ``vendor``
+ An optional boolean that defaults to true. If true, the environment
+ variables from the associated configure preset are inherited after all
+ inherited build preset environments, but before environment variables
+ explicitly specified in this build preset.
- An optional map containing vendor-specific information. CMake does not
- interpret the contents of this field except to verify that it is a map
- if it does exist. However, it should follow the same conventions as the
- root-level ``vendor`` field. If vendors use their own per-preset
- ``vendor`` field, they should implement inheritance in a sensible manner
- when appropriate.
+``jobs``
- ``displayName``
+ An optional integer. Equivalent to passing ``--parallel`` or ``-j`` on
+ the command line.
- An optional string with a human-friendly name of the preset.
+``targets``
- ``description``
+ An optional string or array of strings. Equivalent to passing
+ ``--target`` or ``-t`` on the command line. Vendors may ignore the
+ targets property or hide build presets that explicitly specify targets.
+ This field supports macro expansion.
- An optional string with a human-friendly description of the preset.
+``configuration``
- ``generator``
+ An optional string. Equivalent to passing ``--config`` on the command
+ line.
- An optional string representing the generator to use for the preset. If
- ``generator`` is not specified, it must be inherited from the
- ``inherits`` preset (unless this preset is ``hidden``).
+``cleanFirst``
- Note that for Visual Studio generators, unlike in the command line ``-G``
- argument, you cannot include the platform name in the generator name. Use
- the ``architecture`` field instead.
+ An optional bool. If true, equivalent to passing ``--clean-first`` on
+ the command line.
- ``architecture``
- ``toolset``
+``verbose``
- Optional fields representing the platform and toolset, respectively, for
- generators that support them. Each may be either a string or an object
- with the following fields:
+ An optional bool. If true, equivalent to passing ``--verbose`` on the
+ command line.
- ``value``
+``nativeToolOptions``
- An optional string representing the value.
+ An optional array of strings. Equivalent to passing options after ``--``
+ on the command line. The array values support macro expansion.
- ``strategy``
+Test Preset
+^^^^^^^^^^^
- An optional string telling CMake how to handle the ``architecture`` or
- ``toolset`` field. Valid values are:
+Each entry of the ``testPresets`` array is a JSON object
+that may contain the following fields:
- ``"set"``
+``name``
- Set the respective value. This will result in an error for generators
- that do not support the respective field.
+ A required string representing the machine-friendly name of the preset.
+ This identifier is used in the :ref:`ctest --preset <CTest Options>` option.
+ There must not be two test presets in the union of ``CMakePresets.json``
+ and ``CMakeUserPresets.json`` in the same directory with the same name.
+ However, a test preset may have the same name as a configure or build preset.
- ``"external"``
+``hidden``
- Do not set the value, even if the generator supports it. This is
- useful if, for example, a preset uses the Ninja generator, and an IDE
- knows how to set up the Visual C++ environment from the
- ``architecture`` and ``toolset`` fields. In that case, CMake will
- ignore the field, but the IDE can use them to set up the environment
- before invoking CMake.
+ An optional boolean specifying whether or not a preset should be hidden.
+ If a preset is hidden, it cannot be used in the ``--preset`` argument
+ and does not have to have a valid ``configurePreset``, even from
+ inheritance. ``hidden`` presets are intended to be used as a base for
+ other presets to inherit via the ``inherits`` field.
- ``binaryDir``
+``inherits``
- An optional string representing the path to the output binary directory.
- This field supports macro expansion. If a relative path is specified, it
- is calculated relative to the source directory. If ``binaryDir`` is not
- specified, it must be inherited from the ``inherits`` preset (unless this
- preset is ``hidden``).
+ An optional array of strings representing the names of presets to
+ inherit from. The preset will inherit all of the fields from the
+ ``inherits`` presets by default (except ``name``, ``hidden``,
+ ``inherits``, ``description``, and ``displayName``), but can override
+ them as desired. If multiple ``inherits`` presets provide conflicting
+ values for the same field, the earlier preset in the ``inherits`` list
+ will be preferred. Presets in ``CMakePresets.json`` may not inherit from
+ presets in ``CMakeUserPresets.json``.
- ``cmakeExecutable``
+ This field can also be a string, which is equivalent to an array
+ containing one string.
- An optional string representing the path to the CMake executable to use
- for this preset. This is reserved for use by IDEs, and is not used by
- CMake itself. IDEs that use this field should expand any macros in it.
+``vendor``
- ``cacheVariables``
+ An optional map containing vendor-specific information. CMake does not
+ interpret the contents of this field except to verify that it is a map
+ if it does exist. However, it should follow the same conventions as the
+ root-level ``vendor`` field. If vendors use their own per-preset
+ ``vendor`` field, they should implement inheritance in a sensible manner
+ when appropriate.
- An optional map of cache variables. The key is the variable name (which
- may not be an empty string), and the value is either ``null``, a boolean
- (which is equivalent to a value of ``"TRUE"`` or ``"FALSE"`` and a type
- of ``BOOL``), a string representing the value of the variable (which
- supports macro expansion), or an object with the following fields:
+``displayName``
- ``type``
+ An optional string with a human-friendly name of the preset.
- An optional string representing the type of the variable.
+``description``
- ``value``
+ An optional string with a human-friendly description of the preset.
- A required string or boolean representing the value of the variable.
- A boolean is equivalent to ``"TRUE"`` or ``"FALSE"``. This field
+``environment``
+
+ An optional map of environment variables. The key is the variable name
+ (which may not be an empty string), and the value is either ``null`` or
+ a string representing the value of the variable. Each variable is set
+ regardless of whether or not a value was given to it by the process's
+ environment. This field supports macro expansion, and environment
+ variables in this map may reference each other, and may be listed in any
+ order, as long as such references do not cause a cycle (for example, if
+ ``ENV_1`` is ``$env{ENV_2}``, ``ENV_2`` may not be ``$env{ENV_1}``.)
+
+ Environment variables are inherited through the ``inherits`` field, and
+ the preset's environment will be the union of its own ``environment``
+ and the ``environment`` from all its parents. If multiple presets in
+ this union define the same variable, the standard rules of ``inherits``
+ are applied. Setting a variable to ``null`` causes it to not be set,
+ even if a value was inherited from another preset.
+
+``configurePreset``
+
+ An optional string specifying the name of a configure preset to
+ associate with this test preset. If ``configurePreset`` is not
+ specified, it must be inherited from the inherits preset (unless this
+ preset is hidden). The build directory is inferred from the configure
+ preset, so tests will run in the same ``binaryDir`` that the
+ configuration did and build did.
+
+``inheritConfigureEnvironment``
+
+ An optional boolean that defaults to true. If true, the environment
+ variables from the associated configure preset are inherited after all
+ inherited test preset environments, but before environment variables
+ explicitly specified in this test preset.
+
+``configuration``
+
+ An optional string. Equivalent to passing ``--build-config`` on the
+ command line.
+
+``overwriteConfigurationFile``
+
+ An optional array of configuration options to overwrite options
+ specified in the CTest configuration file. Equivalent to passing
+ ``--overwrite`` for each value in the array. The array values
+ support macro expansion.
+
+``output``
+
+ An optional object specifying output options. The object may contain the
+ following fields.
+
+ ``shortProgress``
+
+ An optional bool. If true, equivalent to passing ``--progress`` on the
+ command line.
+
+ ``verbosity``
+
+ An optional string specifying verbosity level. Must be one of the
+ following:
+
+ ``default``
+
+ Equivalent to passing no verbosity flags on the command line.
+
+ ``verbose``
+
+ Equivalent to passing ``--verbose`` on the command line.
+
+ ``extra``
+
+ Equivalent to passing ``--extra-verbose`` on the command line.
+
+ ``debug``
+
+ An optional bool. If true, equivalent to passing ``--debug`` on the
+ command line.
+
+ ``outputOnFailure``
+
+ An optional bool. If true, equivalent to passing
+ ``--output-on-failure`` on the command line.
+
+ ``quiet``
+
+ An optional bool. If true, equivalent to passing ``--quiet`` on the
+ command line.
+
+ ``outputLogFile``
+
+ An optional string specifying a path to a log file. Equivalent to
+ passing ``--output-log`` on the command line. This field supports
+ macro expansion.
+
+ ``labelSummary``
+
+ An optional bool. If false, equivalent to passing
+ ``--no-label-summary`` on the command line.
+
+ ``subprojectSummary``
+
+ An optional bool. If false, equivalent to passing
+ ``--no-subproject-summary`` on the command line.
+
+ ``maxPassedTestOutputSize``
+
+ An optional integer specifying the maximum output for passed tests in
+ bytes. Equivalent to passing ``--test-output-size-passed`` on the
+ command line.
+
+ ``maxFailedTestOutputSize``
+
+ An optional integer specifying the maximum output for failed tests in
+ bytes. Equivalent to passing ``--test-output-size-failed`` on the
+ command line.
+
+ ``maxTestNameWidth``
+
+ An optional integer specifying the maximum width of a test name to
+ output. Equivalent to passing ``--max-width`` on the command line.
+
+``filter``
+
+ An optional object specifying how to filter the tests to run. The object
+ may contain the following fields.
+
+ ``include``
+
+ An optional object specifying which tests to include. The object may
+ contain the following fields.
+
+ ``name``
+
+ An optional string specifying a regex for test names. Equivalent to
+ passing ``--tests-regex`` on the command line. This field supports
+ macro expansion.
+
+
+ ``label``
+
+ An optional string specifying a regex for test labels. Equivalent to
+ passing ``--label-regex`` on the command line. This field supports
+ macro expansion.
+
+ ``useUnion``
+
+ An optional bool. Equivalent to passing ``--union`` on the command
+ line.
+
+ ``index``
+
+ An optional object specifying tests to include by test index. The
+ object may contain the following fields. Can also be an optional
+ string specifying a file with the command line syntax for
+ ``--tests-information``. If specified as a string, this field
+ supports macro expansion.
+
+ ``start``
+
+ An optional integer specifying a test index to start testing at.
+
+ ``end``
+
+ An optional integer specifying a test index to stop testing at.
+
+ ``stride``
+
+ An optional integer specifying the increment.
+
+ ``specificTests``
+
+ An optional array of integers specifying specific test indices to
+ run.
+
+ ``exclude``
+
+ An optional object specifying which tests to exclude. The object may
+ contain the following fields.
+
+ ``name``
+
+ An optional string specifying a regex for test names. Equivalent to
+ passing ``--exclude-regex`` on the command line. This field supports
+ macro expansion.
+
+ ``label``
+
+ An optional string specifying a regex for test labels. Equivalent to
+ passing ``--label-exclude`` on the command line. This field supports
+ macro expansion.
+
+ ``fixtures``
+
+ An optional object specifying which fixtures to exclude from adding
+ tests. The object may contain the following fields.
+
+ ``any``
+
+ An optional string specifying a regex for text fixtures to exclude
+ from adding any tests. Equivalent to ``--fixture-exclude-any`` on
+ the command line. This field supports macro expansion.
+
+ ``setup``
+
+ An optional string specifying a regex for text fixtures to exclude
+ from adding setup tests. Equivalent to ``--fixture-exclude-setup``
+ on the command line. This field supports macro expansion.
+
+ ``cleanup``
+
+ An optional string specifying a regex for text fixtures to exclude
+ from adding cleanup tests. Equivalent to
+ ``--fixture-exclude-cleanup`` on the command line. This field
supports macro expansion.
- Cache variables are inherited through the ``inherits`` field, and the
- preset's variables will be the union of its own ``cacheVariables`` and
- the ``cacheVariables`` from all its parents. If multiple presets in this
- union define the same variable, the standard rules of ``inherits`` are
- applied. Setting a variable to ``null`` causes it to not be set, even if
- a value was inherited from another preset.
+``execution``
+
+ An optional object specifying options for test execution. The object may
+ contain the following fields.
+
+ ``stopOnFailure``
+
+ An optional bool. If true, equivalent to passing ``--stop-on-failure``
+ on the command line.
+
+ ``enableFailover``
+
+ An optional bool. If true, equivalent to passing ``-F`` on the command
+ line.
+
+ ``jobs``
+
+ An optional integer. Equivalent to passing ``--parallel`` on the
+ command line.
+
+ ``resourceSpecFile``
+
+ An optional string. Equivalent to passing ``--resource-spec-file`` on
+ the command line. This field supports macro expansion.
+
+ ``testLoad``
- ``environment``
+ An optional integer. Equivalent to passing ``--test-load`` on the
+ command line.
- An optional map of environment variables. The key is the variable name
- (which may not be an empty string), and the value is either ``null`` or
- a string representing the value of the variable. Each variable is set
- regardless of whether or not a value was given to it by the process's
- environment. This field supports macro expansion, and environment
- variables in this map may reference each other, and may be listed in any
- order, as long as such references do not cause a cycle (for example,
- if ``ENV_1`` is ``$env{ENV_2}``, ``ENV_2`` may not be ``$env{ENV_1}``.)
+ ``showOnly``
- Environment variables are inherited through the ``inherits`` field, and
- the preset's environment will be the union of its own ``environment`` and
- the ``environment`` from all its parents. If multiple presets in this
- union define the same variable, the standard rules of ``inherits`` are
- applied. Setting a variable to ``null`` causes it to not be set, even if
- a value was inherited from another preset.
+ An optional string. Equivalent to passing ``--show-only`` on the
+ command line. The string must be one of the following values:
- ``warnings``
+ ``human``
- An optional object specifying the warnings to enable. The object may
- contain the following fields:
+ ``json-v1``
- ``dev``
+ ``repeat``
- An optional boolean. Equivalent to passing ``-Wdev`` or ``-Wno-dev``
- on the command line. This may not be set to ``false`` if ``errors.dev``
- is set to ``true``.
+ An optional object specifying how to repeat tests. Equivalent to
+ passing ``--repeat`` on the command line. The object must have the
+ following fields.
- ``deprecated``
+ ``mode``
- An optional boolean. Equivalent to passing ``-Wdeprecated`` or
- ``-Wno-deprecated`` on the command line. This may not be set to
- ``false`` if ``errors.deprecated`` is set to ``true``.
+ A required string. Must be one of the following values:
- ``uninitialized``
+ ``until-fail``
- An optional boolean. Setting this to ``true`` is equivalent to passing
- ``--warn-uninitialized`` on the command line.
+ ``until-pass``
- ``unusedCli``
+ ``after-timeout``
- An optional boolean. Setting this to ``false`` is equivalent to passing
- ``--no-warn-unused-cli`` on the command line.
+ ``count``
- ``systemVars``
+ A required integer.
- An optional boolean. Setting this to ``true`` is equivalent to passing
- ``--check-system-vars`` on the command line.
+ ``interactiveDebugging``
- ``errors``
+ An optional bool. If true, equivalent to passing
+ ``--interactive-debug-mode 1`` on the command line. If false,
+ equivalent to passing ``--interactive-debug-mode 0`` on the command
+ line.
- An optional object specifying the errors to enable. The object may
- contain the following fields:
+ ``scheduleRandom``
- ``dev``
+ An optional bool. If true, equivalent to passing ``--schedule-random``
+ on the command line.
- An optional boolean. Equivalent to passing ``-Werror=dev`` or
- ``-Wno-error=dev`` on the command line. This may not be set to ``true``
- if ``warnings.dev`` is set to ``false``.
+ ``timeout``
- ``deprecated``
+ An optional integer. Equivalent to passing ``--timeout`` on the
+ command line.
- An optional boolean. Equivalent to passing ``-Werror=deprecated`` or
- ``-Wno-error=deprecated`` on the command line. This may not be set to
- ``true`` if ``warnings.deprecated`` is set to ``false``.
+ ``noTestsAction``
- ``debug``
+ An optional string specifying the behavior if no tests are found. Must
+ be one of the following values:
- An optional object specifying debug options. The object may contain the
- following fields:
+ ``default``
- ``output``
+ Equivalent to not passing any value on the command line.
- An optional boolean. Setting this to ``true`` is equivalent to passing
- ``--debug-output`` on the command line.
+ ``error``
- ``tryCompile``
+ Equivalent to passing ``--no-tests=error`` on the command line.
- An optional boolean. Setting this to ``true`` is equivalent to passing
- ``--debug-trycompile`` on the command line.
+ ``ignore``
- ``find``
+ Equivalent to passing ``--no-tests=ignore`` on the command line.
- An optional boolean. Setting this to ``true`` is equivalent to passing
- ``--debug-find`` on the command line.
+Macro Expansion
+^^^^^^^^^^^^^^^
- As mentioned above, some fields support macro expansion. Macros are
- recognized in the form ``$<macro-namespace>{<macro-name>}``. All macros are
- evaluated in the context of the preset being used, even if the macro is in a
- field that was inherited from another preset. For example, if the ``Base``
- preset sets variable ``PRESET_NAME`` to ``${presetName}``, and the
- ``Derived`` preset inherits from ``Base``, ``PRESET_NAME`` will be set to
- ``Derived``.
+As mentioned above, some fields support macro expansion. Macros are
+recognized in the form ``$<macro-namespace>{<macro-name>}``. All macros are
+evaluated in the context of the preset being used, even if the macro is in a
+field that was inherited from another preset. For example, if the ``Base``
+preset sets variable ``PRESET_NAME`` to ``${presetName}``, and the
+``Derived`` preset inherits from ``Base``, ``PRESET_NAME`` will be set to
+``Derived``.
- It is an error to not put a closing brace at the end of a macro name. For
- example, ``${sourceDir`` is invalid. A dollar sign (``$``) followed by
- anything other than a left curly brace (``{``) with a possible namespace is
- interpreted as a literal dollar sign.
+It is an error to not put a closing brace at the end of a macro name. For
+example, ``${sourceDir`` is invalid. A dollar sign (``$``) followed by
+anything other than a left curly brace (``{``) with a possible namespace is
+interpreted as a literal dollar sign.
- Recognized macros include:
+Recognized macros include:
- ``${sourceDir}``
+``${sourceDir}``
- Path to the project source directory.
+ Path to the project source directory.
- ``${sourceParentDir}``
+``${sourceParentDir}``
- Path to the project source directory's parent directory.
+ Path to the project source directory's parent directory.
- ``${sourceDirName}``
+``${sourceDirName}``
- The last filename component of ``${sourceDir}``. For example, if
- ``${sourceDir}`` is ``/path/to/source``, this would be ``source``.
+ The last filename component of ``${sourceDir}``. For example, if
+ ``${sourceDir}`` is ``/path/to/source``, this would be ``source``.
- ``${presetName}``
+``${presetName}``
- Name specified in the preset's ``name`` field.
+ Name specified in the preset's ``name`` field.
- ``${generator}``
+``${generator}``
- Generator specified in the preset's ``generator`` field.
+ Generator specified in the preset's ``generator`` field. For build and
+ test presets, this will evaluate to the generator specified by
+ ``configurePreset``.
- ``${dollar}``
+``${dollar}``
- A literal dollar sign (``$``).
+ A literal dollar sign (``$``).
- ``$env{<variable-name>}``
+``$env{<variable-name>}``
- Environment variable with name ``<variable-name>``. The variable name may
- not be an empty string. If the variable is defined in the ``environment``
- field, that value is used instead of the value from the parent environment.
- If the environment variable is not defined, this evaluates as an empty
- string.
+ Environment variable with name ``<variable-name>``. The variable name may
+ not be an empty string. If the variable is defined in the ``environment``
+ field, that value is used instead of the value from the parent environment.
+ If the environment variable is not defined, this evaluates as an empty
+ string.
- Note that while Windows environment variable names are case-insensitive,
- variable names within a preset are still case-sensitive. This may lead to
- unexpected results when using inconsistent casing. For best results, keep
- the casing of environment variable names consistent.
+ Note that while Windows environment variable names are case-insensitive,
+ variable names within a preset are still case-sensitive. This may lead to
+ unexpected results when using inconsistent casing. For best results, keep
+ the casing of environment variable names consistent.
- ``$penv{<variable-name>}``
+``$penv{<variable-name>}``
- Similar to ``$env{<variable-name>}``, except that the value only comes from
- the parent environment, and never from the ``environment`` field. This
- allows you to prepend or append values to existing environment variables.
- For example, setting ``PATH`` to ``/path/to/ninja/bin:$penv{PATH}`` will
- prepend ``/path/to/ninja/bin`` to the ``PATH`` environment variable. This
- is needed because ``$env{<variable-name>}`` does not allow circular
- references.
+ Similar to ``$env{<variable-name>}``, except that the value only comes from
+ the parent environment, and never from the ``environment`` field. This
+ allows you to prepend or append values to existing environment variables.
+ For example, setting ``PATH`` to ``/path/to/ninja/bin:$penv{PATH}`` will
+ prepend ``/path/to/ninja/bin`` to the ``PATH`` environment variable. This
+ is needed because ``$env{<variable-name>}`` does not allow circular
+ references.
- ``$vendor{<macro-name>}``
+``$vendor{<macro-name>}``
- An extension point for vendors to insert their own macros. CMake will not
- be able to use presets which have a ``$vendor{<macro-name>}`` macro, and
- effectively ignores such presets. However, it will still be able to use
- other presets from the same file.
+ An extension point for vendors to insert their own macros. CMake will not
+ be able to use presets which have a ``$vendor{<macro-name>}`` macro, and
+ effectively ignores such presets. However, it will still be able to use
+ other presets from the same file.
- CMake does not make any attempt to interpret ``$vendor{<macro-name>}``
- macros. However, to avoid name collisions, IDE vendors should prefix
- ``<macro-name>`` with a very short (preferably <= 4 characters) vendor
- identifier prefix, followed by a ``.``, followed by the macro name. For
- example, the Example IDE could have ``$vendor{xide.ideInstallDir}``.
+ CMake does not make any attempt to interpret ``$vendor{<macro-name>}``
+ macros. However, to avoid name collisions, IDE vendors should prefix
+ ``<macro-name>`` with a very short (preferably <= 4 characters) vendor
+ identifier prefix, followed by a ``.``, followed by the macro name. For
+ example, the Example IDE could have ``$vendor{xide.ideInstallDir}``.
Schema
======
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index 5c8a05a0e..af170dabd 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -196,6 +196,7 @@ Properties on Targets
/prop_tgt/EXCLUDE_FROM_ALL
/prop_tgt/EXCLUDE_FROM_DEFAULT_BUILD
/prop_tgt/EXCLUDE_FROM_DEFAULT_BUILD_CONFIG
+ /prop_tgt/EXPORT_COMPILE_COMMANDS
/prop_tgt/EXPORT_NAME
/prop_tgt/EXPORT_PROPERTIES
/prop_tgt/FOLDER
@@ -354,6 +355,7 @@ Properties on Targets
/prop_tgt/UNITY_BUILD_CODE_AFTER_INCLUDE
/prop_tgt/UNITY_BUILD_CODE_BEFORE_INCLUDE
/prop_tgt/UNITY_BUILD_MODE
+ /prop_tgt/UNITY_BUILD_UNIQUE_ID
/prop_tgt/VERSION
/prop_tgt/VISIBILITY_INLINES_HIDDEN
/prop_tgt/VS_CONFIGURATION_TYPE
@@ -397,6 +399,10 @@ Properties on Targets
/prop_tgt/WIN32_EXECUTABLE
/prop_tgt/WINDOWS_EXPORT_ALL_SYMBOLS
/prop_tgt/XCODE_ATTRIBUTE_an-attribute
+ /prop_tgt/XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY
+ /prop_tgt/XCODE_EMBED_FRAMEWORKS_REMOVE_HEADERS_ON_COPY
+ /prop_tgt/XCODE_EMBED_type
+ /prop_tgt/XCODE_EMBED_type_PATH
/prop_tgt/XCODE_EXPLICIT_FILE_TYPE
/prop_tgt/XCODE_GENERATE_SCHEME
/prop_tgt/XCODE_LINK_BUILD_PHASE_MODE
diff --git a/Help/manual/cmake-qt.7.rst b/Help/manual/cmake-qt.7.rst
index d8d61729e..f156f9587 100644
--- a/Help/manual/cmake-qt.7.rst
+++ b/Help/manual/cmake-qt.7.rst
@@ -48,6 +48,8 @@ and ``rcc`` for virtual file system content generation. These tools may be
automatically invoked by :manual:`cmake(1)` if the appropriate conditions
are met. The automatic tool invocation may be used with both Qt 4 and Qt 5.
+.. _`Qt AUTOMOC`:
+
AUTOMOC
^^^^^^^
@@ -77,8 +79,9 @@ automatically added to the target's :prop_tgt:`INCLUDE_DIRECTORIES`.
Not included ``moc_<basename>.cpp`` files will be generated in custom
folders to avoid name collisions and included in a separate
-``<AUTOGEN_BUILD_DIR>/mocs_compilation.cpp`` file which is compiled
-into the target.
+file which is compiled into the target, named either
+``<AUTOGEN_BUILD_DIR>/mocs_compilation.cpp`` or
+``<AUTOGEN_BUILD_DIR>/mocs_compilation_$<CONFIG>.cpp``.
* See :prop_tgt:`AUTOGEN_BUILD_DIR`.
diff --git a/Help/manual/cmake-server.7.rst b/Help/manual/cmake-server.7.rst
index 8f10b9f0e..6c8d0f446 100644
--- a/Help/manual/cmake-server.7.rst
+++ b/Help/manual/cmake-server.7.rst
@@ -3,742 +3,5 @@
cmake-server(7)
***************
-.. only:: html
-
- .. contents::
-
-.. deprecated:: 3.15
-
- This will be removed from a future version of CMake.
- Clients should use the :manual:`cmake-file-api(7)` instead.
-
-Introduction
-============
-
-:manual:`cmake(1)` is capable of providing semantic information about
-CMake code it executes to generate a buildsystem. If executed with
-the ``-E server`` command line options, it starts in a long running mode
-and allows a client to request the available information via a JSON protocol.
-
-The protocol is designed to be useful to IDEs, refactoring tools, and
-other tools which have a need to understand the buildsystem in entirety.
-
-A single :manual:`cmake-buildsystem(7)` may describe buildsystem contents
-and build properties which differ based on
-:manual:`generation-time context <cmake-generator-expressions(7)>`
-including:
-
-* The Platform (eg, Windows, APPLE, Linux).
-* The build configuration (eg, Debug, Release, Coverage).
-* The Compiler (eg, MSVC, GCC, Clang) and compiler version.
-* The language of the source files compiled.
-* Available compile features (eg CXX variadic templates).
-* CMake policies.
-
-The protocol aims to provide information to tooling to satisfy several
-needs:
-
-#. Provide a complete and easily parsed source of all information relevant
- to the tooling as it relates to the source code. There should be no need
- for tooling to parse generated buildsystems to access include directories
- or compile definitions for example.
-#. Semantic information about the CMake buildsystem itself.
-#. Provide a stable interface for reading the information in the CMake cache.
-#. Information for determining when cmake needs to be re-run as a result of
- file changes.
-
-
-Operation
-=========
-
-Start :manual:`cmake(1)` in the server command mode, supplying the path to
-the build directory to process::
-
- cmake -E server (--debug|--pipe=<NAMED_PIPE>)
-
-The server will communicate using stdin/stdout (with the ``--debug`` parameter)
-or using a named pipe (with the ``--pipe=<NAMED_PIPE>`` parameter). Note
-that "named pipe" refers to a local domain socket on Unix and to a named pipe
-on Windows.
-
-When connecting to the server (via named pipe or by starting it in ``--debug``
-mode), the server will reply with a hello message::
-
- [== "CMake Server" ==[
- {"supportedProtocolVersions":[{"major":1,"minor":0}],"type":"hello"}
- ]== "CMake Server" ==]
-
-Messages sent to and from the process are wrapped in magic strings::
-
- [== "CMake Server" ==[
- {
- ... some JSON message ...
- }
- ]== "CMake Server" ==]
-
-The server is now ready to accept further requests via the named pipe
-or stdin.
-
-
-Debugging
-=========
-
-CMake server mode can be asked to provide statistics on execution times, etc.
-or to dump a copy of the response into a file. This is done passing a "debug"
-JSON object as a child of the request.
-
-The debug object supports the "showStats" key, which takes a boolean and makes
-the server mode return a "zzzDebug" object with stats as part of its response.
-"dumpToFile" takes a string value and will cause the cmake server to copy
-the response into the given filename.
-
-This is a response from the cmake server with "showStats" set to true::
-
- [== "CMake Server" ==[
- {
- "cookie":"",
- "errorMessage":"Waiting for type \"handshake\".",
- "inReplyTo":"unknown",
- "type":"error",
- "zzzDebug": {
- "dumpFile":"/tmp/error.txt",
- "jsonSerialization":0.011016,
- "size":111,
- "totalTime":0.025995
- }
- }
- ]== "CMake Server" ==]
-
-The server has made a copy of this response into the file /tmp/error.txt and
-took 0.011 seconds to turn the JSON response into a string, and it took 0.025
-seconds to process the request in total. The reply has a size of 111 bytes.
-
-
-Protocol API
-============
-
-
-General Message Layout
-----------------------
-
-All messages need to have a "type" value, which identifies the type of
-message that is passed back or forth. E.g. the initial message sent by the
-server is of type "hello". Messages without a type will generate an response
-of type "error".
-
-All requests sent to the server may contain a "cookie" value. This value
-will he handed back unchanged in all responses triggered by the request.
-
-All responses will contain a value "inReplyTo", which may be empty in
-case of parse errors, but will contain the type of the request message
-in all other cases.
-
-
-Type "reply"
-^^^^^^^^^^^^
-
-This type is used by the server to reply to requests.
-
-The message may -- depending on the type of the original request --
-contain values.
-
-Example::
-
- [== "CMake Server" ==[
- {"cookie":"zimtstern","inReplyTo":"handshake","type":"reply"}
- ]== "CMake Server" ==]
-
-
-Type "error"
-^^^^^^^^^^^^
-
-This type is used to return an error condition to the client. It will
-contain an "errorMessage".
-
-Example::
-
- [== "CMake Server" ==[
- {"cookie":"","errorMessage":"Protocol version not supported.","inReplyTo":"handshake","type":"error"}
- ]== "CMake Server" ==]
-
-
-Type "progress"
-^^^^^^^^^^^^^^^
-
-When the server is busy for a long time, it is polite to send back replies of
-type "progress" to the client. These will contain a "progressMessage" with a
-string describing the action currently taking place as well as
-"progressMinimum", "progressMaximum" and "progressCurrent" with integer values
-describing the range of progress.
-
-Messages of type "progress" will be followed by more "progress" messages or with
-a message of type "reply" or "error" that complete the request.
-
-"progress" messages may not be emitted after the "reply" or "error" message for
-the request that triggered the responses was delivered.
-
-
-Type "message"
-^^^^^^^^^^^^^^
-
-A message is triggered when the server processes a request and produces some
-form of output that should be displayed to the user. A Message has a "message"
-with the actual text to display as well as a "title" with a suggested dialog
-box title.
-
-Example::
-
- [== "CMake Server" ==[
- {"cookie":"","message":"Something happened.","title":"Title Text","inReplyTo":"handshake","type":"message"}
- ]== "CMake Server" ==]
-
-
-Type "signal"
-^^^^^^^^^^^^^
-
-The server can send signals when it detects changes in the system state. Signals
-are of type "signal", have an empty "cookie" and "inReplyTo" field and always
-have a "name" set to show which signal was sent.
-
-
-Specific Signals
-----------------
-
-The cmake server may sent signals with the following names:
-
-"dirty" Signal
-^^^^^^^^^^^^^^
-
-The "dirty" signal is sent whenever the server determines that the configuration
-of the project is no longer up-to-date. This happens when any of the files that have
-an influence on the build system is changed.
-
-The "dirty" signal may look like this::
-
- [== "CMake Server" ==[
- {
- "cookie":"",
- "inReplyTo":"",
- "name":"dirty",
- "type":"signal"}
- ]== "CMake Server" ==]
-
-
-"fileChange" Signal
-^^^^^^^^^^^^^^^^^^^
-
-The "fileChange" signal is sent whenever a watched file is changed. It contains
-the "path" that has changed and a list of "properties" with the kind of change
-that was detected. Possible changes are "change" and "rename".
-
-The "fileChange" signal looks like this::
-
- [== "CMake Server" ==[
- {
- "cookie":"",
- "inReplyTo":"",
- "name":"fileChange",
- "path":"/absolute/CMakeLists.txt",
- "properties":["change"],
- "type":"signal"}
- ]== "CMake Server" ==]
-
-
-Specific Message Types
-----------------------
-
-
-Type "hello"
-^^^^^^^^^^^^
-
-The initial message send by the cmake server on startup is of type "hello".
-This is the only message ever sent by the server that is not of type "reply",
-"progress" or "error".
-
-It will contain "supportedProtocolVersions" with an array of server protocol
-versions supported by the cmake server. These are JSON objects with "major" and
-"minor" keys containing non-negative integer values. Some versions may be marked
-as experimental. These will contain the "isExperimental" key set to true. Enabling
-these requires a special command line argument when starting the cmake server mode.
-
-Within a "major" version all "minor" versions are fully backwards compatible.
-New "minor" versions may introduce functionality in such a way that existing
-clients of the same "major" version will continue to work, provided they
-ignore keys in the output that they do not know about.
-
-Example::
-
- [== "CMake Server" ==[
- {"supportedProtocolVersions":[{"major":0,"minor":1}],"type":"hello"}
- ]== "CMake Server" ==]
-
-
-Type "handshake"
-^^^^^^^^^^^^^^^^
-
-The first request that the client may send to the server is of type "handshake".
-
-This request needs to pass one of the "supportedProtocolVersions" of the "hello"
-type response received earlier back to the server in the "protocolVersion" field.
-Giving the "major" version of the requested protocol version will make the server
-use the latest minor version of that protocol. Use this if you do not explicitly
-need to depend on a specific minor version.
-
-Protocol version 1.0 requires the following attributes to be set:
-
- * "sourceDirectory" with a path to the sources
- * "buildDirectory" with a path to the build directory
- * "generator" with the generator name
- * "extraGenerator" (optional!) with the extra generator to be used
- * "platform" with the generator platform (if supported by the generator)
- * "toolset" with the generator toolset (if supported by the generator)
-
-Protocol version 1.2 makes all but the build directory optional, provided
-there is a valid cache in the build directory that contains all the other
-information already.
-
-Example::
-
- [== "CMake Server" ==[
- {"cookie":"zimtstern","type":"handshake","protocolVersion":{"major":0},
- "sourceDirectory":"/home/code/cmake", "buildDirectory":"/tmp/testbuild",
- "generator":"Ninja"}
- ]== "CMake Server" ==]
-
-which will result in a response type "reply"::
-
- [== "CMake Server" ==[
- {"cookie":"zimtstern","inReplyTo":"handshake","type":"reply"}
- ]== "CMake Server" ==]
-
-indicating that the server is ready for action.
-
-
-Type "globalSettings"
-^^^^^^^^^^^^^^^^^^^^^
-
-This request can be sent after the initial handshake. It will return a
-JSON structure with information on cmake state.
-
-Example::
-
- [== "CMake Server" ==[
- {"type":"globalSettings"}
- ]== "CMake Server" ==]
-
-which will result in a response type "reply"::
-
- [== "CMake Server" ==[
- {
- "buildDirectory": "/tmp/test-build",
- "capabilities": {
- "generators": [
- {
- "extraGenerators": [],
- "name": "Watcom WMake",
- "platformSupport": false,
- "toolsetSupport": false
- },
- <...>
- ],
- "serverMode": false,
- "version": {
- "isDirty": false,
- "major": 3,
- "minor": 6,
- "patch": 20160830,
- "string": "3.6.20160830-gd6abad",
- "suffix": "gd6abad"
- }
- },
- "checkSystemVars": false,
- "cookie": "",
- "extraGenerator": "",
- "generator": "Ninja",
- "debugOutput": false,
- "inReplyTo": "globalSettings",
- "sourceDirectory": "/home/code/cmake",
- "trace": false,
- "traceExpand": false,
- "type": "reply",
- "warnUninitialized": false,
- "warnUnused": false,
- "warnUnusedCli": true
- }
- ]== "CMake Server" ==]
-
-
-Type "setGlobalSettings"
-^^^^^^^^^^^^^^^^^^^^^^^^
-
-This request can be sent to change the global settings attributes. Unknown
-attributes are going to be ignored. Read-only attributes reported by
-"globalSettings" are all capabilities, buildDirectory, generator,
-extraGenerator and sourceDirectory. Any attempt to set these will be ignored,
-too.
-
-All other settings will be changed.
-
-The server will respond with an empty reply message or an error.
-
-Example::
-
- [== "CMake Server" ==[
- {"type":"setGlobalSettings","debugOutput":true}
- ]== "CMake Server" ==]
-
-CMake will reply to this with::
-
- [== "CMake Server" ==[
- {"inReplyTo":"setGlobalSettings","type":"reply"}
- ]== "CMake Server" ==]
-
-
-Type "configure"
-^^^^^^^^^^^^^^^^
-
-This request will configure a project for build.
-
-To configure a build directory already containing cmake files, it is enough to
-set "buildDirectory" via "setGlobalSettings". To create a fresh build directory
-you also need to set "currentGenerator" and "sourceDirectory" via "setGlobalSettings"
-in addition to "buildDirectory".
-
-You may a list of strings to "configure" via the "cacheArguments" key. These
-strings will be interpreted similar to command line arguments related to
-cache handling that are passed to the cmake command line client.
-
-Example::
-
- [== "CMake Server" ==[
- {"type":"configure", "cacheArguments":["-Dsomething=else"]}
- ]== "CMake Server" ==]
-
-CMake will reply like this (after reporting progress for some time)::
-
- [== "CMake Server" ==[
- {"cookie":"","inReplyTo":"configure","type":"reply"}
- ]== "CMake Server" ==]
-
-
-Type "compute"
-^^^^^^^^^^^^^^
-
-This request will generate build system files in the build directory and
-is only available after a project was successfully "configure"d.
-
-Example::
-
- [== "CMake Server" ==[
- {"type":"compute"}
- ]== "CMake Server" ==]
-
-CMake will reply (after reporting progress information)::
-
- [== "CMake Server" ==[
- {"cookie":"","inReplyTo":"compute","type":"reply"}
- ]== "CMake Server" ==]
-
-
-Type "codemodel"
-^^^^^^^^^^^^^^^^
-
-The "codemodel" request can be used after a project was "compute"d successfully.
-
-It will list the complete project structure as it is known to cmake.
-
-The reply will contain a key "configurations", which will contain a list of
-configuration objects. Configuration objects are used to destinquish between
-different configurations the build directory might have enabled. While most
-generators only support one configuration, others might support several.
-
-Each configuration object can have the following keys:
-
-"name"
- contains the name of the configuration. The name may be empty.
-"projects"
- contains a list of project objects, one for each build project.
-
-Project objects define one (sub-)project defined in the cmake build system.
-
-Each project object can have the following keys:
-
-"name"
- contains the (sub-)projects name.
-"minimumCMakeVersion"
- contains the minimum cmake version allowed for this project, null if the
- project doesn't specify one.
-"hasInstallRule"
- true if the project contains any install rules, false otherwise.
-"sourceDirectory"
- contains the current source directory
-"buildDirectory"
- contains the current build directory.
-"targets"
- contains a list of build system target objects.
-
-Target objects define individual build targets for a certain configuration.
-
-Each target object can have the following keys:
-
-"name"
- contains the name of the target.
-"type"
- defines the type of build of the target. Possible values are
- "STATIC_LIBRARY", "MODULE_LIBRARY", "SHARED_LIBRARY", "OBJECT_LIBRARY",
- "EXECUTABLE", "UTILITY" and "INTERFACE_LIBRARY".
-"fullName"
- contains the full name of the build result (incl. extensions, etc.).
-"sourceDirectory"
- contains the current source directory.
-"buildDirectory"
- contains the current build directory.
-"isGeneratorProvided"
- true if the target is auto-created by a generator, false otherwise
-"hasInstallRule"
- true if the target contains any install rules, false otherwise.
-"installPaths"
- full path to the destination directories defined by target install rules.
-"artifacts"
- with a list of build artifacts. The list is sorted with the most
- important artifacts first (e.g. a .DLL file is listed before a
- .PDB file on windows).
-"linkerLanguage"
- contains the language of the linker used to produce the artifact.
-"linkLibraries"
- with a list of libraries to link to. This value is encoded in the
- system's native shell format.
-"linkFlags"
- with a list of flags to pass to the linker. This value is encoded in
- the system's native shell format.
-"linkLanguageFlags"
- with the flags for a compiler using the linkerLanguage. This value is
- encoded in the system's native shell format.
-"frameworkPath"
- with the framework path (on Apple computers). This value is encoded
- in the system's native shell format.
-"linkPath"
- with the link path. This value is encoded in the system's native shell
- format.
-"sysroot"
- with the sysroot path.
-"fileGroups"
- contains the source files making up the target.
-
-FileGroups are used to group sources using similar settings together.
-
-Each fileGroup object may contain the following keys:
-
-"language"
- contains the programming language used by all files in the group.
-"compileFlags"
- with a string containing all the flags passed to the compiler
- when building any of the files in this group. This value is encoded in
- the system's native shell format.
-"includePath"
- with a list of include paths. Each include path is an object
- containing a "path" with the actual include path and "isSystem" with a bool
- value informing whether this is a normal include or a system include. This
- value is encoded in the system's native shell format.
-"defines"
- with a list of defines in the form "SOMEVALUE" or "SOMEVALUE=42". This
- value is encoded in the system's native shell format.
-"sources"
- with a list of source files.
-
-All file paths in the fileGroup are either absolute or relative to the
-sourceDirectory of the target.
-
-Example::
-
- [== "CMake Server" ==[
- {"type":"codemodel"}
- ]== "CMake Server" ==]
-
-CMake will reply::
-
- [== "CMake Server" ==[
- {
- "configurations": [
- {
- "name": "",
- "projects": [
- {
- "buildDirectory": "/tmp/build/Source/CursesDialog/form",
- "name": "CMAKE_FORM",
- "sourceDirectory": "/home/code/src/cmake/Source/CursesDialog/form",
- "targets": [
- {
- "artifacts": [ "/tmp/build/Source/CursesDialog/form/libcmForm.a" ],
- "buildDirectory": "/tmp/build/Source/CursesDialog/form",
- "fileGroups": [
- {
- "compileFlags": " -std=gnu11",
- "defines": [ "CURL_STATICLIB", "LIBARCHIVE_STATIC" ],
- "includePath": [ { "path": "/tmp/build/Utilities" }, <...> ],
- "isGenerated": false,
- "language": "C",
- "sources": [ "fld_arg.c", <...> ]
- }
- ],
- "fullName": "libcmForm.a",
- "linkerLanguage": "C",
- "name": "cmForm",
- "sourceDirectory": "/home/code/src/cmake/Source/CursesDialog/form",
- "type": "STATIC_LIBRARY"
- }
- ]
- },
- <...>
- ]
- }
- ],
- "cookie": "",
- "inReplyTo": "codemodel",
- "type": "reply"
- }
- ]== "CMake Server" ==]
-
-
-Type "ctestInfo"
-^^^^^^^^^^^^^^^^
-
-The "ctestInfo" request can be used after a project was "compute"d successfully.
-
-It will list the complete project test structure as it is known to cmake.
-
-The reply will contain a key "configurations", which will contain a list of
-configuration objects. Configuration objects are used to destinquish between
-different configurations the build directory might have enabled. While most
-generators only support one configuration, others might support several.
-
-Each configuration object can have the following keys:
-
-"name"
- contains the name of the configuration. The name may be empty.
-"projects"
- contains a list of project objects, one for each build project.
-
-Project objects define one (sub-)project defined in the cmake build system.
-
-Each project object can have the following keys:
-
-"name"
- contains the (sub-)projects name.
-"ctestInfo"
- contains a list of test objects.
-
-Each test object can have the following keys:
-
-"ctestName"
- contains the name of the test.
-"ctestCommand"
- contains the test command.
-"properties"
- contains a list of test property objects.
-
-Each test property object can have the following keys:
-
-"key"
- contains the test property key.
-"value"
- contains the test property value.
-
-
-Type "cmakeInputs"
-^^^^^^^^^^^^^^^^^^
-
-The "cmakeInputs" requests will report files used by CMake as part
-of the build system itself.
-
-This request is only available after a project was successfully
-"configure"d.
-
-Example::
-
- [== "CMake Server" ==[
- {"type":"cmakeInputs"}
- ]== "CMake Server" ==]
-
-CMake will reply with the following information::
-
- [== "CMake Server" ==[
- {"buildFiles":
- [
- {"isCMake":true,"isTemporary":false,"sources":["/usr/lib/cmake/...", ... ]},
- {"isCMake":false,"isTemporary":false,"sources":["CMakeLists.txt", ...]},
- {"isCMake":false,"isTemporary":true,"sources":["/tmp/build/CMakeFiles/...", ...]}
- ],
- "cmakeRootDirectory":"/usr/lib/cmake",
- "sourceDirectory":"/home/code/src/cmake",
- "cookie":"",
- "inReplyTo":"cmakeInputs",
- "type":"reply"
- }
- ]== "CMake Server" ==]
-
-All file names are either relative to the top level source directory or
-absolute.
-
-The list of files which "isCMake" set to true are part of the cmake installation.
-
-The list of files witch "isTemporary" set to true are part of the build directory
-and will not survive the build directory getting cleaned out.
-
-
-Type "cache"
-^^^^^^^^^^^^
-
-The "cache" request will list the cached configuration values.
-
-Example::
-
- [== "CMake Server" ==[
- {"type":"cache"}
- ]== "CMake Server" ==]
-
-CMake will respond with the following output::
-
- [== "CMake Server" ==[
- {
- "cookie":"","inReplyTo":"cache","type":"reply",
- "cache":
- [
- {
- "key":"SOMEVALUE",
- "properties":
- {
- "ADVANCED":"1",
- "HELPSTRING":"This is not helpful"
- }
- "type":"STRING",
- "value":"TEST"}
- ]
- }
- ]== "CMake Server" ==]
-
-The output can be limited to a list of keys by passing an array of key names
-to the "keys" optional field of the "cache" request.
-
-
-Type "fileSystemWatchers"
-^^^^^^^^^^^^^^^^^^^^^^^^^
-
-The server can watch the filesystem for changes. The "fileSystemWatchers"
-command will report on the files and directories watched.
-
-Example::
-
- [== "CMake Server" ==[
- {"type":"fileSystemWatchers"}
- ]== "CMake Server" ==]
-
-CMake will respond with the following output::
-
- [== "CMake Server" ==[
- {
- "cookie":"","inReplyTo":"fileSystemWatchers","type":"reply",
- "watchedFiles": [ "/absolute/path" ],
- "watchedDirectories": [ "/absolute" ]
- }
- ]== "CMake Server" ==]
+The :manual:`cmake(1)` server mode has been removed since CMake 3.20.
+Clients should use the :manual:`cmake-file-api(7)` instead.
diff --git a/Help/manual/cmake-toolchains.7.rst b/Help/manual/cmake-toolchains.7.rst
index 88cddf642..1ededee18 100644
--- a/Help/manual/cmake-toolchains.7.rst
+++ b/Help/manual/cmake-toolchains.7.rst
@@ -359,6 +359,10 @@ CMake uses the following steps to select one of the environments:
* Else, an error diagnostic will be issued that neither the NDK or
Standalone Toolchain can be found.
+.. versionadded:: 3.20
+ If an Android NDK is selected, its version number is reported
+ in the :variable:`CMAKE_ANDROID_NDK_VERSION` variable.
+
.. _`Cross Compiling for Android with the NDK`:
Cross Compiling for Android with the NDK
@@ -386,7 +390,8 @@ Configure use of an Android NDK with the following variables:
:variable:`CMAKE_ANDROID_ARCH_ABI`
Set to the Android ABI (architecture). If not specified, this
- variable will default to ``armeabi``.
+ variable will default to the first supported ABI in the list of
+ ``armeabi``, ``armeabi-v7a`` and ``arm64-v8a``.
The :variable:`CMAKE_ANDROID_ARCH` variable will be computed
from ``CMAKE_ANDROID_ARCH_ABI`` automatically.
Also see the :variable:`CMAKE_ANDROID_ARM_MODE` and
@@ -394,7 +399,6 @@ Configure use of an Android NDK with the following variables:
:variable:`CMAKE_ANDROID_NDK`
Set to the absolute path to the Android NDK root directory.
- A ``${CMAKE_ANDROID_NDK}/platforms`` directory must exist.
If not specified, a default for this variable will be chosen
as specified :ref:`above <Cross Compiling for Android>`.
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index 56239ac73..4317dd407 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -278,6 +278,7 @@ Variables that Describe the System
/variable/ANDROID
/variable/APPLE
/variable/BORLAND
+ /variable/CMAKE_ANDROID_NDK_VERSION
/variable/CMAKE_CL_64
/variable/CMAKE_COMPILER_2005
/variable/CMAKE_HOST_APPLE
@@ -336,6 +337,7 @@ Variables that Control the Build
/variable/CMAKE_ANDROID_ARM_MODE
/variable/CMAKE_ANDROID_ARM_NEON
/variable/CMAKE_ANDROID_ASSETS_DIRECTORIES
+ /variable/CMAKE_ANDROID_EXCEPTIONS
/variable/CMAKE_ANDROID_GUI
/variable/CMAKE_ANDROID_JAR_DEPENDENCIES
/variable/CMAKE_ANDROID_JAR_DIRECTORIES
@@ -349,6 +351,7 @@ Variables that Control the Build
/variable/CMAKE_ANDROID_PROCESS_MAX
/variable/CMAKE_ANDROID_PROGUARD
/variable/CMAKE_ANDROID_PROGUARD_CONFIG_PATH
+ /variable/CMAKE_ANDROID_RTTI
/variable/CMAKE_ANDROID_SECURE_PROPS_PATH
/variable/CMAKE_ANDROID_SKIP_ANT_STEP
/variable/CMAKE_ANDROID_STANDALONE_TOOLCHAIN
@@ -386,6 +389,7 @@ Variables that Control the Build
/variable/CMAKE_DEFAULT_BUILD_TYPE
/variable/CMAKE_DEFAULT_CONFIGS
/variable/CMAKE_DISABLE_PRECOMPILE_HEADERS
+ /variable/CMAKE_DEPENDS_USE_COMPILER
/variable/CMAKE_ENABLE_EXPORTS
/variable/CMAKE_EXE_LINKER_FLAGS
/variable/CMAKE_EXE_LINKER_FLAGS_CONFIG
@@ -467,6 +471,7 @@ Variables that Control the Build
/variable/CMAKE_TRY_COMPILE_TARGET_TYPE
/variable/CMAKE_UNITY_BUILD
/variable/CMAKE_UNITY_BUILD_BATCH_SIZE
+ /variable/CMAKE_UNITY_BUILD_UNIQUE_ID
/variable/CMAKE_USE_RELATIVE_PATHS
/variable/CMAKE_VISIBILITY_INLINES_HIDDEN
/variable/CMAKE_VS_GLOBALS
@@ -523,6 +528,7 @@ Variables for Languages
/variable/CMAKE_LANG_ARCHIVE_APPEND
/variable/CMAKE_LANG_ARCHIVE_CREATE
/variable/CMAKE_LANG_ARCHIVE_FINISH
+ /variable/CMAKE_LANG_BYTE_ORDER
/variable/CMAKE_LANG_COMPILER
/variable/CMAKE_LANG_COMPILER_EXTERNAL_TOOLCHAIN
/variable/CMAKE_LANG_COMPILER_ID
diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst
index 921f5c424..157ea5f9d 100644
--- a/Help/manual/cmake.1.rst
+++ b/Help/manual/cmake.1.rst
@@ -377,12 +377,13 @@ Options
about:tracing tab of Google Chrome or using a plugin for a tool like Trace
Compass.
-``--preset=<preset>``
+``--preset <preset>``, ``--preset=<preset>``
Reads a :manual:`preset <cmake-presets(7)>` from
``<path-to-source>/CMakePresets.json`` and
``<path-to-source>/CMakeUserPresets.json``. The preset specifies the
generator and the build directory, and optionally a list of variables and
- other arguments to pass to CMake. The :manual:`CMake GUI <cmake-gui(1)>` can
+ other arguments to pass to CMake. The current working directory must contain
+ CMake preset files. The :manual:`CMake GUI <cmake-gui(1)>` can
also recognize ``CMakePresets.json`` and ``CMakeUserPresets.json`` files. For
full details on these files, see :manual:`cmake-presets(7)`.
@@ -392,6 +393,10 @@ Options
a variable called ``MYVAR`` to ``1``, but the user sets it to ``2`` with a
``-D`` argument, the value ``2`` is preferred.
+``--list-presets, --list-presets=<[configure | build | test | all]>``
+ Lists the available presets. If no option is specified only configure presets
+ will be listed. The current working directory must contain CMake preset files.
+
.. _`Build Tool Mode`:
Build a Project
@@ -402,13 +407,24 @@ project binary tree:
.. code-block:: shell
- cmake --build <dir> [<options>] [-- <build-tool-options>]
+ cmake --build [<dir> | --preset <preset>] [<options>] [-- <build-tool-options>]
This abstracts a native build tool's command-line interface with the
following options:
``--build <dir>``
- Project binary directory to be built. This is required and must be first.
+ Project binary directory to be built. This is required (unless a preset
+ is specified) and must be first.
+
+``--preset <preset>``, ``--preset=<preset>``
+ Use a build preset to specify build options. The project binary directory
+ is inferred from the ``configurePreset`` key. The current working directory
+ must contain CMake preset files.
+ See :manual:`preset <cmake-presets(7)>` for more details.
+
+``--list-presets``
+ Lists the available build presets. The current working directory must
+ contain CMake preset files.
``--parallel [<jobs>], -j [<jobs>]``
The maximum number of concurrent processes to use when building.
@@ -580,6 +596,7 @@ Available commands are:
``serverMode``
``true`` if cmake supports server-mode and ``false`` otherwise.
+ Always false since CMake 3.20.
``cat <files>...``
Concatenate files and print on the standard output.
diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst
index 00df24b38..175359d6c 100644
--- a/Help/manual/ctest.1.rst
+++ b/Help/manual/ctest.1.rst
@@ -25,9 +25,21 @@ CMake-generated build trees created for projects that use the
:command:`enable_testing` and :command:`add_test` commands have testing support.
This program will run the tests and report results.
+.. _`CTest Options`:
+
Options
=======
+``--preset <preset>``, ``--preset=<preset>``
+ Use a test preset to specify test options. The project binary directory
+ is inferred from the ``configurePreset`` key. The current working directory
+ must contain CMake preset files.
+ See :manual:`preset <cmake-presets(7)>` for more details.
+
+``--list-presets``
+ Lists the available test presets. The current working directory must contain
+ CMake preset files.
+
``-C <cfg>, --build-config <cfg>``
Choose configuration to test.
@@ -324,6 +336,9 @@ Options
``--build-and-test``
See `Build and Test Mode`_.
+``--test-dir <dir>``
+Specify the directory in which to look for tests.
+
``--test-output-size-passed <size>``
Limit the output for passed tests to ``<size>`` bytes.
diff --git a/Help/manual/presets/example.json b/Help/manual/presets/example.json
index d3b6f4a6a..dfc2910a2 100644
--- a/Help/manual/presets/example.json
+++ b/Help/manual/presets/example.json
@@ -1,8 +1,8 @@
{
- "version": 1,
+ "version": 2,
"cmakeMinimumRequired": {
"major": 3,
- "minor": 19,
+ "minor": 20,
"patch": 0
},
"configurePresets": [
@@ -37,6 +37,20 @@
"generator": "Ninja Multi-Config"
}
],
+ "buildPresets": [
+ {
+ "name": "default",
+ "configurePreset": "default"
+ }
+ ],
+ "testPresets": [
+ {
+ "name": "default",
+ "configurePreset": "default",
+ "output": {"outputOnFailure": true},
+ "execution": {"noTestsAction": "error", "stopOnFailure": true}
+ }
+ ],
"vendor": {
"example.com/ExampleIDE/1.0": {
"autoFormat": false
diff --git a/Help/manual/presets/schema.json b/Help/manual/presets/schema.json
index 57b063ea8..f8faf3dd7 100644
--- a/Help/manual/presets/schema.json
+++ b/Help/manual/presets/schema.json
@@ -2,13 +2,38 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"description": "The presets specify the generator and the build directory, and optionally a list of variables and other arguments to pass to CMake.",
- "properties": {
- "version": {
- "type": "integer",
- "description": "A required integer representing the version of the JSON schema. Currently, the only supported version is 1.",
- "minimum": 1,
- "maximum": 1
+ "oneOf": [
+ {
+ "properties": {
+ "version": {
+ "const": 1,
+ "description": "A required integer representing the version of the JSON schema."
+ },
+ "cmakeMinimumRequired": { "$ref": "#/definitions/cmakeMinimumRequired"},
+ "vendor": { "$ref": "#/definitions/vendor" },
+ "configurePresets": { "$ref": "#/definitions/configurePresets"}
+ },
+ "additionalProperties": false
},
+ {
+ "properties": {
+ "version": {
+ "const": 2,
+ "description": "A required integer representing the version of the JSON schema."
+ },
+ "cmakeMinimumRequired": { "$ref": "#/definitions/cmakeMinimumRequired"},
+ "vendor": { "$ref": "#/definitions/vendor" },
+ "configurePresets": { "$ref": "#/definitions/configurePresets"},
+ "buildPresets": { "$ref": "#/definitions/buildPresets"},
+ "testPresets": { "$ref": "#/definitions/testPresets"}
+ },
+ "additionalProperties": false
+ }
+ ],
+ "required": [
+ "version"
+ ],
+ "definitions": {
"cmakeMinimumRequired": {
"type": "object",
"description": "An optional object representing the minimum version of CMake needed to build this project.",
@@ -47,7 +72,7 @@
},
"hidden": {
"type": "boolean",
- "description": "An optional boolean specifying whether or not a preset should be hidden. If a preset is hidden, it cannot be used in the --preset= argument, will not show up in the CMake GUI, and does not have to have a valid generator or binaryDir, even from inheritance. hidden presets are intended to be used as a base for other presets to inherit via the inherits field."
+ "description": "An optional boolean specifying whether or not a preset should be hidden. If a preset is hidden, it cannot be used in the --preset= argument, will not show up in the CMake GUI, and does not have to have a valid generator or binaryDir, even from inheritance. Hidden presets are intended to be used as a base for other presets to inherit via the inherits field."
},
"inherits": {
"anyOf": [
@@ -58,7 +83,7 @@
},
{
"type": "array",
- "description": "An optional array of strings representing the names of presets to inherit from. The preset will inherit all of the fields from the inherits presets by default (except name, hidden, inherits, description, and longDescription), but can override them as desired. If multiple inherits presets provide conflicting values for the same field, the earlier preset in the inherits list will be preferred. Presets in CMakePresets.json may not inherit from presets in CMakeUserPresets.json.",
+ "description": "An optional array of strings representing the names of presets to inherit from. The preset will inherit all of the fields from the inherits presets by default (except name, hidden, inherits, description, and displayName), but can override them as desired. If multiple inherits presets provide conflicting values for the same field, the earlier preset in the inherits list will be preferred. Presets in CMakePresets.json may not inherit from presets in CMakeUserPresets.json.",
"items": {
"type": "string",
"description": "An optional string representing the name of the preset to inherit from.",
@@ -283,10 +308,444 @@
],
"additionalProperties": false
}
+ },
+ "buildPresets": {
+ "type": "array",
+ "description": "An optional array of build preset objects. Used to specify arguments to cmake --build. Available in version 2 and higher.",
+ "items": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "A required string representing the machine-friendly name of the preset. This identifier is used in the --preset argument. There must not be two presets (configure, build, or test) in the union of CMakePresets.json and CMakeUserPresets.json in the same directory with the same name.",
+ "minLength": 1
+ },
+ "hidden": {
+ "type": "boolean",
+ "description": "An optional boolean specifying whether or not a preset should be hidden. If a preset is hidden, it cannot be used in the --preset argument, will not show up in the CMake GUI, and does not have to have a valid configurePreset, even from inheritance. Hidden presets are intended to be used as a base for other presets to inherit via the inherits field."
+ },
+ "inherits": {
+ "anyOf": [
+ {
+ "type": "string",
+ "description": "An optional string representing the name of the build preset to inherit from.",
+ "minLength": 1
+ },
+ {
+ "type": "array",
+ "description": "An optional array of strings representing the names of build presets to inherit from. The preset will inherit all of the fields from the inherits presets by default (except name, hidden, inherits, description, and displayName), but can override them as desired. If multiple inherits presets provide conflicting values for the same field, the earlier preset in the inherits list will be preferred. Presets in CMakePresets.json may not inherit from presets in CMakeUserPresets.json.",
+ "items": {
+ "type": "string",
+ "description": "An optional string representing the name of the preset to inherit from.",
+ "minLength": 1
+ }
+ }
+ ]
+ },
+ "configurePreset": {
+ "type": "string",
+ "description": "An optional string specifying the name of a configure preset to associate with this build preset. If configurePreset is not specified, it must be inherited from the inherits preset (unless this preset is hidden). The build tree directory is inferred from the configure preset.",
+ "minLength": 1
+ },
+ "vendor": {
+ "type": "object",
+ "description": "An optional map containing vendor-specific information. CMake does not interpret the contents of this field except to verify that it is a map if it does exist. However, it should follow the same conventions as the root-level vendor field. If vendors use their own per-preset vendor field, they should implement inheritance in a sensible manner when appropriate.",
+ "properties": {}
+ },
+ "displayName": {
+ "type": "string",
+ "description": "An optional string with a human-friendly name of the preset."
+ },
+ "description": {
+ "type": "string",
+ "description": "An optional string with a human-friendly description of the preset."
+ },
+ "inheritConfigureEnvironment": {
+ "type": "boolean",
+ "description": "An optional boolean that defaults to true. If true, the environment variables from the associated configure preset are inherited after all inherited build preset environments, but before environment variables explicitly specified in this build preset."
+ },
+ "environment": {
+ "type": "object",
+ "description": "An optional map of environment variables. The key is the variable name (which must not be an empty string). Each variable is set regardless of whether or not a value was given to it by the process's environment. This field supports macro expansion, and environment variables in this map may reference each other, and may be listed in any order, as long as such references do not cause a cycle (for example,if ENV_1 is $env{ENV_2}, ENV_2 may not be $env{ENV_1}.) Environment variables are inherited through the inherits field, and the preset's environment will be the union of its own environment and the environment from all its parents. If multiple presets in this union define the same variable, the standard rules of inherits are applied. Setting a variable to null causes it to not be set, even if a value was inherited from another preset.",
+ "properties": {},
+ "additionalProperties": {
+ "anyOf": [
+ {
+ "type": "null",
+ "description": "Setting a variable to null causes it to not be set, even if a value was inherited from another preset."
+ },
+ {
+ "type": "string",
+ "description": "A string representing the value of the variable."
+ }
+ ]
+ },
+ "propertyNames": {
+ "pattern": "^.+$"
+ }
+ },
+ "jobs": {
+ "type": "integer",
+ "description": "An optional integer. Equivalent to passing --parallel or -j on the command line."
+ },
+ "targets": {
+ "anyOf": [
+ {
+ "type": "string",
+ "description": "An optional string. Equivalent to passing --target or -t on the command line. Vendors may ignore the targets property or hide build presets that explicitly specify targets."
+ },
+ {
+ "type": "array",
+ "description": "An optional array of strings. Equivalent to passing --target or -t on the command line. Vendors may ignore the targets property or hide build presets that explicitly specify targets.",
+ "items": {
+ "type": "string",
+ "description": "An optional string. Equivalent to passing --target or -t on the command line. Vendors may ignore the targets property or hide build presets that explicitly specify targets."
+ }
+ }
+ ]
+ },
+ "configuration": {
+ "type": "string",
+ "description": "An optional string. Equivalent to passing --config on the command line."
+ },
+ "cleanFirst": {
+ "type": "boolean",
+ "description": "An optional boolean. If true, equivalent to passing --clean-first on the command line."
+ },
+ "verbose": {
+ "type": "boolean",
+ "description": "An optional boolean. If true, equivalent to passing --verbose on the command line."
+ },
+ "nativeToolOptions": {
+ "type": "array",
+ "description": "An optional array of strings. Equivalent to passing options after -- on the command line.",
+ "items": {
+ "type": "string",
+ "description": "An optional string representing an option to pass after -- on the command line."
+ }
+ }
+ },
+ "required": [
+ "name"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "testPresets": {
+ "type": "array",
+ "description": "An optional array of test preset objects. Used to specify arguments to ctest. Available in version 2 and higher.",
+ "items": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "A required string representing the machine-friendly name of the preset. This identifier is used in the --preset argument. There must not be two presets (configure, build, or test) in the union of CMakePresets.json and CMakeUserPresets.json in the same directory with the same name.",
+ "minLength": 1
+ },
+ "hidden": {
+ "type": "boolean",
+ "description": "An optional boolean specifying whether or not a preset should be hidden. If a preset is hidden, it cannot be used in the --preset argument, will not show up in the CMake GUI, and does not have to have a valid configurePreset, even from inheritance. Hidden presets are intended to be used as a base for other presets to inherit via the inherits field."
+ },
+ "inherits": {
+ "anyOf": [
+ {
+ "type": "string",
+ "description": "An optional string representing the name of the test preset to inherit from.",
+ "minLength": 1
+ },
+ {
+ "type": "array",
+ "description": "An optional array of strings representing the names of test presets to inherit from. The preset will inherit all of the fields from the inherits presets by default (except name, hidden, inherits, description, and displayName), but can override them as desired. If multiple inherits presets provide conflicting values for the same field, the earlier preset in the inherits list will be preferred. Presets in CMakePresets.json may not inherit from presets in CMakeUserPresets.json.",
+ "items": {
+ "type": "string",
+ "description": "An optional string representing the name of the preset to inherit from.",
+ "minLength": 1
+ }
+ }
+ ]
+ },
+ "configurePreset": {
+ "type": "string",
+ "description": "An optional string specifying the name of a configure preset to associate with this test preset. If configurePreset is not specified, it must be inherited from the inherits preset (unless this preset is hidden). The build tree directory is inferred from the configure preset.",
+ "minLength": 1
+ },
+ "vendor": {
+ "type": "object",
+ "description": "An optional map containing vendor-specific information. CMake does not interpret the contents of this field except to verify that it is a map if it does exist. However, it should follow the same conventions as the root-level vendor field. If vendors use their own per-preset vendor field, they should implement inheritance in a sensible manner when appropriate.",
+ "properties": {}
+ },
+ "displayName": {
+ "type": "string",
+ "description": "An optional string with a human-friendly name of the preset."
+ },
+ "description": {
+ "type": "string",
+ "description": "An optional string with a human-friendly description of the preset."
+ },
+ "inheritConfigureEnvironment": {
+ "type": "boolean",
+ "description": "An optional boolean that defaults to true. If true, the environment variables from the associated configure preset are inherited after all inherited test preset environments, but before environment variables explicitly specified in this test preset."
+ },
+ "environment": {
+ "type": "object",
+ "description": "An optional map of environment variables. The key is the variable name (which must not be an empty string). Each variable is set regardless of whether or not a value was given to it by the process's environment. This field supports macro expansion, and environment variables in this map may reference each other, and may be listed in any order, as long as such references do not cause a cycle (for example,if ENV_1 is $env{ENV_2}, ENV_2 may not be $env{ENV_1}.) Environment variables are inherited through the inherits field, and the preset's environment will be the union of its own environment and the environment from all its parents. If multiple presets in this union define the same variable, the standard rules of inherits are applied. Setting a variable to null causes it to not be set, even if a value was inherited from another preset.",
+ "properties": {},
+ "additionalProperties": {
+ "anyOf": [
+ {
+ "type": "null",
+ "description": "Setting a variable to null causes it to not be set, even if a value was inherited from another preset."
+ },
+ {
+ "type": "string",
+ "description": "A string representing the value of the variable."
+ }
+ ]
+ },
+ "propertyNames": {
+ "pattern": "^.+$"
+ }
+ },
+ "configuration": {
+ "type": "string",
+ "description": "An optional string. Equivalent to passing --build-config on the command line."
+ },
+ "overwriteConfigurationFile": {
+ "type": "array",
+ "description": "An optional array of configuration options to overwrite options specified in the CTest configuration file. Equivalent to passing ``--overwrite`` for each value in the array.",
+ "items": {
+ "type": "string",
+ "description": "An option written as a key-value pair in the form \"key=value\"."
+ }
+ },
+ "output": {
+ "type": "object",
+ "description": "An optional object specifying output options.",
+ "properties": {
+ "shortProgress": {
+ "type": "boolean",
+ "description": "An optional boolean. If true, equivalent to passing --progress on the command line."
+ },
+ "verbosity": {
+ "type": "string",
+ "description": "An optional string specifying verbosity level. Valid values are \"default\" (equivalent to passing no verbosity flags on the command line), \"verbose\" (equivalent to passing --verbose on the command line), and \"extra\" (equivalent to passing --extra-verbose on the command line).",
+ "enum": [
+ "default", "verbose", "extra"
+ ]
+ },
+ "debug": {
+ "type": "boolean",
+ "description": "An optional boolean. If true, equivalent to passing --debug on the command line."
+ },
+ "outputOnFailure": {
+ "type": "boolean",
+ "description": "An optional boolean. If true, equivalent to passing --output-on-failure on the command line."
+ },
+ "quiet": {
+ "type": "boolean",
+ "description": "An optional boolean. If true, equivalent to passing --quiet on the command line."
+ },
+ "outputLogFile": {
+ "type": "string",
+ "description": "An optional string specifying a path to a log file. Equivalent to passing --output-log on the command line."
+ },
+ "labelSummary": {
+ "type": "boolean",
+ "description": "An optional boolean. If false, equivalent to passing --no-label-summary on the command line."
+ },
+ "subprojectSummary": {
+ "type": "boolean",
+ "description": "An optional boolean. If false, equivalent to passing --no-subproject-summary on the command line."
+ },
+ "maxPassedTestOutputSize": {
+ "type": "integer",
+ "description": "An optional integer specifying the maximum output for passed tests in bytes. Equivalent to passing --test-output-size-passed on the command line."
+ },
+ "maxFailedTestOutputSize": {
+ "type": "integer",
+ "description": "An optional integer specifying the maximum output for failed tests in bytes. Equivalent to passing --test-output-size-failed on the command line."
+ },
+ "maxTestNameWidth": {
+ "type": "integer",
+ "description": "An optional integer specifying the maximum width of a test name to output. Equivalent to passing --max-width on the command line."
+ }
+ },
+ "additionalProperties": false
+ },
+ "filter": {
+ "type": "object",
+ "description": "An optional object specifying how to filter the tests to run.",
+ "properties": {
+ "include": {
+ "type": "object",
+ "description": "An optional object specifying which tests to include.",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "An optional string specifying a regex for test names. Equivalent to passing --tests-regex on the command line."
+ },
+ "label": {
+ "type": "string",
+ "description": "An optional string specifying a regex for test labels. Equivalent to passing --label-regex on the command line."
+ },
+ "index": {
+ "anyOf": [
+ {
+ "type": "object",
+ "description": "An optional object specifying tests to include by test index.",
+ "properties": {
+ "start": {
+ "type": "integer",
+ "description": "An optional integer specifying a test index to start testing at."
+ },
+ "end": {
+ "type": "integer",
+ "description": "An optional integer specifying a test index to stop testing at."
+ },
+ "stride": {
+ "type": "integer",
+ "description": "An optional integer specifying the increment."
+ },
+ "specificTests": {
+ "type": "array",
+ "description": "An optional array of integers specifying specific test indices to run.",
+ "items": {
+ "type": "integer",
+ "description": "An integer specifying the test to run by index."
+ }
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "type": "string",
+ "description": "An optional string specifying a file with the command line syntax for --tests-information."
+ }
+ ]
+ },
+ "useUnion": {
+ "type": "boolean",
+ "description": "An optional boolean. Equivalent to passing --union on the command line."
+ }
+ },
+ "additionalProperties": false
+ },
+ "exclude": {
+ "type": "object",
+ "description": "An optional object specifying which tests to exclude.",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "An optional string specifying a regex for test names. Equivalent to passing --exclude-regex on the command line."
+ },
+ "label": {
+ "type": "string",
+ "description": "An optional string specifying a regex for test labels. Equivalent to passing --label-exclude on the command line."
+ },
+ "fixtures": {
+ "type": "object",
+ "description": "An optional object specifying which fixtures to exclude from adding tests.",
+ "properties": {
+ "any": {
+ "type": "string",
+ "description": "An optional string specifying a regex for text fixtures to exclude from adding any tests. Equivalent to --fixture-exclude-any on the command line."
+ },
+ "setup": {
+ "type": "string",
+ "description": "An optional string specifying a regex for text fixtures to exclude from adding setup tests. Equivalent to --fixture-exclude-setup on the command line."
+ },
+ "cleanup": {
+ "type": "string",
+ "description": "An optional string specifying a regex for text fixtures to exclude from adding cleanup tests. Equivalent to --fixture-exclude-cleanup on the command line."
+ }
+ },
+ "additionalProperties": false
+ }
+ }
+ }
+ },
+ "additionalProperties": false
+ },
+ "execution": {
+ "type": "object",
+ "description": "An optional object specifying options for test execution.",
+ "properties": {
+ "stopOnFailure": {
+ "type": "boolean",
+ "description": "An optional boolean. If true, equivalent to passing --stop-on-failure on the command line."
+ },
+ "enableFailover": {
+ "type": "boolean",
+ "description": "An optional boolean. If true, equivalent to passing -F on the command line."
+ },
+ "jobs": {
+ "type": "integer",
+ "description": "An optional integer. Equivalent to passing --parallel on the command line."
+ },
+ "resourceSpecFile": {
+ "type": "string",
+ "description": "An optional string. Equivalent to passing --resource-spec-file on the command line."
+ },
+ "testLoad": {
+ "type": "integer",
+ "description": "An optional integer. Equivalent to passing --test-load on the command line."
+ },
+ "showOnly": {
+ "type": "string",
+ "description": "An optional string. Equivalent to passing --show-only on the command line. Value must be \"human\" or \"json-v1\".",
+ "enum": [
+ "human", "json-v1"
+ ]
+ },
+ "repeat": {
+ "type": "object",
+ "description": "An optional object specifying how to repeat tests. Equivalent to passing --repeat on the command line.",
+ "properties": {
+ "mode": {
+ "type": "string",
+ "description": "A required string. Must be one of the following values: \"until-fail\", \"until-pass\", or \"after-timeout\".",
+ "enum": [
+ "until-fail", "until-pass", "after-timeout"
+ ]
+ },
+ "count": {
+ "type": "integer",
+ "description": "A required integer."
+ }
+ },
+ "required": [
+ "mode", "count"
+ ],
+ "additionalProperties": false
+ },
+ "interactiveDebugging": {
+ "type": "boolean",
+ "description": "An optional boolean. If true, equivalent to passing --interactive-debug-mode 1 on the command line. If false, equivalent to passing --interactive-debug-mode 0 on the command line."
+ },
+ "scheduleRandom": {
+ "type": "boolean",
+ "description": "An optional boolean. If true, equivalent to passing --schedule-random on the command line."
+ },
+ "timeout": {
+ "type": "integer",
+ "description": "An optional integer. Equivalent to passing --timeout on the command line."
+ },
+ "noTestsAction": {
+ "type": "string",
+ "description": "An optional string specifying the behavior if no tests are found. Must be one of the following values: \"default\" (equivalent to not passing any value on the command line), \"error\" (equivalent to passing --no-tests=error on the command line), or \"ignore\" (equivalent to passing --no-tests-ignore on the command line).",
+ "enum": [
+ "default", "error", "ignore"
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "name"
+ ],
+ "additionalProperties": false
+ }
}
- },
- "required": [
- "version"
- ],
- "additionalProperties": false
+ }
}
diff --git a/Help/module/UseJavaClassFilelist.rst b/Help/module/UseJavaClassFilelist.rst
index b9cd4769e..29949bef8 100644
--- a/Help/module/UseJavaClassFilelist.rst
+++ b/Help/module/UseJavaClassFilelist.rst
@@ -1 +1,6 @@
-.. cmake-module:: ../../Modules/UseJavaClassFilelist.cmake
+UseJavaClassFilelist
+--------------------
+
+.. versionchanged:: 3.20
+ This module was previously documented by mistake and was never meant for
+ direct inclusion by project code. See the :module:`UseJava` module.
diff --git a/Help/module/UseJavaSymlinks.rst b/Help/module/UseJavaSymlinks.rst
index 2fab8e8dd..1058a68b3 100644
--- a/Help/module/UseJavaSymlinks.rst
+++ b/Help/module/UseJavaSymlinks.rst
@@ -1 +1,6 @@
-.. cmake-module:: ../../Modules/UseJavaSymlinks.cmake
+UseJavaSymlinks
+---------------
+
+.. versionchanged:: 3.20
+ This module was previously documented by mistake and was never meant for
+ direct inclusion by project code. See the :module:`UseJava` module.
diff --git a/Help/policy/CMP0026.rst b/Help/policy/CMP0026.rst
index 3401d4a9a..e08fd54a4 100644
--- a/Help/policy/CMP0026.rst
+++ b/Help/policy/CMP0026.rst
@@ -9,12 +9,12 @@ determine the eventual location of build targets. This relies on the
assumption that all necessary information is available at
configure-time to determine the final location and filename of the
target. However, this property is not fully determined until later at
-generate-time. At generate time, the ``$<TARGET_FILE>`` generator
+generate-time. At generate time, the :genex:`$<TARGET_FILE>` generator
expression can be used to determine the eventual :prop_tgt:`LOCATION` of a target
output.
Code which reads the :prop_tgt:`LOCATION` target property can be ported to
-use the ``$<TARGET_FILE>`` generator expression together with the
+use the :genex:`$<TARGET_FILE>` generator expression together with the
:command:`file(GENERATE)` subcommand to generate a file containing
the target location.
diff --git a/Help/policy/CMP0051.rst b/Help/policy/CMP0051.rst
index 053bc9757..3558909f7 100644
--- a/Help/policy/CMP0051.rst
+++ b/Help/policy/CMP0051.rst
@@ -3,7 +3,7 @@ CMP0051
.. versionadded:: 3.1
-List TARGET_OBJECTS in SOURCES target property.
+List :genex:`TARGET_OBJECTS` in SOURCES target property.
CMake 3.0 and lower did not include the ``TARGET_OBJECTS``
:manual:`generator expression <cmake-generator-expressions(7)>` when
diff --git a/Help/policy/CMP0115.rst b/Help/policy/CMP0115.rst
new file mode 100644
index 000000000..7f82c4326
--- /dev/null
+++ b/Help/policy/CMP0115.rst
@@ -0,0 +1,34 @@
+CMP0115
+-------
+
+.. versionadded:: 3.20
+
+Source file extensions must be explicit.
+
+In CMake 3.19 and below, if a source file could not be found by the name
+specified, it would append a list of known extensions to the name to see if
+the file with the extension could be found. For example, this would allow the
+user to run:
+
+.. code-block:: cmake
+
+ add_executable(exe main)
+
+and put ``main.c`` in the executable without specifying the extension.
+
+Starting in CMake 3.20, CMake prefers all source files to have their extensions
+explicitly listed:
+
+.. code-block:: cmake
+
+ add_executable(exe main.c)
+
+The ``OLD`` behavior for this policy is to implicitly append known extensions
+to source files if they can't be found. The ``NEW`` behavior of this policy is
+to not append known extensions and require them to be explicit.
+
+This policy was introduced in CMake version 3.20. 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/CMP0116.rst b/Help/policy/CMP0116.rst
new file mode 100644
index 000000000..18e5a96d6
--- /dev/null
+++ b/Help/policy/CMP0116.rst
@@ -0,0 +1,41 @@
+CMP0116
+-------
+
+.. versionadded:: 3.20
+
+Ninja generators transform ``DEPFILE`` s from :command:`add_custom_command`.
+
+In CMake 3.19 and below, files given to the ``DEPFILE`` argument of
+:command:`add_custom_command` were passed directly to Ninja's ``depfile``
+variable without any path resolution. This meant that if
+:command:`add_custom_command` was called from a subdirectory (created by
+:command:`add_subdirectory`), the ``DEPFILE`` argument would have to be either
+an absolute path or a path relative to :variable:`CMAKE_BINARY_DIR`, rather
+than :variable:`CMAKE_CURRENT_BINARY_DIR`. In addition, no transformation was
+done on the file listed in ``DEPFILE``, which meant that the paths within the
+``DEPFILE`` had the same restrictions.
+
+Starting with CMake 3.20, the ``DEPFILE`` argument is relative to
+:variable:`CMAKE_CURRENT_BINARY_DIR` (unless it is absolute), and the paths in
+the ``DEPFILE`` are also relative to :variable:`CMAKE_CURRENT_BINARY_DIR`.
+CMake automatically transforms the paths in the ``DEPFILE`` (unless they are
+absolute) after the custom command is run. The file listed in ``DEPFILE`` is
+not modified in any way. Instead, CMake writes the transformation to its own
+internal file, and passes this internal file to Ninja's ``depfile`` variable.
+This transformation happens regardless of whether or not ``DEPFILE`` is
+relative, and regardless of whether or not :command:`add_custom_command` is
+called from a subdirectory.
+
+The ``OLD`` behavior for this policy is to pass the ``DEPFILE`` to Ninja
+unaltered. The ``NEW`` behavior for this policy is to transform the ``DEPFILE``
+after running the custom command. The status of ``CMP0116`` is recorded at the
+time of the custom command's creation, and you can have custom commands in the
+same directory with different values for ``CMP0116`` by setting the policy
+before each custom command.
+
+This policy was introduced in CMake version 3.20. Unlike most policies,
+CMake version |release| does *not* warn by default when this policy is not set
+(unless ``DEPFILE`` is used in a subdirectory) and simply uses ``OLD``
+behavior. See documentation of the
+:variable:`CMAKE_POLICY_WARNING_CMP0116 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
+variable to control the warning.
diff --git a/Help/policy/CMP0117.rst b/Help/policy/CMP0117.rst
new file mode 100644
index 000000000..0c4dd3068
--- /dev/null
+++ b/Help/policy/CMP0117.rst
@@ -0,0 +1,43 @@
+CMP0117
+-------
+
+.. versionadded:: 3.20
+
+MSVC RTTI flag ``/GR`` is not added to
+:variable:`CMAKE_CXX_FLAGS <CMAKE_<LANG>_FLAGS>` by default.
+
+When using MSVC-like compilers in CMake 3.19 and below, the RTTI flag
+``/GR`` is added to :variable:`CMAKE_CXX_FLAGS <CMAKE_<LANG>_FLAGS>` by
+default. This behavior is left from support for MSVC versions from Visual
+Studio 2003 and below that did not enable RTTI by default. It is no longer
+necessary. Furthermore, it is problematic for projects that want to change
+to ``/GR-`` programmatically. In particular, it requires string editing of
+the :variable:`CMAKE_CXX_FLAGS <CMAKE_<LANG>_FLAGS>` variable with knowledge
+of the CMake builtin default so it can be replaced.
+
+CMake 3.20 and above prefer to leave out ``/GR`` from the value of
+:variable:`CMAKE_CXX_FLAGS <CMAKE_<LANG>_FLAGS>` by default.
+
+This policy provides compatibility with projects that have not been updated
+to expect the lack of the ``/GR`` flag. The policy setting takes effect as
+of the first :command:`project` or :command:`enable_language` command that
+initializes :variable:`CMAKE_CXX_FLAGS <CMAKE_<LANG>_FLAGS>`.
+
+.. note::
+
+ Once the policy has taken effect at the top of a project for a given
+ language, that choice must be used throughout the tree for that language.
+ In projects that have nested projects in subdirectories, be sure to
+ convert everything together.
+
+The ``OLD`` behavior for this policy is to place the MSVC ``/GR`` flag in the
+default :variable:`CMAKE_CXX_FLAGS <CMAKE_<LANG>_FLAGS>` cache entry. The
+``NEW`` behavior for this policy is to *not* place the MSVC ``/GR`` flag in
+the default cache entry.
+
+This policy was introduced in CMake version 3.20. 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/CMP0118.rst b/Help/policy/CMP0118.rst
new file mode 100644
index 000000000..aa7e0f7f8
--- /dev/null
+++ b/Help/policy/CMP0118.rst
@@ -0,0 +1,25 @@
+CMP0118
+-------
+
+.. versionadded:: 3.20
+
+The :prop_sf:`GENERATED` source file property is now visible in all directories.
+
+Whether or not a source file is generated is an all-or-nothing global
+property of the source. Consequently, the associated ``GENERATED``
+property is now visible from any directory scope, not only from the scope
+for which it was set.
+
+Additionally, the ``GENERATED`` property may now be set only to boolean
+values, and may not be turned off once turned on.
+
+The ``OLD`` behavior of this policy is to only allow ``GENERATED`` to be
+visible from the directory scope for which it was set. The ``NEW``
+behavior on the other hand allows it to be visible from any scope.
+
+This policy was introduced in CMake version 3.20. 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 with regard
+to visibility of the ``GENERATED`` property. However, CMake does warn
+about setting the ``GENERATED`` property to a non-boolean value.
diff --git a/Help/policy/CMP0119.rst b/Help/policy/CMP0119.rst
new file mode 100644
index 000000000..61c8bdc43
--- /dev/null
+++ b/Help/policy/CMP0119.rst
@@ -0,0 +1,36 @@
+CMP0119
+-------
+
+.. versionadded:: 3.20
+
+:prop_sf:`LANGUAGE` source file property explicitly compiles as specified
+language.
+
+The :prop_sf:`LANGUAGE` source file property is documented to mean that the
+source file is written in the specified language. In CMake 3.19 and below,
+setting this property causes CMake to compile the source file using the
+compiler for the specified language. However, it only passes an explicit
+flag to tell the compiler to treat the source as the specified language
+for MSVC-like, XL, and Embarcadero compilers for the ``CXX`` language.
+CMake 3.20 and above prefer to also explicitly tell the compiler to use
+the specified language using a flag such as ``-x c`` on all compilers
+for which such flags are known.
+
+This policy provides compatibility for projects that have not been updated
+to expect this behavior. For example, some projects were setting the
+``LANGUAGE`` property to ``C`` on assembly-language ``.S`` source files
+in order to compile them using the C compiler. Such projects should be
+updated to use ``enable_language(ASM)``, for which CMake will often choose
+the C compiler as the assembler on relevant platforms anyway.
+
+The ``OLD`` behavior for this policy is to interpret the ``LANGUAGE <LANG>``
+property using its undocumented meaning to "use the ``<LANG>`` compiler".
+The ``NEW`` behavior for this policy is to interpret the ``LANGUAGE <LANG>``
+property using its documented meaning to "compile as a ``<LANG>`` source".
+
+This policy was introduced in CMake version 3.20. 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/CMP0120.rst b/Help/policy/CMP0120.rst
new file mode 100644
index 000000000..9d2f6c973
--- /dev/null
+++ b/Help/policy/CMP0120.rst
@@ -0,0 +1,47 @@
+CMP0120
+-------
+
+.. versionadded:: 3.20
+
+The :module:`WriteCompilerDetectionHeader` module is removed.
+
+CMake versions 3.1 through 3.19 provide this module to generate a
+C++ compatibility layer by re-using information from CMake's table of
+preprocessor checks for :manual:`cmake-compile-features(7)`. However:
+
+* Those granular features have been superseded by meta-features for
+ :ref:`Requiring Language Standards` such as ``cxx_std_11``. Therefore
+ no new granular feature checks will be added and projects will need to
+ use other means to conditionally use new C++ features.
+
+* The module exposes some of CMake's implementation details directly
+ to C++ translation units.
+
+* The module's approach effectively provides a header file with CMake,
+ thus tying the version of the header to the version of CMake.
+ Many projects found that the :module:`WriteCompilerDetectionHeader` was
+ best used by manually generating its header locally with a recent version
+ of CMake and then bundling it with the project source so that it could
+ be used with older CMake versions.
+
+For reasons including the above, CMake 3.20 and above prefer to not
+provide the :module:`WriteCompilerDetectionHeader` module. This policy
+provides compatibility for projects that have not been ported away from
+it. Projects using the module should be updated to stop using it.
+Alternatives include:
+
+* Bundle a copy of the generated header in the project's source.
+* Use a third-party alternative, such as the CC0-licensed `Hedley`_.
+* Drop support for compilers too old to provide the features natively.
+
+The ``OLD`` behavior of this policy is for inclusion of the deprecated
+:module:`WriteCompilerDetectionHeader` module to work. The ``NEW``
+behavior is for inclusion of the module to fail as if it does not exist.
+
+This policy was introduced in CMake version 3.20. 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
+
+.. _`Hedley`: https://nemequ.github.io/hedley/
diff --git a/Help/prop_gbl/CMAKE_CUDA_KNOWN_FEATURES.rst b/Help/prop_gbl/CMAKE_CUDA_KNOWN_FEATURES.rst
index e8e314881..6bbb870f1 100644
--- a/Help/prop_gbl/CMAKE_CUDA_KNOWN_FEATURES.rst
+++ b/Help/prop_gbl/CMAKE_CUDA_KNOWN_FEATURES.rst
@@ -30,3 +30,6 @@ The features known to this version of CMake are:
``cuda_std_20``
Compiler mode is at least CUDA/C++ 20.
+
+``cuda_std_23``
+ Compiler mode is at least CUDA/C++ 23.
diff --git a/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst
index bac32744b..73c0b34ee 100644
--- a/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst
+++ b/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst
@@ -37,6 +37,8 @@ but it does not necessarily imply complete conformance to that standard.
``cxx_std_20``
Compiler mode is at least C++ 20.
+``cxx_std_23``
+ Compiler mode is at least C++ 23.
Low level individual compile features
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/Help/prop_sf/GENERATED.rst b/Help/prop_sf/GENERATED.rst
index 48ff70c7b..6ef458022 100644
--- a/Help/prop_sf/GENERATED.rst
+++ b/Help/prop_sf/GENERATED.rst
@@ -3,6 +3,9 @@ GENERATED
Is this source file generated as part of the build or CMake process.
+.. versionchanged:: 3.20
+ The GENERATED source file property is now visible in all directories.
+
Tells the internal CMake engine that a source file is generated by an outside
process such as another build step, or the execution of CMake itself.
This information is then used to exempt the file from any existence or
@@ -34,3 +37,11 @@ or :prop_tgt:`AUTORCC` functionality, the :prop_gbl:`AUTOGEN_SOURCE_GROUP`,
:prop_gbl:`AUTOMOC_SOURCE_GROUP` and :prop_gbl:`AUTORCC_SOURCE_GROUP` target
properties may influence where the generated sources are grouped in the project's
file lists.
+
+.. note::
+
+ Starting with CMake 3.20 the ``GENERATED`` source file property can be set
+ and retrieved from any directory scope. It is an all-or-nothing property.
+ It also can no longer be removed or unset if it was set to ``TRUE``. Policy
+ :policy:`CMP0118` was introduced to allow supporting the ``OLD`` behavior
+ for some time.
diff --git a/Help/prop_sf/LANGUAGE.rst b/Help/prop_sf/LANGUAGE.rst
index 1dd2554d5..f14c176ca 100644
--- a/Help/prop_sf/LANGUAGE.rst
+++ b/Help/prop_sf/LANGUAGE.rst
@@ -1,7 +1,7 @@
LANGUAGE
--------
-What programming language is the file.
+Specify the programming language in which a source file is written.
A property that can be set to indicate what programming language the
source file is. If it is not set the language is determined based on
@@ -9,3 +9,9 @@ the file extension. Typical values are ``CXX`` (i.e. C++), ``C``,
``CSharp``, ``CUDA``, ``Fortran``, ``ISPC``, and ``ASM``. Setting this
property for a file means this file will be compiled. Do not set this
for headers or files that should not be compiled.
+
+.. versionchanged:: 3.20
+ Setting this property causes the source file to be compiled as the
+ specified language, using explicit flags if possible. Previously it
+ only caused the specified language's compiler to be used.
+ See policy :policy:`CMP0119`.
diff --git a/Help/prop_tgt/ARCHIVE_OUTPUT_DIRECTORY.rst b/Help/prop_tgt/ARCHIVE_OUTPUT_DIRECTORY.rst
index 42210696b..677e06df0 100644
--- a/Help/prop_tgt/ARCHIVE_OUTPUT_DIRECTORY.rst
+++ b/Help/prop_tgt/ARCHIVE_OUTPUT_DIRECTORY.rst
@@ -3,7 +3,7 @@ ARCHIVE_OUTPUT_DIRECTORY
.. |XXX| replace:: :ref:`ARCHIVE <Archive Output Artifacts>`
.. |xxx| replace:: archive
-.. |CMAKE_XXX_OUTPUT_DIRECTORY| replace:: CMAKE_ARCHIVE_OUTPUT_DIRECTORY
+.. |CMAKE_XXX_OUTPUT_DIRECTORY| replace:: :variable:`CMAKE_ARCHIVE_OUTPUT_DIRECTORY`
.. include:: XXX_OUTPUT_DIRECTORY.txt
See also the :prop_tgt:`ARCHIVE_OUTPUT_DIRECTORY_<CONFIG>` target property.
diff --git a/Help/prop_tgt/AUTOMOC.rst b/Help/prop_tgt/AUTOMOC.rst
index c18859b56..52d96e02f 100644
--- a/Help/prop_tgt/AUTOMOC.rst
+++ b/Help/prop_tgt/AUTOMOC.rst
@@ -137,7 +137,8 @@ parent directory path of the ``moc`` input file. This scheme allows to have
All not included ``moc`` output files will be included automatically by the
CMake generated file
-- ``<AUTOGEN_BUILD_DIR>/mocs_compilation.cpp``,
+- ``<AUTOGEN_BUILD_DIR>/mocs_compilation.cpp``, or
+- ``<AUTOGEN_BUILD_DIR>/mocs_compilation_$<CONFIG>.cpp``,
which is added to the target's sources.
diff --git a/Help/prop_tgt/CUDA_STANDARD.rst b/Help/prop_tgt/CUDA_STANDARD.rst
index fcc472568..6517035a2 100644
--- a/Help/prop_tgt/CUDA_STANDARD.rst
+++ b/Help/prop_tgt/CUDA_STANDARD.rst
@@ -9,7 +9,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``, ``03``, ``11``, ``14``, ``17``, ``20``.
+Supported values are ``98``, ``03``, ``11``, ``14``, ``17``, ``20``, ``23``.
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/CXX_STANDARD.rst b/Help/prop_tgt/CXX_STANDARD.rst
index f322ffe1f..be0dab565 100644
--- a/Help/prop_tgt/CXX_STANDARD.rst
+++ b/Help/prop_tgt/CXX_STANDARD.rst
@@ -11,7 +11,7 @@ flag such as ``-std=gnu++11`` 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.
-Supported values are ``98``, ``11``, ``14``, ``17``, and ``20``.
+Supported values are ``98``, ``11``, ``14``, ``17``, ``20``, ``23``.
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/EXPORT_COMPILE_COMMANDS.rst b/Help/prop_tgt/EXPORT_COMPILE_COMMANDS.rst
new file mode 100644
index 000000000..0b1145c4e
--- /dev/null
+++ b/Help/prop_tgt/EXPORT_COMPILE_COMMANDS.rst
@@ -0,0 +1,9 @@
+EXPORT_COMPILE_COMMANDS
+-----------------------
+
+.. versionadded:: 3.20
+
+Enable/Disable output of compile commands during generation for a target.
+
+This property is initialized by the value of the variable
+:variable:`CMAKE_EXPORT_COMPILE_COMMANDS` if it is set when a target is created.
diff --git a/Help/prop_tgt/IMPORTED_OBJECTS.rst b/Help/prop_tgt/IMPORTED_OBJECTS.rst
index bbbcd866d..f3577eb99 100644
--- a/Help/prop_tgt/IMPORTED_OBJECTS.rst
+++ b/Help/prop_tgt/IMPORTED_OBJECTS.rst
@@ -3,11 +3,91 @@ IMPORTED_OBJECTS
.. versionadded:: 3.9
-A :ref:`semicolon-separated list <CMake Language Lists>` of absolute paths to the object
-files on disk for an :ref:`imported <Imported targets>`
+A :ref:`semicolon-separated list <CMake Language Lists>` of absolute paths
+to the object files on disk for an :ref:`imported <Imported targets>`
:ref:`object library <object libraries>`.
Ignored for non-imported targets.
Projects may skip ``IMPORTED_OBJECTS`` if the configuration-specific
-property :prop_tgt:`IMPORTED_OBJECTS_<CONFIG>` is set instead.
+property :prop_tgt:`IMPORTED_OBJECTS_<CONFIG>` is set instead, except in
+situations as noted in the section below.
+
+
+Xcode Generator Considerations
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. versionadded:: 3.20
+
+For Apple platforms, a project may be built for more than one architecture.
+This is controlled by the :variable:`CMAKE_OSX_ARCHITECTURES` variable.
+For all but the :generator:`Xcode` generator, CMake invokes compilers once
+per source file and passes multiple ``-arch`` flags, leading to a single
+object file which will be a universal binary. Such object files work well
+when listed in the ``IMPORTED_OBJECTS`` of a separate CMake build, even for
+the :generator:`Xcode` generator. But producing such object files with the
+:generator:`Xcode` generator is more difficult, since it invokes the compiler
+once per architecture for each source file. Unlike the other generators,
+it does not generate universal object file binaries.
+
+A further complication with the :generator:`Xcode` generator is that when
+targeting device platforms (iOS, tvOS or watchOS), the :generator:`Xcode`
+generator has the ability to use either the device or simulator SDK without
+needing CMake to be re-run. The SDK can be selected at build time.
+But since some architectures can be supported by both the device and the
+simulator SDKs (e.g. ``arm64`` with Xcode 12 or later), not all combinations
+can be represented in a single universal binary. The only solution in this
+case is to have multiple object files.
+
+``IMPORTED_OBJECTS`` doesn't support generator expressions, so every file
+it lists needs to be valid for every architecture and SDK. If incorporating
+object files that are not universal binaries, the path and/or file name of
+each object file has to somehow encapsulate the different architectures and
+SDKs. With the :generator:`Xcode` generator, Xcode variables of the form
+``$(...)`` can be used to represent these aspects and Xcode will substitute
+the appropriate values at build time. CMake doesn't interpret these
+variables and embeds them unchanged in the Xcode project file.
+``$(CURRENT_ARCH)`` can be used to represent the architecture, while
+``$(EFFECTIVE_PLATFORM_NAME)`` can be used to differentiate between SDKs.
+
+The following shows one example of how these two variables can be used to
+refer to an object file whose location depends on both the SDK and the
+architecture:
+
+.. code-block:: cmake
+
+ add_library(someObjs OBJECT IMPORTED)
+
+ set_property(TARGET someObjs PROPERTY IMPORTED_OBJECTS
+ # Quotes are required because of the ()
+ "/path/to/somewhere/objects$(EFFECTIVE_PLATFORM_NAME)/$(CURRENT_ARCH)/func.o"
+ )
+
+ # Example paths:
+ # /path/to/somewhere/objects-iphoneos/arm64/func.o
+ # /path/to/somewhere/objects-iphonesimulator/x86_64/func.o
+
+In some cases, you may want to have configuration-specific object files
+as well. The :variable:`CMAKE_CFG_INTDIR` variable can be a convenient
+way of capturing this in combination with the SDK:
+
+.. code-block:: cmake
+
+ add_library(someObjs OBJECT IMPORTED)
+ set_property(TARGET someObjs PROPERTY IMPORTED_OBJECTS
+ "/path/to/somewhere/${CMAKE_CFG_INTDIR}/$(CURRENT_ARCH)/func.o"
+ )
+
+ # Example paths:
+ # /path/to/somewhere/Release-iphoneos/arm64/func.o
+ # /path/to/somewhere/Debug-iphonesimulator/x86_64/func.o
+
+When any Xcode variable or :variable:`CMAKE_CFG_INTDIR` is used, CMake is
+not able to fully evaluate the path(s) at configure time. One consequence
+of this is that the configuration-specific
+:prop_tgt:`IMPORTED_OBJECTS_<CONFIG>` properties cannot be used, since
+CMake cannot determine whether an object file exists at a particular
+``<CONFIG>`` location. The ``IMPORTED_OBJECTS`` property must be used for
+these situations and the configuration-specific aspects of the path must be
+handled by using :variable:`CMAKE_CFG_INTDIR` or with another Xcode variable
+``$(CONFIGURATION)``.
diff --git a/Help/prop_tgt/IMPORTED_OBJECTS_CONFIG.rst b/Help/prop_tgt/IMPORTED_OBJECTS_CONFIG.rst
index b12ca3887..238395a23 100644
--- a/Help/prop_tgt/IMPORTED_OBJECTS_CONFIG.rst
+++ b/Help/prop_tgt/IMPORTED_OBJECTS_CONFIG.rst
@@ -3,7 +3,18 @@ IMPORTED_OBJECTS_<CONFIG>
.. versionadded:: 3.9
-<CONFIG>-specific version of :prop_tgt:`IMPORTED_OBJECTS` property.
+``<CONFIG>``-specific version of :prop_tgt:`IMPORTED_OBJECTS` property.
Configuration names correspond to those provided by the project from
which the target is imported.
+
+
+Xcode Generator Considerations
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Do not use this ``<CONFIG>``-specific property if you need to use Xcode
+variables like ``$(CURRENT_ARCH)`` or ``$(EFFECTIVE_PLATFORM_NAME)`` in
+the value. The ``<CONFIG>``-specific properties will be ignored in such
+cases because CMake cannot determine whether a file exists at the
+configuration-specific path at configuration time. For such cases, use
+:prop_tgt:`IMPORTED_OBJECTS` instead.
diff --git a/Help/prop_tgt/INSTALL_NAME_DIR.rst b/Help/prop_tgt/INSTALL_NAME_DIR.rst
index 747615ac8..8faefb71c 100644
--- a/Help/prop_tgt/INSTALL_NAME_DIR.rst
+++ b/Help/prop_tgt/INSTALL_NAME_DIR.rst
@@ -12,5 +12,5 @@ This property is initialized by the value of the variable
created.
This property supports :manual:`generator expressions <cmake-generator-expressions(7)>`.
-In particular, the ``$<INSTALL_PREFIX>`` generator expression can be used to set the
-directory relative to the install-time prefix.
+In particular, the :genex:`$<INSTALL_PREFIX>` generator expression can be
+used to set the directory relative to the install-time prefix.
diff --git a/Help/prop_tgt/LANG_CLANG_TIDY.rst b/Help/prop_tgt/LANG_CLANG_TIDY.rst
index 7fc23721c..af16d3c5b 100644
--- a/Help/prop_tgt/LANG_CLANG_TIDY.rst
+++ b/Help/prop_tgt/LANG_CLANG_TIDY.rst
@@ -3,7 +3,7 @@
.. versionadded:: 3.6
-This property is implemented only when ``<LANG>`` is ``C`` or ``CXX``.
+This property is implemented only when ``<LANG>`` is ``C``, ``CXX``, ``OBJC`` or ``OBJCXX``.
Specify a :ref:`semicolon-separated list <CMake Language Lists>` containing a command
line for the ``clang-tidy`` tool. The :ref:`Makefile Generators`
diff --git a/Help/prop_tgt/LIBRARY_OUTPUT_DIRECTORY.rst b/Help/prop_tgt/LIBRARY_OUTPUT_DIRECTORY.rst
index 785a57bbf..9fbe90408 100644
--- a/Help/prop_tgt/LIBRARY_OUTPUT_DIRECTORY.rst
+++ b/Help/prop_tgt/LIBRARY_OUTPUT_DIRECTORY.rst
@@ -3,7 +3,7 @@ LIBRARY_OUTPUT_DIRECTORY
.. |XXX| replace:: :ref:`LIBRARY <Library Output Artifacts>`
.. |xxx| replace:: library
-.. |CMAKE_XXX_OUTPUT_DIRECTORY| replace:: CMAKE_LIBRARY_OUTPUT_DIRECTORY
+.. |CMAKE_XXX_OUTPUT_DIRECTORY| replace:: :variable:`CMAKE_LIBRARY_OUTPUT_DIRECTORY`
.. include:: XXX_OUTPUT_DIRECTORY.txt
See also the :prop_tgt:`LIBRARY_OUTPUT_DIRECTORY_<CONFIG>` target property.
diff --git a/Help/prop_tgt/OBJCXX_STANDARD.rst b/Help/prop_tgt/OBJCXX_STANDARD.rst
index 1067153e6..96088af96 100644
--- a/Help/prop_tgt/OBJCXX_STANDARD.rst
+++ b/Help/prop_tgt/OBJCXX_STANDARD.rst
@@ -9,7 +9,7 @@ This property specifies the ObjC++ 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``, ``17``, and ``20``.
+Supported values are ``98``, ``11``, ``14``, ``17``, ``20``, ``23``.
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/RUNTIME_OUTPUT_DIRECTORY.rst b/Help/prop_tgt/RUNTIME_OUTPUT_DIRECTORY.rst
index 12390f50a..3c375463c 100644
--- a/Help/prop_tgt/RUNTIME_OUTPUT_DIRECTORY.rst
+++ b/Help/prop_tgt/RUNTIME_OUTPUT_DIRECTORY.rst
@@ -3,7 +3,7 @@ RUNTIME_OUTPUT_DIRECTORY
.. |XXX| replace:: :ref:`RUNTIME <Runtime Output Artifacts>`
.. |xxx| replace:: runtime
-.. |CMAKE_XXX_OUTPUT_DIRECTORY| replace:: CMAKE_RUNTIME_OUTPUT_DIRECTORY
+.. |CMAKE_XXX_OUTPUT_DIRECTORY| replace:: :variable:`CMAKE_RUNTIME_OUTPUT_DIRECTORY`
.. include:: XXX_OUTPUT_DIRECTORY.txt
See also the :prop_tgt:`RUNTIME_OUTPUT_DIRECTORY_<CONFIG>` target property.
diff --git a/Help/prop_tgt/UNITY_BUILD.rst b/Help/prop_tgt/UNITY_BUILD.rst
index 04cede61e..f827a20a1 100644
--- a/Help/prop_tgt/UNITY_BUILD.rst
+++ b/Help/prop_tgt/UNITY_BUILD.rst
@@ -70,6 +70,11 @@ a number of measures to help address such problems:
problems with specific files than disabling unity builds for an entire
target.
+* Projects can set :prop_tgt:`UNITY_BUILD_UNIQUE_ID` to cause a valid
+ C-identifier to be generated which is unique per file in a unity
+ build. This can be used to avoid problems with anonymous namespaces
+ in unity builds.
+
* The :prop_tgt:`UNITY_BUILD_CODE_BEFORE_INCLUDE` and
:prop_tgt:`UNITY_BUILD_CODE_AFTER_INCLUDE` target properties can be used
to inject code into the unity source files before and after every
diff --git a/Help/prop_tgt/UNITY_BUILD_UNIQUE_ID.rst b/Help/prop_tgt/UNITY_BUILD_UNIQUE_ID.rst
new file mode 100644
index 000000000..2c95e027c
--- /dev/null
+++ b/Help/prop_tgt/UNITY_BUILD_UNIQUE_ID.rst
@@ -0,0 +1,55 @@
+UNITY_BUILD_UNIQUE_ID
+---------------------
+
+.. versionadded:: 3.20
+
+The name of a valid C-identifier which is set to a unique per-file
+value during unity builds.
+
+When this property is populated and when :prop_tgt:`UNITY_BUILD`
+is true, the property value is used to define a compiler definition
+of the specified name. The value of the defined symbol is unspecified,
+but it is unique per file path.
+
+Given:
+
+.. code-block:: cmake
+
+ set_target_properties(myTarget PROPERTIES
+ UNITY_BUILD "ON"
+ UNITY_BUILD_UNIQUE_ID "MY_UNITY_ID"
+ )
+
+the ``MY_UNITY_ID`` symbol is defined to a unique per-file value.
+
+One known use case for this identifier is to disambiguate the
+variables in an anonymous namespace in a limited scope.
+Anonymous namespaces present a problem for unity builds because
+they are used to ensure that certain variables and declarations
+are scoped to a translation unit which is approximated by a
+single source file. When source files are combined in a unity
+build file, those variables in different files are combined in
+a single translation unit and the names clash. This property can
+be used to avoid that with code like the following:
+
+.. code-block:: cpp
+
+ // Needed for when unity builds are disabled
+ #ifndef MY_UNITY_ID
+ #define MY_UNITY_ID
+ #endif
+
+ namespace { namespace MY_UNITY_ID {
+ // The name 'i' clashes (or could clash) with other
+ // variables in other anonymous namespaces
+ int i = 42;
+ }}
+
+ int use_var()
+ {
+ return MY_UNITY_ID::i;
+ }
+
+The pseudononymous namespace is used within a truly anonymous namespace.
+On many platforms, this maintains the invariant that the symbols within
+do not get external linkage when performing a unity build.
diff --git a/Help/prop_tgt/XCODE_ATTRIBUTE_an-attribute.rst b/Help/prop_tgt/XCODE_ATTRIBUTE_an-attribute.rst
index 71858c50e..fbe760815 100644
--- a/Help/prop_tgt/XCODE_ATTRIBUTE_an-attribute.rst
+++ b/Help/prop_tgt/XCODE_ATTRIBUTE_an-attribute.rst
@@ -3,9 +3,15 @@ XCODE_ATTRIBUTE_<an-attribute>
Set Xcode target attributes directly.
-Tell the :generator:`Xcode` generator to set '<an-attribute>' to a given
+Tell the :generator:`Xcode` generator to set ``<an-attribute>`` to a given
value in the generated Xcode project. Ignored on other generators.
+This offers low-level control over the generated Xcode project file.
+It is meant as a last resort for specifying settings that CMake does
+not otherwise have a way to control. Although this can override a
+setting CMake normally produces on its own, doing so bypasses CMake's
+model of the project and can break things.
+
See the :variable:`CMAKE_XCODE_ATTRIBUTE_<an-attribute>` variable
to set attributes on all targets in a directory tree.
diff --git a/Help/prop_tgt/XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY.rst b/Help/prop_tgt/XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY.rst
new file mode 100644
index 000000000..7b6812678
--- /dev/null
+++ b/Help/prop_tgt/XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY.rst
@@ -0,0 +1,8 @@
+XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY
+----------------------------------------
+
+.. versionadded:: 3.20
+
+Tell the :generator:`Xcode` generator to perform code signing for all the
+frameworks and libraries that are embedded using the
+:prop_tgt:`XCODE_EMBED_FRAMEWORKS <XCODE_EMBED_<type>>` property.
diff --git a/Help/prop_tgt/XCODE_EMBED_FRAMEWORKS_REMOVE_HEADERS_ON_COPY.rst b/Help/prop_tgt/XCODE_EMBED_FRAMEWORKS_REMOVE_HEADERS_ON_COPY.rst
new file mode 100644
index 000000000..29f8c5c03
--- /dev/null
+++ b/Help/prop_tgt/XCODE_EMBED_FRAMEWORKS_REMOVE_HEADERS_ON_COPY.rst
@@ -0,0 +1,8 @@
+XCODE_EMBED_FRAMEWORKS_REMOVE_HEADERS_ON_COPY
+---------------------------------------------
+
+.. versionadded:: 3.20
+
+Tell the :generator:`Xcode` generator to remove headers from all the
+frameworks that are embedded using the
+:prop_tgt:`XCODE_EMBED_FRAMEWORKS <XCODE_EMBED_<type>>` property.
diff --git a/Help/prop_tgt/XCODE_EMBED_type.rst b/Help/prop_tgt/XCODE_EMBED_type.rst
new file mode 100644
index 000000000..90c5bc787
--- /dev/null
+++ b/Help/prop_tgt/XCODE_EMBED_type.rst
@@ -0,0 +1,14 @@
+XCODE_EMBED_<type>
+------------------
+
+.. versionadded:: 3.20
+
+Tell the :generator:`Xcode` generator to embed the specified list of items into
+the target bundle. ``<type>`` specifies the embed build phase to use.
+
+Currently, the only supported value for ``<type>`` is ``FRAMEWORKS``.
+The specified items will be added to the ``Embed Frameworks`` build phase.
+The items can be CMake target names or paths to frameworks or libraries.
+See also :prop_tgt:`XCODE_EMBED_<type>_PATH`,
+:prop_tgt:`XCODE_EMBED_FRAMEWORKS_REMOVE_HEADERS_ON_COPY` and
+:prop_tgt:`XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY`.
diff --git a/Help/prop_tgt/XCODE_EMBED_type_PATH.rst b/Help/prop_tgt/XCODE_EMBED_type_PATH.rst
new file mode 100644
index 000000000..887cf5721
--- /dev/null
+++ b/Help/prop_tgt/XCODE_EMBED_type_PATH.rst
@@ -0,0 +1,9 @@
+XCODE_EMBED_<type>_PATH
+-----------------------
+
+.. versionadded:: 3.20
+
+Tell the :generator:`Xcode` generator the relative path to use when embedding
+the items specified by :prop_tgt:`XCODE_EMBED_<type>`. The path is relative
+to the base location of the ``Embed XXX`` build phase associated with
+``<type>``.
diff --git a/Help/prop_tgt/XXX_OUTPUT_DIRECTORY.txt b/Help/prop_tgt/XXX_OUTPUT_DIRECTORY.txt
index 3ae54484a..d38a96e8b 100644
--- a/Help/prop_tgt/XXX_OUTPUT_DIRECTORY.txt
+++ b/Help/prop_tgt/XXX_OUTPUT_DIRECTORY.txt
@@ -3,9 +3,10 @@ Output directory in which to build |XXX| target files.
This property specifies the directory into which |xxx| target files
should be built. The property value may use
:manual:`generator expressions <cmake-generator-expressions(7)>`.
-Multi-configuration generators (VS, Xcode) append a per-configuration
-subdirectory to the specified directory unless a generator expression
-is used.
+Multi-configuration generators (:ref:`Visual Studio <Visual Studio Generators>`,
+:generator:`Xcode`, :generator:`Ninja Multi-Config`) append a
+per-configuration subdirectory to the specified directory unless a generator
+expression is used.
-This property is initialized by the value of the variable
-|CMAKE_XXX_OUTPUT_DIRECTORY| if it is set when a target is created.
+This property is initialized by the value of the
+|CMAKE_XXX_OUTPUT_DIRECTORY| variable if it is set when a target is created.
diff --git a/Help/release/3.20.rst b/Help/release/3.20.rst
new file mode 100644
index 000000000..176447d16
--- /dev/null
+++ b/Help/release/3.20.rst
@@ -0,0 +1,329 @@
+CMake 3.20 Release Notes
+************************
+
+.. only:: html
+
+ .. contents::
+
+Changes made since CMake 3.19 include the following.
+
+New Features
+============
+
+Presets
+-------
+
+* :manual:`cmake-presets(7)` gained support for build and test presets.
+
+Generators
+----------
+
+* :ref:`Makefile Generators`, for some toolchains, now use the compiler
+ to extract implicit dependencies while compiling source files.
+
+Languages
+---------
+
+* C++23 compiler modes may now be specified via the :prop_tgt:`CXX_STANDARD`,
+ :prop_tgt:`CUDA_STANDARD`, or :prop_tgt:`OBJCXX_STANDARD` target properties,
+ or via the :manual:`Compile Features <cmake-compile-features(7)>`
+ functionality's ``cxx_std_23`` meta-feature.
+
+* ``CUDA`` language support now works when ``nvcc`` is a symbolic link,
+ for example due to a ``ccache`` or ``colornvcc`` wrapper script.
+
+* The :envvar:`CUDAARCHS` environment variable was added for initializing
+ :variable:`CMAKE_CUDA_ARCHITECTURES`. Useful in cases where the compiler
+ default is unsuitable for the machine's GPU.
+
+Compilers
+---------
+
+* The NVIDIA HPC SDK compilers are now supported with compiler id ``NVHPC``.
+
+* The Intel oneAPI NextGen LLVM compilers are now supported with
+ compiler id ``IntelLLVM``:
+
+ * The ``icx``/``icpx`` C/C++ compilers on Linux, and the ``icx``
+ C/C++ compiler on Windows, are fully supported as of oneAPI 2021.1.
+
+ * The ``ifx`` Fortran compiler on Linux is partially supported.
+ As of oneAPI 2021.1, ``ifx`` does not define several identification
+ macros, so CMake identifies it as the classic ``Intel`` compiler.
+ This works in many cases because ``ifx`` accepts the same command line
+ parameters as ``ifort``. A future version of oneAPI may fix this.
+
+ * The ``ifx`` Fortran compiler on Windows is not yet supported.
+
+ The Intel oneAPI Classic compilers (``icc``, ``icpc``, and ``ifort``)
+ continue to be supported with compiler id ``Intel``.
+
+* Support was added for the IAR STM8 compiler.
+
+Platforms
+---------
+
+* CMake's support for :ref:`Cross Compiling for Android`
+ is now merged with the Android NDK's toolchain file.
+ They now have similar behavior, though some variable names differ.
+ User-facing changes include:
+
+ - ``find_*`` functions will search NDK ABI / API specific paths by default.
+
+ - The default :variable:`CMAKE_BUILD_TYPE` for Android is
+ now ``RelWithDebInfo``.
+
+ - The :variable:`CMAKE_ANDROID_NDK_VERSION` variable was added to
+ report the version of the NDK.
+
+File-Based API
+--------------
+
+* The :manual:`cmake-file-api(7)` gained a new "toolchains" object
+ kind that describes the compiler used for each enabled language.
+
+Commands
+--------
+
+* :command:`add_custom_command` and :command:`add_custom_target` now
+ support :manual:`generator expressions <cmake-generator-expressions(7)>`
+ in their ``OUTPUT`` and ``BYPRODUCTS`` options.
+
+ Their ``COMMAND``, ``WORKING_DIRECTORY``, and ``DEPENDS`` options gained
+ support for new generator expressions ``$<COMMAND_CONFIG:...>`` and
+ ``$<OUTPUT_CONFIG:...>`` that control cross-config handling when using
+ the :generator:`Ninja Multi-Config` generator.
+
+* The :command:`add_custom_command` command gained ``DEPFILE`` support on
+ :ref:`Makefile Generators`.
+
+* The :command:`add_library` command previously prohibited imported object
+ libraries when using potentially multi-architecture configurations.
+ This mostly affected the :generator:`Xcode` generator, e.g. when targeting
+ iOS or one of the other device platforms. This restriction has now been
+ removed.
+
+* The :command:`cmake_path` command was added for operations on
+ filesystem paths.
+
+* The :command:`configure_file` command gained ``USE_SOURCE_PERMISSIONS``
+ and ``FILE_PERMISSIONS`` options to support copying of permissions of the
+ source file and using specified permissions respectively.
+
+* The :command:`file(GENERATE)` command gained a ``NEWLINE_STYLE`` option to
+ specify how newlines are handled for the generated file.
+
+* The :command:`file(GENERATE)` command gained ``NO_SOURCE_PERMISSIONS``,
+ ``USE_SOURCE_PERMISSIONS``, and ``FILE_PERMISSIONS`` options for controlling
+ the permissions of the generated file.
+
+* The :command:`install(FILES)` command ``RENAME`` option learned to
+ support :manual:`generator expressions <cmake-generator-expressions(7)>`.
+
+* The :command:`target_include_directories` command gained a new option
+ ``AFTER``.
+
+* The :command:`target_sources` command now supports targets created
+ by the :command:`add_custom_target` command.
+
+* The :command:`try_run` command gained a ``WORKING_DIRECTORY`` option to
+ set the working directory in which to run the compiled check executable.
+
+Variables
+---------
+
+* The :variable:`CMAKE_<LANG>_BYTE_ORDER` variable was added to provide the
+ target architecture byte order detected from the toolchain.
+
+* The :variable:`CMAKE_RUNTIME_OUTPUT_DIRECTORY`,
+ :variable:`CMAKE_LIBRARY_OUTPUT_DIRECTORY`, and
+ :variable:`CMAKE_ARCHIVE_OUTPUT_DIRECTORY` variables now support
+ target-dependent generator expressions.
+
+Properties
+----------
+
+* The :prop_tgt:`<LANG>_CLANG_TIDY` target property and the associated
+ :variable:`CMAKE_<LANG>_CLANG_TIDY` variable learned to support
+ the ``OBJC`` and ``OBJCXX`` languages.
+
+* The :prop_tgt:`EXPORT_COMPILE_COMMANDS` target property was added
+ for the associated :variable:`CMAKE_EXPORT_COMPILE_COMMANDS` variable
+ to allow for configuration of exporting compile commands per target.
+
+* The :prop_sf:`GENERATED` source-file property is now visible
+ from any directory scope, regardless of the scope in which it is set.
+ See policy :policy:`CMP0118`.
+
+* The :prop_tgt:`UNITY_BUILD_UNIQUE_ID` target property
+ was added to support generation of an identifier that is
+ unique per source file in unity builds. It can help to
+ resolve duplicate symbol problems with anonymous namespaces.
+
+* The :prop_tgt:`WIN32_EXECUTABLE` target property now works with Clang
+ on Windows.
+
+* The :prop_tgt:`XCODE_EMBED_FRAMEWORKS <XCODE_EMBED_<type>>` target property
+ was added to tell the :generator:`Xcode` generator to embed frameworks.
+ Aspects of the embedding can be customized with the
+ :prop_tgt:`XCODE_EMBED_FRAMEWORKS_PATH <XCODE_EMBED_<type>>`,
+ :prop_tgt:`XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY`, and
+ :prop_tgt:`XCODE_EMBED_FRAMEWORKS_REMOVE_HEADERS_ON_COPY` target properties.
+
+Modules
+-------
+
+* The :module:`ExternalData` module :command:`ExternalData_Add_Target`
+ function gained a ``SHOW_PROGRESS <bool>`` option for controlling whether
+ or not to show progress output during the build.
+
+* The :module:`ExternalProject` module :command:`ExternalProject_Add` function
+ gained a ``CONFIGURE_HANDLED_BY_BUILD`` option. This can be used to make
+ subsequent runs of the configure step be triggered by the build step when
+ an external project dependency rebuilds instead of always re-running the
+ configure step in such cases.
+
+* The :module:`FindBoost` module gained a ``Boost_NO_WARN_NEW_VERSIONS``
+ option to silence the warning about unknown dependencies for new
+ Boost versions.
+
+* The :module:`FindCUDAToolkit` module gained support for finding CUDA
+ toolkits when ``nvcc`` is a symbolic link,
+ for example due to a ``ccache`` or ``colornvcc`` wrapper script.
+
+* The :module:`FindGDAL` module has been improved to document and mark as
+ advanced its cache variables. There is a new ``FindGDAL_SKIP_GDAL_CONFIG``
+ variable which may be used to skip over the ``gdal-config``-based search.
+ Users may also set ``GDAL_ADDITIONAL_LIBRARY_VERSIONS`` to add additional
+ versions to the library name search strategy.
+
+* The :module:`FindIntl` module now provides an imported target.
+
+* The :module:`FindOpenSSL` module learned to support a version range.
+
+* The :module:`FindPython3`, :module:`FindPython2` and :module:`FindPython`
+ modules gained options controlling how unversioned interpreter names are
+ searched.
+
+* The :module:`UseJava` module ``add_jar()`` command's
+ ``GENERATE_NATIVE_HEADERS`` feature gained options to export the
+ generated target.
+
+* The :module:`UseSWIG` module gained the capability, for
+ :ref:`Makefile <Makefile Generators>` and :ref:`Ninja <Ninja Generators>`
+ generators, to use the ``swig`` tool to generate implicit dependencies.
+
+Autogen
+-------
+
+* The :ref:`Qt AUTOMOC` feature now works with per-config sources.
+
+CTest
+-----
+
+* :manual:`ctest(1)` gained a ``--test-dir`` option to specify the directory
+ in which to look for tests.
+
+CPack
+-----
+
+* :module:`CPack` gained the :variable:`CPACK_THREADS` variable to
+ control the number of threads used for parallelized operations,
+ such as compressing the installer package.
+
+* The :cpack_gen:`CPack DEB Generator` learned a new
+ :variable:`CPACK_DEBIAN_PACKAGE_SHLIBDEPS_PRIVATE_DIRS`
+ variable to specify additional search directories for
+ resolving private library dependencies when using
+ ``dpkg-shlibdeps``.
+
+* The :cpack_gen:`CPack IFW Generator` gained a new
+ :variable:`CPACK_IFW_PACKAGE_WIZARD_SHOW_PAGE_LIST` variable to
+ control visibility of the widget listing installer pages on the left side
+ of the wizard. This feature available only since QtIFW 4.0.
+
+* The :cpack_gen:`CPack NSIS Generator` gained new
+ :variable:`CPACK_NSIS_BRANDING_TEXT` and
+ :variable:`CPACK_NSIS_BRANDING_TEXT_TRIM_POSITION` variables to change
+ the text at the bottom of the install window and change its trim position
+
+* The :cpack_gen:`CPack NSIS Generator` now correctly handles Unicode
+ characters. If you want to have a :variable:`CPACK_RESOURCE_FILE_LICENSE`
+ with UTF-8 characters, it needs to be encoded in UTF-8 BOM.
+
+* The :cpack_gen:`CPack NuGet Generator` gained options:
+
+ - :variable:`CPACK_NUGET_PACKAGE_ICON` and
+ :variable:`CPACK_NUGET_<compName>_PACKAGE_ICON`
+ allow package icons to be specified by local files.
+ - :variable:`CPACK_NUGET_PACKAGE_LICENSE_EXPRESSION` and
+ :variable:`CPACK_NUGET_<compName>_PACKAGE_LICENSE_EXPRESSION` add
+ support for specifying licenses recognized by the
+ `Software Package Data Exchange`_ (SPDX).
+ - :variable:`CPACK_NUGET_PACKAGE_LICENSE_FILE_NAME` and
+ :variable:`CPACK_NUGET_<compName>_PACKAGE_LICENSE_FILE_NAME` allow
+ licenses to be specified by local files.
+ - :variable:`CPACK_NUGET_PACKAGE_LANGUAGE` and
+ :variable:`CPACK_NUGET_<compName>_PACKAGE_LANGUAGE` allow the locale
+ for a package to be specified, for example ``en_CA``.
+
+.. _Software Package Data Exchange: https://spdx.org/
+
+Deprecated and Removed Features
+===============================
+
+* The :manual:`cmake-server(7)` mode has been removed.
+ Clients should use the :manual:`cmake-file-api(7)` instead.
+
+* The :module:`WriteCompilerDetectionHeader` module has been deprecated
+ via policy :policy:`CMP0120`. Projects should be ported away from it.
+
+* The :module:`TestBigEndian` module has been deprecated in favor
+ of the :variable:`CMAKE_<LANG>_BYTE_ORDER` variable.
+
+* The :module:`AddFileDependencies` module is deprecated.
+ Port projects to use :command:`set_property` directly.
+
+* The :cpack_gen:`CPack NuGet Generator` deprecated some variables to reflect
+ changes in the NuGet specification:
+
+ - :variable:`CPACK_NUGET_PACKAGE_ICONURL` and
+ :variable:`CPACK_NUGET_<compName>_PACKAGE_ICONURL` have been deprecated;
+ replace with a reference to a local icon file.
+ - :variable:`CPACK_NUGET_PACKAGE_LICENSEURL` and
+ :variable:`CPACK_NUGET_<compName>_PACKAGE_LICENSEURL` have been deprecated;
+ replace with a reference to the project's license file or SPDX
+ license expression.
+
+Other Changes
+=============
+
+* Source file extensions must now be explicit.
+ See policy :policy:`CMP0115` for details.
+
+* The :prop_sf:`LANGUAGE` source file property now forces compilation
+ as the specified language. See policy :policy:`CMP0119`.
+
+* On AIX, installation of XCOFF executables and shared libraries
+ no longer requires relinking to change the runtime search path
+ from the build-tree RPATH to the install-tree RPATH. CMake now
+ edits the XCOFF binaries directly during installation, as has
+ long been done on ELF platforms.
+
+* With MSVC-like compilers the value of
+ :variable:`CMAKE_CXX_FLAGS <CMAKE_<LANG>_FLAGS>` no longer contains
+ the ``/GR`` flag for runtime type information by default.
+ See policy :policy:`CMP0117`.
+
+* Ninja generators now transform the ``DEPFILE`` generated by an
+ :command:`add_custom_command`. See policy :policy:`CMP0116` for details.
+
+* The precompiled Linux binaries provided on
+ `cmake.org <https://cmake.org/download/>`_ have changed their naming pattern
+ to ``cmake-$ver-linux-$arch``, where ``$arch`` is either ``x86_64`` or
+ ``aarch64``.
+
+* The precompiled Windows binaries provided on
+ `cmake.org <https://cmake.org/download/>`_ have changed their naming pattern
+ to ``cmake-$ver-windows-$arch``, where ``$arch`` is either ``x86_64`` or
+ ``i386``.
diff --git a/Help/release/index.rst b/Help/release/index.rst
index 6fb0f1a48..95b41fb63 100644
--- a/Help/release/index.rst
+++ b/Help/release/index.rst
@@ -13,6 +13,7 @@ Releases
.. toctree::
:maxdepth: 1
+ 3.20 <3.20>
3.19 <3.19>
3.18 <3.18>
3.17 <3.17>
diff --git a/Help/variable/CMAKE_ANDROID_EXCEPTIONS.rst b/Help/variable/CMAKE_ANDROID_EXCEPTIONS.rst
new file mode 100644
index 000000000..6dd44f875
--- /dev/null
+++ b/Help/variable/CMAKE_ANDROID_EXCEPTIONS.rst
@@ -0,0 +1,7 @@
+CMAKE_ANDROID_EXCEPTIONS
+------------------------
+
+.. versionadded:: 3.20
+
+When :ref:`Cross Compiling for Android with the NDK`, this variable may be set
+to specify whether exceptions are enabled.
diff --git a/Help/variable/CMAKE_ANDROID_NDK_VERSION.rst b/Help/variable/CMAKE_ANDROID_NDK_VERSION.rst
new file mode 100644
index 000000000..5428d52bc
--- /dev/null
+++ b/Help/variable/CMAKE_ANDROID_NDK_VERSION.rst
@@ -0,0 +1,8 @@
+CMAKE_ANDROID_NDK_VERSION
+-------------------------
+
+.. versionadded:: 3.20
+
+When :ref:`Cross Compiling for Android with the NDK` and using an
+Android NDK version 11 or higher, this variable is provided by
+CMake to report the NDK version number.
diff --git a/Help/variable/CMAKE_ANDROID_RTTI.rst b/Help/variable/CMAKE_ANDROID_RTTI.rst
new file mode 100644
index 000000000..0e982069e
--- /dev/null
+++ b/Help/variable/CMAKE_ANDROID_RTTI.rst
@@ -0,0 +1,7 @@
+CMAKE_ANDROID_RTTI
+------------------
+
+.. versionadded:: 3.20
+
+When :ref:`Cross Compiling for Android with the NDK`, this variable may be set
+to specify whether RTTI is enabled.
diff --git a/Help/variable/CMAKE_APPLE_SILICON_PROCESSOR.rst b/Help/variable/CMAKE_APPLE_SILICON_PROCESSOR.rst
index 0d5ccd183..ad297c3d5 100644
--- a/Help/variable/CMAKE_APPLE_SILICON_PROCESSOR.rst
+++ b/Help/variable/CMAKE_APPLE_SILICON_PROCESSOR.rst
@@ -8,7 +8,8 @@ CMake what architecture to use for :variable:`CMAKE_HOST_SYSTEM_PROCESSOR`.
The value must be either ``arm64`` or ``x86_64``.
The value of this variable should never be modified by project code.
-It is meant to be set as a cache entry provided by the user,
-e.g. via ``-DCMAKE_APPLE_SILICON_PROCESSOR=...``.
+It is meant to be set by a toolchain file specified by the
+:variable:`CMAKE_TOOLCHAIN_FILE` variable, or as a cache entry
+provided by the user, e.g. via ``-DCMAKE_APPLE_SILICON_PROCESSOR=...``.
See also the :envvar:`CMAKE_APPLE_SILICON_PROCESSOR` environment variable.
diff --git a/Help/variable/CMAKE_BUILD_TYPE.rst b/Help/variable/CMAKE_BUILD_TYPE.rst
index 2d35635ac..405f7d590 100644
--- a/Help/variable/CMAKE_BUILD_TYPE.rst
+++ b/Help/variable/CMAKE_BUILD_TYPE.rst
@@ -18,3 +18,8 @@ in a build tree configured to build type ``Debug``, CMake will see to
having :variable:`CMAKE_C_FLAGS_DEBUG <CMAKE_<LANG>_FLAGS_DEBUG>` settings get
added to the :variable:`CMAKE_C_FLAGS <CMAKE_<LANG>_FLAGS>` settings. See
also :variable:`CMAKE_CONFIGURATION_TYPES`.
+
+Note that configuration names are case-insensitive. The value of this
+variable will be the same as it is specified when invoking CMake.
+For instance, if ``-DCMAKE_BUILD_TYPE=ReLeAsE`` is specified, then the
+value of ``CMAKE_BUILD_TYPE`` will be ``ReLeAsE``.
diff --git a/Help/variable/CMAKE_CUDA_ARCHITECTURES.rst b/Help/variable/CMAKE_CUDA_ARCHITECTURES.rst
index 985040d73..d88551634 100644
--- a/Help/variable/CMAKE_CUDA_ARCHITECTURES.rst
+++ b/Help/variable/CMAKE_CUDA_ARCHITECTURES.rst
@@ -5,7 +5,8 @@ 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>`:
+Initialized by the :envvar:`CUDAARCHS` environment variable if set.
+Otherwise as follows depending on :variable:`CMAKE_CUDA_COMPILER_ID <CMAKE_<LANG>_COMPILER_ID>`:
- For ``Clang``: the oldest architecture that works.
@@ -17,3 +18,18 @@ 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.
+
+Examples
+^^^^^^^^
+
+.. code-block:: cmake
+
+ cmake_minimum_required(VERSION)
+
+ if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
+ set(CMAKE_CUDA_ARCHITECTURES 75)
+ endif()
+
+ project(example LANGUAGES CUDA)
+
+``CMAKE_CUDA_ARCHITECTURES`` will default to ``75`` unless overridden by the user.
diff --git a/Help/variable/CMAKE_DEPENDS_USE_COMPILER.rst b/Help/variable/CMAKE_DEPENDS_USE_COMPILER.rst
new file mode 100644
index 000000000..bdad59eaf
--- /dev/null
+++ b/Help/variable/CMAKE_DEPENDS_USE_COMPILER.rst
@@ -0,0 +1,9 @@
+CMAKE_DEPENDS_USE_COMPILER
+--------------------------
+
+.. versionadded:: 3.20
+
+For the :ref:`Makefile Generators`, source dependencies are now, for a
+selection of compilers, generated by the compiler itself. By defining this
+variable with value ``FALSE``, you can restore the legacy behavior (i.e. using
+``CMake`` for dependencies discovery).
diff --git a/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst b/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst
index 724f30989..53a19dca4 100644
--- a/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst
+++ b/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst
@@ -28,7 +28,8 @@ form. The format of the JSON file looks like:
]
This is initialized by the :envvar:`CMAKE_EXPORT_COMPILE_COMMANDS` environment
-variable.
+variable, and initializes the :prop_tgt:`EXPORT_COMPILE_COMMANDS` target
+property for all targets.
.. note::
This option is implemented only by :ref:`Makefile Generators`
diff --git a/Help/variable/CMAKE_LANG_BYTE_ORDER.rst b/Help/variable/CMAKE_LANG_BYTE_ORDER.rst
new file mode 100644
index 000000000..78f0ae694
--- /dev/null
+++ b/Help/variable/CMAKE_LANG_BYTE_ORDER.rst
@@ -0,0 +1,20 @@
+CMAKE_<LANG>_BYTE_ORDER
+-----------------------
+
+.. versionadded:: 3.20
+
+Byte order of ``<LANG>`` compiler target architecture, if known.
+If defined and not empty, the value is one of:
+
+``BIG_ENDIAN``
+ The target architecture is Big Endian.
+
+``LITTLE_ENDIAN``
+ The target architecture is Little Endian.
+
+This is defined for languages ``C``, ``CXX``, ``OBJC``, ``OBJCXX``,
+and ``CUDA``.
+
+If :variable:`CMAKE_OSX_ARCHITECTURES` specifies multiple architectures, the
+value of ``CMAKE_<LANG>_BYTE_ORDER`` is non-empty only if all architectures
+share the same byte order.
diff --git a/Help/variable/CMAKE_LANG_CLANG_TIDY.rst b/Help/variable/CMAKE_LANG_CLANG_TIDY.rst
index 78f0f6a21..32e27b0ad 100644
--- a/Help/variable/CMAKE_LANG_CLANG_TIDY.rst
+++ b/Help/variable/CMAKE_LANG_CLANG_TIDY.rst
@@ -4,7 +4,7 @@ CMAKE_<LANG>_CLANG_TIDY
.. versionadded:: 3.6
Default value for :prop_tgt:`<LANG>_CLANG_TIDY` target property
-when ``<LANG>`` is ``C`` or ``CXX``.
+when ``<LANG>`` is ``C``, ``CXX``, ``OBJC`` or ``OBJCXX``.
This variable is used to initialize the property on each target as it is
created. For example:
diff --git a/Help/variable/CMAKE_LANG_COMPILER_ID.rst b/Help/variable/CMAKE_LANG_COMPILER_ID.rst
index 8eb4fb612..89d9e2757 100644
--- a/Help/variable/CMAKE_LANG_COMPILER_ID.rst
+++ b/Help/variable/CMAKE_LANG_COMPILER_ID.rst
@@ -25,7 +25,9 @@ include:
HP = Hewlett-Packard Compiler (hp.com)
IAR = IAR Systems (iar.com)
Intel = Intel Compiler (intel.com)
+ IntelLLVM = Intel LLVM-Based Compiler (intel.com)
MSVC = Microsoft Visual Studio (microsoft.com)
+ NVHPC = NVIDIA HPC SDK Compiler (nvidia.com)
NVIDIA = NVIDIA CUDA Compiler (nvidia.com)
OpenWatcom = Open Watcom (openwatcom.org)
PGI = The Portland Group (pgroup.com)
diff --git a/Help/variable/CMAKE_LINK_SEARCH_END_STATIC.rst b/Help/variable/CMAKE_LINK_SEARCH_END_STATIC.rst
index f4ccc0415..e86f63963 100644
--- a/Help/variable/CMAKE_LINK_SEARCH_END_STATIC.rst
+++ b/Help/variable/CMAKE_LINK_SEARCH_END_STATIC.rst
@@ -15,7 +15,7 @@ back to its starting type. This property switches the final linker
search type to ``-Bstatic`` regardless of how it started.
This variable is used to initialize the target property
-:prop_tgt:`LINK_SEARCH_END_STATIC` for all targets. If set, it's
+:prop_tgt:`LINK_SEARCH_END_STATIC` for all targets. If set, its
value is also used by the :command:`try_compile` command.
See also :variable:`CMAKE_LINK_SEARCH_START_STATIC`.
diff --git a/Help/variable/CMAKE_LINK_SEARCH_START_STATIC.rst b/Help/variable/CMAKE_LINK_SEARCH_START_STATIC.rst
index 2025c72b4..ab1837cef 100644
--- a/Help/variable/CMAKE_LINK_SEARCH_START_STATIC.rst
+++ b/Help/variable/CMAKE_LINK_SEARCH_START_STATIC.rst
@@ -16,7 +16,7 @@ when linking an executable statically (e.g. with the GNU ``-static``
option).
This variable is used to initialize the target property
-:prop_tgt:`LINK_SEARCH_START_STATIC` for all targets. If set, it's
+:prop_tgt:`LINK_SEARCH_START_STATIC` for all targets. If set, its
value is also used by the :command:`try_compile` command.
See also :variable:`CMAKE_LINK_SEARCH_END_STATIC`.
diff --git a/Help/variable/CMAKE_NO_BUILTIN_CHRPATH.rst b/Help/variable/CMAKE_NO_BUILTIN_CHRPATH.rst
index 189f59fa3..b9b045e7d 100644
--- a/Help/variable/CMAKE_NO_BUILTIN_CHRPATH.rst
+++ b/Help/variable/CMAKE_NO_BUILTIN_CHRPATH.rst
@@ -1,10 +1,17 @@
CMAKE_NO_BUILTIN_CHRPATH
------------------------
-Do not use the builtin ELF editor to fix RPATHs on installation.
+Do not use the builtin binary editor to fix runtime library search
+paths on installation.
-When an ELF binary needs to have a different RPATH after installation
-than it does in the build tree, CMake uses a builtin editor to change
-the RPATH in the installed copy. If this variable is set to true then
-CMake will relink the binary before installation instead of using its
-builtin editor.
+When an ELF or XCOFF binary needs to have a different runtime library
+search path after installation than it does in the build tree, CMake uses
+a builtin editor to change the runtime search path in the installed copy.
+If this variable is set to true then CMake will relink the binary before
+installation instead of using its builtin editor.
+
+.. versionadded:: 3.20
+
+ This variable also applies to XCOFF binaries' LIBPATH. Prior to the
+ addition of the XCOFF editor in CMake 3.20, this variable applied only
+ to ELF binaries' RPATH/RUNPATH.
diff --git a/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst b/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst
index d35595a21..9f68741a5 100644
--- a/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst
+++ b/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst
@@ -27,6 +27,8 @@ warn by default:
policy :policy:`CMP0102`.
* ``CMAKE_POLICY_WARNING_CMP0112`` controls the warning for
policy :policy:`CMP0112`.
+* ``CMAKE_POLICY_WARNING_CMP0116`` controls the warning for
+ policy :policy:`CMP0116`.
This variable should not be set by a project in CMake code. Project
developers running CMake may set this variable in their cache to
diff --git a/Help/variable/CMAKE_POSITION_INDEPENDENT_CODE.rst b/Help/variable/CMAKE_POSITION_INDEPENDENT_CODE.rst
index 43b1397eb..b01031713 100644
--- a/Help/variable/CMAKE_POSITION_INDEPENDENT_CODE.rst
+++ b/Help/variable/CMAKE_POSITION_INDEPENDENT_CODE.rst
@@ -5,5 +5,5 @@ Default value for :prop_tgt:`POSITION_INDEPENDENT_CODE` of targets.
This variable is used to initialize the
:prop_tgt:`POSITION_INDEPENDENT_CODE` property on all the targets.
-See that target property for additional information. If set, it's
+See that target property for additional information. If set, its
value is also used by the :command:`try_compile` command.
diff --git a/Help/variable/CMAKE_SYSTEM_PROCESSOR.rst b/Help/variable/CMAKE_SYSTEM_PROCESSOR.rst
index 8ad89f128..ce162157b 100644
--- a/Help/variable/CMAKE_SYSTEM_PROCESSOR.rst
+++ b/Help/variable/CMAKE_SYSTEM_PROCESSOR.rst
@@ -1,8 +1,13 @@
CMAKE_SYSTEM_PROCESSOR
----------------------
-The name of the CPU CMake is building for.
+When not cross-compiling, this variable has the same value as the
+:variable:`CMAKE_HOST_SYSTEM_PROCESSOR` variable. In many cases,
+this will correspond to the target architecture for the build, but
+this is not guaranteed. (E.g. on Windows, the host may be ``AMD64``
+even when using a MSVC ``cl`` compiler with a 32-bit target.)
-This variable is the same as :variable:`CMAKE_HOST_SYSTEM_PROCESSOR` if
-you build for the host system instead of the target system when
-cross compiling.
+When cross-compiling, a :variable:`CMAKE_TOOLCHAIN_FILE` should set
+the ``CMAKE_SYSTEM_PROCESSOR`` variable to match target architecture
+that it specifies (via :variable:`CMAKE_<LANG>_COMPILER` and perhaps
+:variable:`CMAKE_<LANG>_COMPILER_TARGET`).
diff --git a/Help/variable/CMAKE_UNITY_BUILD_UNIQUE_ID.rst b/Help/variable/CMAKE_UNITY_BUILD_UNIQUE_ID.rst
new file mode 100644
index 000000000..64ef18ab8
--- /dev/null
+++ b/Help/variable/CMAKE_UNITY_BUILD_UNIQUE_ID.rst
@@ -0,0 +1,8 @@
+CMAKE_UNITY_BUILD_UNIQUE_ID
+---------------------------
+
+.. versionadded:: 3.20
+
+This variable is used to initialize the :prop_tgt:`UNITY_BUILD_UNIQUE_ID`
+property of targets when they are created. It specifies the name of the
+unique identifier generated per file in a unity build.
diff --git a/Help/variable/CMAKE_XCODE_ATTRIBUTE_an-attribute.rst b/Help/variable/CMAKE_XCODE_ATTRIBUTE_an-attribute.rst
index 90e4c0eac..ffa0a4c7a 100644
--- a/Help/variable/CMAKE_XCODE_ATTRIBUTE_an-attribute.rst
+++ b/Help/variable/CMAKE_XCODE_ATTRIBUTE_an-attribute.rst
@@ -5,8 +5,14 @@ CMAKE_XCODE_ATTRIBUTE_<an-attribute>
Set Xcode target attributes directly.
-Tell the :generator:`Xcode` generator to set '<an-attribute>' to a given value
-in the generated Xcode project. Ignored on other generators.
+Tell the :generator:`Xcode` generator to set ``<an-attribute>`` to a given
+value in the generated Xcode project. Ignored on other generators.
+
+This offers low-level control over the generated Xcode project file.
+It is meant as a last resort for specifying settings that CMake does
+not otherwise have a way to control. Although this can override a
+setting CMake normally produces on its own, doing so bypasses CMake's
+model of the project and can break things.
See the :prop_tgt:`XCODE_ATTRIBUTE_<an-attribute>` target property
to set attributes on a specific target.
diff --git a/Help/variable/CTEST_MEMORYCHECK_SANITIZER_OPTIONS.rst b/Help/variable/CTEST_MEMORYCHECK_SANITIZER_OPTIONS.rst
index 6cd51fa18..b6fee2efe 100644
--- a/Help/variable/CTEST_MEMORYCHECK_SANITIZER_OPTIONS.rst
+++ b/Help/variable/CTEST_MEMORYCHECK_SANITIZER_OPTIONS.rst
@@ -5,3 +5,8 @@ CTEST_MEMORYCHECK_SANITIZER_OPTIONS
Specify the CTest ``MemoryCheckSanitizerOptions`` setting
in a :manual:`ctest(1)` dashboard client script.
+
+CTest prepends correct sanitizer options ``*_OPTIONS``
+environment variable to executed command. CTests adds
+its own ``log_path`` to sanitizer options, don't provide your
+own ``log_path``.
diff --git a/Help/variable/MSVC.rst b/Help/variable/MSVC.rst
index ca8775cb3..a2dbc2eb0 100644
--- a/Help/variable/MSVC.rst
+++ b/Help/variable/MSVC.rst
@@ -1,8 +1,7 @@
MSVC
----
-Set to ``true`` when the compiler is some version of Microsoft Visual
-C++ or another compiler simulating Visual C++. Any compiler defining
-``_MSC_VER`` is considered simulating Visual C++.
+Set to ``true`` when the compiler is some version of Microsoft Visual C++
+or another compiler simulating the Visual C++ ``cl`` command-line syntax.
See also the :variable:`MSVC_VERSION` variable.
diff --git a/Help/variable/MSVC_IDE.rst b/Help/variable/MSVC_IDE.rst
index 027d1bc8c..18e99833d 100644
--- a/Help/variable/MSVC_IDE.rst
+++ b/Help/variable/MSVC_IDE.rst
@@ -5,3 +5,10 @@ MSVC_IDE
Set to ``true`` when the target platform is the Microsoft Visual C++ IDE, as
opposed to the command line compiler.
+
+.. note::
+
+ This variable is only available after compiler detection has been performed,
+ so it is not available to toolchain files or before the first
+ :command:`project` or :command:`enable_language` call which uses an
+ MSVC-like compiler.