summaryrefslogtreecommitdiff
path: root/Help
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2021-10-08 09:13:45 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2021-10-08 09:13:45 +0900
commitfa10a4a91520c9add2283a053dd755a7e5db9f4b (patch)
treeb4c33311cdf36a37e72e3c4bd013e59b42a815f6 /Help
parent4ca455f44f42bf3257fe1ce752ca7447e9568a27 (diff)
downloadcmake-fa10a4a91520c9add2283a053dd755a7e5db9f4b.tar.gz
cmake-fa10a4a91520c9add2283a053dd755a7e5db9f4b.tar.bz2
cmake-fa10a4a91520c9add2283a053dd755a7e5db9f4b.zip
Imported Upstream version 3.14.1upstream/3.14.1
Diffstat (limited to 'Help')
-rw-r--r--Help/command/FIND_XXX.txt2
-rw-r--r--Help/command/add_compile_definitions.rst4
-rw-r--r--Help/command/add_compile_options.rst43
-rw-r--r--Help/command/add_custom_command.rst6
-rw-r--r--Help/command/add_custom_target.rst2
-rw-r--r--Help/command/add_definitions.rst4
-rw-r--r--Help/command/add_dependencies.rst4
-rw-r--r--Help/command/add_executable.rst6
-rw-r--r--Help/command/add_library.rst10
-rw-r--r--Help/command/add_link_options.rst4
-rw-r--r--Help/command/add_subdirectory.rst7
-rw-r--r--Help/command/add_test.rst10
-rw-r--r--Help/command/aux_source_directory.rst2
-rw-r--r--Help/command/break.rst4
-rw-r--r--Help/command/build_name.rst2
-rw-r--r--Help/command/cmake_host_system_information.rst2
-rw-r--r--Help/command/cmake_minimum_required.rst16
-rw-r--r--Help/command/cmake_parse_arguments.rst22
-rw-r--r--Help/command/cmake_policy.rst12
-rw-r--r--Help/command/configure_file.rst22
-rw-r--r--Help/command/continue.rst6
-rw-r--r--Help/command/create_test_sourcelist.rst2
-rw-r--r--Help/command/ctest_build.rst4
-rw-r--r--Help/command/ctest_submit.rst11
-rw-r--r--Help/command/define_property.rst4
-rw-r--r--Help/command/else.rst4
-rw-r--r--Help/command/elseif.rst9
-rw-r--r--Help/command/enable_language.rst6
-rw-r--r--Help/command/enable_testing.rst2
-rw-r--r--Help/command/endforeach.rst8
-rw-r--r--Help/command/endfunction.rst8
-rw-r--r--Help/command/endif.rst8
-rw-r--r--Help/command/endmacro.rst8
-rw-r--r--Help/command/endwhile.rst8
-rw-r--r--Help/command/exec_program.rst4
-rw-r--r--Help/command/execute_process.rst6
-rw-r--r--Help/command/export.rst10
-rw-r--r--Help/command/export_library_dependencies.rst2
-rw-r--r--Help/command/file.rst90
-rw-r--r--Help/command/find_package.rst28
-rw-r--r--Help/command/fltk_wrap_ui.rst2
-rw-r--r--Help/command/foreach.rst99
-rw-r--r--Help/command/function.rst88
-rw-r--r--Help/command/get_cmake_property.rst12
-rw-r--r--Help/command/get_directory_property.rst6
-rw-r--r--Help/command/get_filename_component.rst37
-rw-r--r--Help/command/get_property.rst20
-rw-r--r--Help/command/get_source_file_property.rst4
-rw-r--r--Help/command/get_target_property.rst4
-rw-r--r--Help/command/get_test_property.rst2
-rw-r--r--Help/command/if.rst120
-rw-r--r--Help/command/include.rst10
-rw-r--r--Help/command/include_directories.rst2
-rw-r--r--Help/command/include_external_msproject.rst2
-rw-r--r--Help/command/include_guard.rst2
-rw-r--r--Help/command/include_regular_expression.rst4
-rw-r--r--Help/command/install.rst176
-rw-r--r--Help/command/install_files.rst4
-rw-r--r--Help/command/install_programs.rst4
-rw-r--r--Help/command/install_targets.rst4
-rw-r--r--Help/command/link_directories.rst4
-rw-r--r--Help/command/link_libraries.rst2
-rw-r--r--Help/command/list.rst60
-rw-r--r--Help/command/load_cache.rst11
-rw-r--r--Help/command/load_command.rst2
-rw-r--r--Help/command/macro.rst138
-rw-r--r--Help/command/make_directory.rst4
-rw-r--r--Help/command/mark_as_advanced.rst27
-rw-r--r--Help/command/math.rst40
-rw-r--r--Help/command/message.rst2
-rw-r--r--Help/command/option.rst15
-rw-r--r--Help/command/output_required_files.rst2
-rw-r--r--Help/command/project.rst147
-rw-r--r--Help/command/qt_wrap_cpp.rst21
-rw-r--r--Help/command/qt_wrap_ui.rst18
-rw-r--r--Help/command/remove.rst4
-rw-r--r--Help/command/remove_definitions.rst4
-rw-r--r--Help/command/return.rst7
-rw-r--r--Help/command/separate_arguments.rst46
-rw-r--r--Help/command/set.rst29
-rw-r--r--Help/command/set_directory_properties.rst10
-rw-r--r--Help/command/set_property.rst36
-rw-r--r--Help/command/set_source_files_properties.rst10
-rw-r--r--Help/command/set_target_properties.rst4
-rw-r--r--Help/command/set_tests_properties.rst11
-rw-r--r--Help/command/site_name.rst2
-rw-r--r--Help/command/source_group.rst2
-rw-r--r--Help/command/string.rst46
-rw-r--r--Help/command/subdir_depends.rst2
-rw-r--r--Help/command/subdirs.rst4
-rw-r--r--Help/command/target_compile_definitions.rst4
-rw-r--r--Help/command/target_compile_features.rst4
-rw-r--r--Help/command/target_compile_options.rst32
-rw-r--r--Help/command/target_include_directories.rst4
-rw-r--r--Help/command/target_link_directories.rst4
-rw-r--r--Help/command/target_link_libraries.rst14
-rw-r--r--Help/command/target_link_options.rst4
-rw-r--r--Help/command/target_sources.rst4
-rw-r--r--Help/command/try_compile.rst60
-rw-r--r--Help/command/try_run.rst23
-rw-r--r--Help/command/unset.rst21
-rw-r--r--Help/command/use_mangled_mesa.rst2
-rw-r--r--Help/command/utility_source.rst2
-rw-r--r--Help/command/variable_requires.rst2
-rw-r--r--Help/command/variable_watch.rst14
-rw-r--r--Help/command/while.rst24
-rw-r--r--Help/command/write_file.rst4
-rw-r--r--Help/cpack_gen/deb.rst32
-rw-r--r--Help/cpack_gen/freebsd.rst2
-rw-r--r--Help/cpack_gen/nuget.rst2
-rw-r--r--Help/cpack_gen/rpm.rst4
-rw-r--r--Help/dev/README.rst2
-rw-r--r--Help/dev/documentation.rst530
-rw-r--r--Help/dev/review.rst27
-rw-r--r--Help/dev/source.rst20
-rw-r--r--Help/envvar/ASM_DIALECT.rst2
-rw-r--r--Help/envvar/ASM_DIALECTFLAGS.rst2
-rw-r--r--Help/envvar/CC.rst2
-rw-r--r--Help/envvar/CFLAGS.rst2
-rw-r--r--Help/envvar/CMAKE_BUILD_PARALLEL_LEVEL.rst2
-rw-r--r--Help/envvar/CMAKE_CONFIG_TYPE.rst2
-rw-r--r--Help/envvar/CMAKE_MSVCIDE_RUN_PATH.rst2
-rw-r--r--Help/envvar/CMAKE_NO_VERBOSE.rst8
-rw-r--r--Help/envvar/CMAKE_OSX_ARCHITECTURES.rst2
-rw-r--r--Help/envvar/CSFLAGS.rst2
-rw-r--r--Help/envvar/CTEST_INTERACTIVE_DEBUG_MODE.rst2
-rw-r--r--Help/envvar/CTEST_OUTPUT_ON_FAILURE.rst2
-rw-r--r--Help/envvar/CTEST_PARALLEL_LEVEL.rst2
-rw-r--r--Help/envvar/CTEST_PROGRESS_OUTPUT.rst2
-rw-r--r--Help/envvar/CTEST_USE_LAUNCHERS_DEFAULT.rst2
-rw-r--r--Help/envvar/CUDACXX.rst2
-rw-r--r--Help/envvar/CUDAFLAGS.rst2
-rw-r--r--Help/envvar/CUDAHOSTCXX.rst2
-rw-r--r--Help/envvar/CXX.rst2
-rw-r--r--Help/envvar/CXXFLAGS.rst2
-rw-r--r--Help/envvar/DASHBOARD_TEST_FROM_CTEST.rst2
-rw-r--r--Help/envvar/DESTDIR.rst2
-rw-r--r--Help/envvar/ENV_VAR.txt3
-rw-r--r--Help/envvar/FC.rst2
-rw-r--r--Help/envvar/FFLAGS.rst2
-rw-r--r--Help/envvar/LDFLAGS.rst2
-rw-r--r--Help/envvar/MACOSX_DEPLOYMENT_TARGET.rst2
-rw-r--r--Help/envvar/PackageName_ROOT.rst2
-rw-r--r--Help/envvar/RC.rst2
-rw-r--r--Help/envvar/RCFLAGS.rst2
-rw-r--r--Help/envvar/VERBOSE.rst10
-rw-r--r--Help/generator/Green Hills MULTI.rst41
-rw-r--r--Help/generator/VS_TOOLSET_HOST_ARCH.txt7
-rw-r--r--Help/generator/Visual Studio 10 2010.rst2
-rw-r--r--Help/generator/Visual Studio 11 2012.rst2
-rw-r--r--Help/generator/Visual Studio 12 2013.rst5
-rw-r--r--Help/generator/Visual Studio 14 2015.rst5
-rw-r--r--Help/generator/Visual Studio 15 2017.rst5
-rw-r--r--Help/generator/Visual Studio 16 2019.rst53
-rw-r--r--Help/generator/Visual Studio 9 2008.rst2
-rw-r--r--Help/generator/Xcode.rst4
-rw-r--r--Help/index.rst1
-rw-r--r--Help/manual/ccmake.1.rst2
-rw-r--r--Help/manual/cmake-buildsystem.7.rst1
-rw-r--r--Help/manual/cmake-commands.7.rst14
-rw-r--r--Help/manual/cmake-developer.7.rst676
-rw-r--r--Help/manual/cmake-env-variables.7.rst10
-rw-r--r--Help/manual/cmake-file-api.7.rst1111
-rw-r--r--Help/manual/cmake-generator-expressions.7.rst422
-rw-r--r--Help/manual/cmake-generators.7.rst5
-rw-r--r--Help/manual/cmake-gui.1.rst11
-rw-r--r--Help/manual/cmake-language.7.rst81
-rw-r--r--Help/manual/cmake-modules.7.rst106
-rw-r--r--Help/manual/cmake-policies.7.rst14
-rw-r--r--Help/manual/cmake-properties.7.rst31
-rw-r--r--Help/manual/cmake-qt.7.rst39
-rw-r--r--Help/manual/cmake-toolchains.7.rst129
-rw-r--r--Help/manual/cmake-variables.7.rst82
-rw-r--r--Help/manual/cmake.1.rst279
-rw-r--r--Help/manual/cpack.1.rst40
-rw-r--r--Help/manual/ctest.1.rst131
-rw-r--r--Help/module/CheckFortranSourceRuns.rst1
-rw-r--r--Help/module/CheckPIESupported.rst1
-rw-r--r--Help/module/FindFontconfig.rst1
-rw-r--r--Help/module/FindLibinput.rst1
-rw-r--r--Help/module/FindSQLite3.rst1
-rw-r--r--Help/policy/CMP0049.rst8
-rw-r--r--Help/policy/CMP0078.rst2
-rw-r--r--Help/policy/CMP0082.rst26
-rw-r--r--Help/policy/CMP0083.rst63
-rw-r--r--Help/policy/CMP0084.rst26
-rw-r--r--Help/policy/CMP0085.rst21
-rw-r--r--Help/policy/CMP0086.rst20
-rw-r--r--Help/policy/CMP0087.rst29
-rw-r--r--Help/policy/CMP0088.rst29
-rw-r--r--Help/prop_dir/BUILDSYSTEM_TARGETS.rst2
-rw-r--r--Help/prop_dir/COMPILE_OPTIONS.rst2
-rw-r--r--Help/prop_dir/EXCLUDE_FROM_ALL.rst6
-rw-r--r--Help/prop_dir/LINK_DIRECTORIES.rst2
-rw-r--r--Help/prop_dir/LINK_OPTIONS.rst2
-rw-r--r--Help/prop_dir/SUBDIRECTORIES.rst2
-rw-r--r--Help/prop_dir/TESTS.rst2
-rw-r--r--Help/prop_gbl/CMAKE_ROLE.rst20
-rw-r--r--Help/prop_sf/COMPILE_OPTIONS.rst2
-rw-r--r--Help/prop_sf/INCLUDE_DIRECTORIES.rst2
-rw-r--r--Help/prop_sf/OBJECT_DEPENDS.rst2
-rw-r--r--Help/prop_tgt/ANDROID_NATIVE_LIB_DIRECTORIES.rst4
-rw-r--r--Help/prop_tgt/AUTOGEN_ORIGIN_DEPENDS.rst38
-rw-r--r--Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst21
-rw-r--r--Help/prop_tgt/AUTOMOC.rst11
-rw-r--r--Help/prop_tgt/AUTOMOC_EXECUTABLE.rst15
-rw-r--r--Help/prop_tgt/AUTOMOC_MACRO_NAMES.rst2
-rw-r--r--Help/prop_tgt/AUTORCC.rst9
-rw-r--r--Help/prop_tgt/AUTORCC_EXECUTABLE.rst15
-rw-r--r--Help/prop_tgt/AUTOUIC.rst9
-rw-r--r--Help/prop_tgt/AUTOUIC_EXECUTABLE.rst15
-rw-r--r--Help/prop_tgt/BUILD_RPATH.rst2
-rw-r--r--Help/prop_tgt/BUILD_RPATH_USE_ORIGIN.rst24
-rw-r--r--Help/prop_tgt/COMPILE_OPTIONS.rst2
-rw-r--r--Help/prop_tgt/CUDA_RESOLVE_DEVICE_SYMBOLS.rst12
-rw-r--r--Help/prop_tgt/EXCLUDE_FROM_ALL.rst15
-rw-r--r--Help/prop_tgt/GHS_INTEGRITY_APP.rst10
-rw-r--r--Help/prop_tgt/GHS_NO_SOURCE_GROUP_FILE.rst13
-rw-r--r--Help/prop_tgt/IMPORTED_OBJECTS.rst2
-rw-r--r--Help/prop_tgt/INTERFACE_POSITION_INDEPENDENT_CODE.rst6
-rw-r--r--Help/prop_tgt/LANG_CLANG_TIDY.rst2
-rw-r--r--Help/prop_tgt/LANG_COMPILER_LAUNCHER.rst2
-rw-r--r--Help/prop_tgt/LANG_CPPCHECK.rst6
-rw-r--r--Help/prop_tgt/LANG_CPPLINT.rst2
-rw-r--r--Help/prop_tgt/LANG_INCLUDE_WHAT_YOU_USE.rst2
-rw-r--r--Help/prop_tgt/LINK_DIRECTORIES.rst2
-rw-r--r--Help/prop_tgt/LINK_OPTIONS.rst2
-rw-r--r--Help/prop_tgt/POSITION_INDEPENDENT_CODE.rst5
-rw-r--r--Help/prop_tgt/STATIC_LIBRARY_OPTIONS.rst2
-rw-r--r--Help/prop_tgt/VS_SDK_REFERENCES.rst2
-rw-r--r--Help/prop_tgt/WIN32_EXECUTABLE.rst11
-rw-r--r--Help/release/3.13.rst9
-rw-r--r--Help/release/3.14.rst393
-rw-r--r--Help/release/3.6.rst2
-rw-r--r--Help/release/index.rst1
-rw-r--r--Help/variable/CACHE.rst5
-rw-r--r--Help/variable/CMAKE_APPBUNDLE_PATH.rst2
-rw-r--r--Help/variable/CMAKE_ARGC.rst6
-rw-r--r--Help/variable/CMAKE_ARGV0.rst4
-rw-r--r--Help/variable/CMAKE_AUTOGEN_ORIGIN_DEPENDS.rst11
-rw-r--r--Help/variable/CMAKE_AUTOMOC_MACRO_NAMES.rst2
-rw-r--r--Help/variable/CMAKE_BUILD_RPATH.rst2
-rw-r--r--Help/variable/CMAKE_BUILD_RPATH_USE_ORIGIN.rst7
-rw-r--r--Help/variable/CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES.rst2
-rw-r--r--Help/variable/CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS.rst10
-rw-r--r--Help/variable/CMAKE_FIND_ROOT_PATH.rst2
-rw-r--r--Help/variable/CMAKE_FRAMEWORK_PATH.rst2
-rw-r--r--Help/variable/CMAKE_GENERATOR_TOOLSET.rst4
-rw-r--r--Help/variable/CMAKE_GHS_NO_SOURCE_GROUP_FILE.rst6
-rw-r--r--Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET.rst26
-rw-r--r--Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET_NAME.rst13
-rw-r--r--Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET.rst18
-rw-r--r--Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET_NAME.rst13
-rw-r--r--Help/variable/CMAKE_HOME_DIRECTORY.rst7
-rw-r--r--Help/variable/CMAKE_IGNORE_PATH.rst2
-rw-r--r--Help/variable/CMAKE_INCLUDE_PATH.rst2
-rw-r--r--Help/variable/CMAKE_LANG_COMPILER_ID.rst3
-rw-r--r--Help/variable/CMAKE_LANG_CREATE_SHARED_LIBRARY.rst3
-rw-r--r--Help/variable/CMAKE_LANG_CREATE_SHARED_MODULE.rst3
-rw-r--r--Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_CONFIG.rst5
-rw-r--r--Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_DEBUG.rst5
-rw-r--r--Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_MINSIZEREL.rst5
-rw-r--r--Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_RELEASE.rst5
-rw-r--r--Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_RELWITHDEBINFO.rst5
-rw-r--r--Help/variable/CMAKE_LANG_IMPLICIT_INCLUDE_DIRECTORIES.rst7
-rw-r--r--Help/variable/CMAKE_LANG_LINKER_WRAPPER_FLAG.rst2
-rw-r--r--Help/variable/CMAKE_LIBRARY_PATH.rst2
-rw-r--r--Help/variable/CMAKE_MACOSX_BUNDLE.rst3
-rw-r--r--Help/variable/CMAKE_MAXIMUM_RECURSION_DEPTH.rst33
-rw-r--r--Help/variable/CMAKE_MFC_FLAG.rst15
-rw-r--r--Help/variable/CMAKE_MODULE_PATH.rst2
-rw-r--r--Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst2
-rw-r--r--Help/variable/CMAKE_PREFIX_PATH.rst2
-rw-r--r--Help/variable/CMAKE_PROGRAM_PATH.rst2
-rw-r--r--Help/variable/CMAKE_SYSTEM_IGNORE_PATH.rst2
-rw-r--r--Help/variable/CMAKE_SYSTEM_INCLUDE_PATH.rst2
-rw-r--r--Help/variable/CMAKE_SYSTEM_LIBRARY_PATH.rst2
-rw-r--r--Help/variable/CMAKE_SYSTEM_PREFIX_PATH.rst2
-rw-r--r--Help/variable/CMAKE_SYSTEM_PROGRAM_PATH.rst2
-rw-r--r--Help/variable/CMAKE_Swift_LANGUAGE_VERSION.rst8
-rw-r--r--Help/variable/CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE.rst10
-rw-r--r--Help/variable/CMAKE_XCODE_GENERATE_SCHEME.rst25
-rw-r--r--Help/variable/CTEST_CUSTOM_TESTS_IGNORE.rst (renamed from Help/variable/CTEST_CUSTOM_TEST_IGNORE.rst)4
-rw-r--r--Help/variable/CTEST_SCP_COMMAND.rst3
-rw-r--r--Help/variable/CTEST_SUBMIT_URL.rst5
-rw-r--r--Help/variable/CTEST_TRIGGER_SITE.rst3
-rw-r--r--Help/variable/ENV.rst8
-rw-r--r--Help/variable/GHS-MULTI.rst2
-rw-r--r--Help/variable/IOS.rst4
-rw-r--r--Help/variable/MSVC_VERSION.rst1
-rw-r--r--Help/variable/MSYS.rst4
-rw-r--r--Help/variable/PackageName_ROOT.rst2
292 files changed, 5393 insertions, 1840 deletions
diff --git a/Help/command/FIND_XXX.txt b/Help/command/FIND_XXX.txt
index 73dbd5774..dde4dbbbc 100644
--- a/Help/command/FIND_XXX.txt
+++ b/Help/command/FIND_XXX.txt
@@ -96,7 +96,7 @@ If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows:
2. Search paths specified in cmake-specific cache variables.
These are intended to be used on the command line with a ``-DVAR=value``.
- The values are interpreted as :ref:`;-lists <CMake Language Lists>`.
+ The values are interpreted as :ref:`semicolon-separated lists <CMake Language Lists>`.
This can be skipped if ``NO_CMAKE_PATH`` is passed.
* |CMAKE_PREFIX_PATH_XXX|
diff --git a/Help/command/add_compile_definitions.rst b/Help/command/add_compile_definitions.rst
index 48815d44f..8225da783 100644
--- a/Help/command/add_compile_definitions.rst
+++ b/Help/command/add_compile_definitions.rst
@@ -1,9 +1,9 @@
add_compile_definitions
-----------------------
-Adds preprocessor definitions to the compilation of source files.
+Add preprocessor definitions to the compilation of source files.
-::
+.. code-block:: cmake
add_compile_definitions(<definition> ...)
diff --git a/Help/command/add_compile_options.rst b/Help/command/add_compile_options.rst
index 350a1c0bd..43805c3a9 100644
--- a/Help/command/add_compile_options.rst
+++ b/Help/command/add_compile_options.rst
@@ -1,21 +1,18 @@
add_compile_options
-------------------
-Adds options to the compilation of source files.
+Add options to the compilation of source files.
-::
+.. code-block:: cmake
add_compile_options(<option> ...)
-Adds options to the compiler command line for targets in the current
-directory and below that are added after this command is invoked.
-See documentation of the :prop_dir:`directory <COMPILE_OPTIONS>` and
-:prop_tgt:`target <COMPILE_OPTIONS>` ``COMPILE_OPTIONS`` properties.
+Adds options to the :prop_dir:`COMPILE_OPTIONS` directory property.
+These options are used when compiling targets from the current
+directory and below.
-This command can be used to add any options, but alternative commands
-exist to add preprocessor definitions (:command:`target_compile_definitions`
-and :command:`add_compile_definitions`) or include directories
-(:command:`target_include_directories` and :command:`include_directories`).
+Arguments
+^^^^^^^^^
Arguments to ``add_compile_options`` may use "generator expressions" with
the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
@@ -23,3 +20,29 @@ manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.
.. include:: OPTIONS_SHELL.txt
+
+Example
+^^^^^^^
+
+Since different compilers support different options, a typical use of
+this command is in a compiler-specific conditional clause:
+
+.. code-block:: cmake
+
+ if (MSVC)
+ # warning level 4 and all warnings as errors
+ add_compile_options(/W4 /WX)
+ else()
+ # lots of warnings and all warnings as errors
+ add_compile_options(-Wall -Wextra -pedantic -Werror)
+ endif()
+
+See Also
+^^^^^^^^
+
+This command can be used to add any options. However, for
+adding preprocessor definitions and include directories it is recommended
+to use the more specific commands :command:`add_compile_definitions`
+and :command:`include_directories`.
+
+The command :command:`target_compile_options` adds target-specific options.
diff --git a/Help/command/add_custom_command.rst b/Help/command/add_custom_command.rst
index 71fe49477..9bf0d8720 100644
--- a/Help/command/add_custom_command.rst
+++ b/Help/command/add_custom_command.rst
@@ -8,7 +8,9 @@ There are two main signatures for ``add_custom_command``.
Generating Files
^^^^^^^^^^^^^^^^
-The first signature is for adding a custom command to produce an output::
+The first signature is for adding a custom command to produce an output:
+
+.. code-block:: cmake
add_custom_command(OUTPUT output1 [output2 ...]
COMMAND command1 [ARGS] [args1...]
@@ -200,7 +202,7 @@ before or after building the target. The command becomes part of the
target and will only execute when the target itself is built. If the
target is already built, the command will not execute.
-::
+.. code-block:: cmake
add_custom_command(TARGET <target>
PRE_BUILD | PRE_LINK | POST_BUILD
diff --git a/Help/command/add_custom_target.rst b/Help/command/add_custom_target.rst
index a6b2f7773..c63dd230d 100644
--- a/Help/command/add_custom_target.rst
+++ b/Help/command/add_custom_target.rst
@@ -3,7 +3,7 @@ add_custom_target
Add a target with no output so it will always be built.
-::
+.. code-block:: cmake
add_custom_target(Name [ALL] [command1 [args1...]]
[COMMAND command2 [args2...] ...]
diff --git a/Help/command/add_definitions.rst b/Help/command/add_definitions.rst
index 1da15a61f..39a43f4f4 100644
--- a/Help/command/add_definitions.rst
+++ b/Help/command/add_definitions.rst
@@ -1,9 +1,9 @@
add_definitions
---------------
-Adds -D define flags to the compilation of source files.
+Add -D define flags to the compilation of source files.
-::
+.. code-block:: cmake
add_definitions(-DFOO -DBAR ...)
diff --git a/Help/command/add_dependencies.rst b/Help/command/add_dependencies.rst
index 7a6614328..de219a508 100644
--- a/Help/command/add_dependencies.rst
+++ b/Help/command/add_dependencies.rst
@@ -3,11 +3,11 @@ add_dependencies
Add a dependency between top-level targets.
-::
+.. code-block:: cmake
add_dependencies(<target> [<target-dependency>]...)
-Make a top-level ``<target>`` depend on other top-level targets to
+Makes a top-level ``<target>`` depend on other top-level targets to
ensure that they build before ``<target>`` does. A top-level target
is one created by one of the :command:`add_executable`,
:command:`add_library`, or :command:`add_custom_target` commands
diff --git a/Help/command/add_executable.rst b/Help/command/add_executable.rst
index c7a30d7f4..0a7d7e151 100644
--- a/Help/command/add_executable.rst
+++ b/Help/command/add_executable.rst
@@ -3,7 +3,7 @@ add_executable
Add an executable to the project using the specified source files.
-::
+.. code-block:: cmake
add_executable(<name> [WIN32] [MACOSX_BUNDLE]
[EXCLUDE_FROM_ALL]
@@ -47,7 +47,7 @@ within IDE.
--------------------------------------------------------------------------
-::
+.. code-block:: cmake
add_executable(<name> IMPORTED [GLOBAL])
@@ -67,7 +67,7 @@ properties for more information.
--------------------------------------------------------------------------
-::
+.. code-block:: cmake
add_executable(<name> ALIAS <target>)
diff --git a/Help/command/add_library.rst b/Help/command/add_library.rst
index c4c512c0e..ec6cb9d9a 100644
--- a/Help/command/add_library.rst
+++ b/Help/command/add_library.rst
@@ -10,7 +10,7 @@ Add a library to the project using the specified source files.
Normal Libraries
^^^^^^^^^^^^^^^^
-::
+.. code-block:: cmake
add_library(<name> [STATIC | SHARED | MODULE]
[EXCLUDE_FROM_ALL]
@@ -67,7 +67,7 @@ within IDE.
Imported Libraries
^^^^^^^^^^^^^^^^^^
-::
+.. code-block:: cmake
add_library(<name> <SHARED|STATIC|MODULE|OBJECT|UNKNOWN> IMPORTED
[GLOBAL])
@@ -92,7 +92,7 @@ for more information.
Object Libraries
^^^^^^^^^^^^^^^^
-::
+.. code-block:: cmake
add_library(<name> OBJECT <src>...)
@@ -121,7 +121,7 @@ consider adding at least one real source file to any target that references
Alias Libraries
^^^^^^^^^^^^^^^
-::
+.. code-block:: cmake
add_library(<name> ALIAS <target>)
@@ -141,7 +141,7 @@ installed or exported.
Interface Libraries
^^^^^^^^^^^^^^^^^^^
-::
+.. code-block:: cmake
add_library(<name> INTERFACE [IMPORTED [GLOBAL]])
diff --git a/Help/command/add_link_options.rst b/Help/command/add_link_options.rst
index e5fb87829..1b02beebe 100644
--- a/Help/command/add_link_options.rst
+++ b/Help/command/add_link_options.rst
@@ -1,9 +1,9 @@
add_link_options
----------------
-Adds options to the link of shared library, module and executable targets.
+Add options to the link of shared library, module and executable targets.
-::
+.. code-block:: cmake
add_link_options(<option> ...)
diff --git a/Help/command/add_subdirectory.rst b/Help/command/add_subdirectory.rst
index 012ded451..8dba986ba 100644
--- a/Help/command/add_subdirectory.rst
+++ b/Help/command/add_subdirectory.rst
@@ -3,12 +3,11 @@ add_subdirectory
Add a subdirectory to the build.
-::
+.. code-block:: cmake
- add_subdirectory(source_dir [binary_dir]
- [EXCLUDE_FROM_ALL])
+ add_subdirectory(source_dir [binary_dir] [EXCLUDE_FROM_ALL])
-Add a subdirectory to the build. The source_dir specifies the
+Adds a subdirectory to the build. The source_dir specifies the
directory in which the source CMakeLists.txt and code files are
located. If it is a relative path it will be evaluated with respect
to the current directory (the typical usage), but it may also be an
diff --git a/Help/command/add_test.rst b/Help/command/add_test.rst
index d8a96e9b9..a8c257d8b 100644
--- a/Help/command/add_test.rst
+++ b/Help/command/add_test.rst
@@ -3,13 +3,13 @@ add_test
Add a test to the project to be run by :manual:`ctest(1)`.
-::
+.. code-block:: cmake
add_test(NAME <name> COMMAND <command> [<arg>...]
[CONFIGURATIONS <config>...]
[WORKING_DIRECTORY <dir>])
-Add a test called ``<name>``. The test name may not contain spaces,
+Adds a test called ``<name>``. The test name may not contain spaces,
quotes, or other characters special in CMake syntax. The options are:
``COMMAND``
@@ -39,7 +39,9 @@ The ``COMMAND`` and ``WORKING_DIRECTORY`` options may use "generator
expressions" with the syntax ``$<...>``. See the
:manual:`cmake-generator-expressions(7)` manual for available expressions.
-Example usage::
+Example usage:
+
+.. code-block:: cmake
add_test(NAME mytest
COMMAND testDriver --config $<CONFIGURATION>
@@ -57,7 +59,7 @@ file produced by target ``myexe``.
---------------------------------------------------------------------
-::
+.. code-block:: cmake
add_test(<name> <command> [<arg>...])
diff --git a/Help/command/aux_source_directory.rst b/Help/command/aux_source_directory.rst
index dcd1cdfc3..e0af66591 100644
--- a/Help/command/aux_source_directory.rst
+++ b/Help/command/aux_source_directory.rst
@@ -3,7 +3,7 @@ aux_source_directory
Find all source files in a directory.
-::
+.. code-block:: cmake
aux_source_directory(<dir> <variable>)
diff --git a/Help/command/break.rst b/Help/command/break.rst
index fc2cd3c7b..4875a2bf2 100644
--- a/Help/command/break.rst
+++ b/Help/command/break.rst
@@ -3,10 +3,10 @@ break
Break from an enclosing foreach or while loop.
-::
+.. code-block:: cmake
break()
-Breaks from an enclosing foreach loop or while loop
+Breaks from an enclosing :command:`foreach` or :command:`while` loop.
See also the :command:`continue` command.
diff --git a/Help/command/build_name.rst b/Help/command/build_name.rst
index f717db1dd..2a1fbae62 100644
--- a/Help/command/build_name.rst
+++ b/Help/command/build_name.rst
@@ -1,7 +1,7 @@
build_name
----------
-Disallowed. See CMake Policy :policy:`CMP0036`.
+Disallowed since version 3.0. See CMake Policy :policy:`CMP0036`.
Use ``${CMAKE_SYSTEM}`` and ``${CMAKE_CXX_COMPILER}`` instead.
diff --git a/Help/command/cmake_host_system_information.rst b/Help/command/cmake_host_system_information.rst
index 2dee93ad5..2e9563aab 100644
--- a/Help/command/cmake_host_system_information.rst
+++ b/Help/command/cmake_host_system_information.rst
@@ -3,7 +3,7 @@ cmake_host_system_information
Query host system specific information.
-::
+.. code-block:: cmake
cmake_host_system_information(RESULT <variable> QUERY <key> ...)
diff --git a/Help/command/cmake_minimum_required.rst b/Help/command/cmake_minimum_required.rst
index 2f1ab6012..e6ebcf0db 100644
--- a/Help/command/cmake_minimum_required.rst
+++ b/Help/command/cmake_minimum_required.rst
@@ -1,11 +1,15 @@
cmake_minimum_required
----------------------
-Set the minimum required version of cmake for a project and
-update `Policy Settings`_ to match the version given::
+Require a minimum version of cmake.
+
+.. code-block:: cmake
cmake_minimum_required(VERSION <min>[...<max>] [FATAL_ERROR])
+Sets the minimum required version of cmake for a project.
+Also updates the policy settings as explained below.
+
``<min>`` and the optional ``<max>`` are each CMake versions of the form
``major.minor[.patch[.tweak]]``, and the ``...`` is literal.
@@ -47,13 +51,17 @@ as of a given CMake version and tells newer CMake versions to warn
about their new policies.
When a ``<min>`` version higher than 2.4 is specified the command
-implicitly invokes::
+implicitly invokes
+
+.. code-block:: cmake
cmake_policy(VERSION <min>[...<max>])
which sets CMake policies based on the range of versions specified.
When a ``<min>`` version 2.4 or lower is given the command implicitly
-invokes::
+invokes
+
+.. code-block:: cmake
cmake_policy(VERSION 2.4[...<max>])
diff --git a/Help/command/cmake_parse_arguments.rst b/Help/command/cmake_parse_arguments.rst
index efbef549e..c8327e286 100644
--- a/Help/command/cmake_parse_arguments.rst
+++ b/Help/command/cmake_parse_arguments.rst
@@ -1,26 +1,28 @@
cmake_parse_arguments
---------------------
-``cmake_parse_arguments`` is intended to be used in macros or functions for
-parsing the arguments given to that macro or function. It processes the
-arguments and defines a set of variables which hold the values of the
-respective options.
+Parse function or macro arguments.
-::
+.. code-block:: cmake
cmake_parse_arguments(<prefix> <options> <one_value_keywords>
- <multi_value_keywords> args...)
+ <multi_value_keywords> <args>...)
- cmake_parse_arguments(PARSE_ARGV N <prefix> <options> <one_value_keywords>
- <multi_value_keywords>)
+ cmake_parse_arguments(PARSE_ARGV <N> <prefix> <options>
+ <one_value_keywords> <multi_value_keywords>)
+
+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
+respective options.
-The first signature reads processes arguments passed in the ``args...``.
+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 Nth argument, where ``N`` is an unsigned integer. This allows for
+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,
diff --git a/Help/command/cmake_policy.rst b/Help/command/cmake_policy.rst
index c3f7cfb96..a80f98244 100644
--- a/Help/command/cmake_policy.rst
+++ b/Help/command/cmake_policy.rst
@@ -22,7 +22,9 @@ Setting Policies by CMake Version
The ``cmake_policy`` command is used to set policies to ``OLD`` or ``NEW``
behavior. While setting policies individually is supported, we
-encourage projects to set policies based on CMake versions::
+encourage projects to set policies based on CMake versions:
+
+.. code-block:: cmake
cmake_policy(VERSION <min>[...<max>])
@@ -50,7 +52,7 @@ command implicitly calls ``cmake_policy(VERSION)`` too.
Setting Policies Explicitly
^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
+.. code-block:: cmake
cmake_policy(SET CMP<NNNN> NEW)
cmake_policy(SET CMP<NNNN> OLD)
@@ -66,7 +68,7 @@ policy state to ``NEW``.
Checking Policy Settings
^^^^^^^^^^^^^^^^^^^^^^^^
-::
+.. code-block:: cmake
cmake_policy(GET CMP<NNNN> <variable>)
@@ -85,7 +87,9 @@ scripts loaded by :command:`include` and :command:`find_package` commands
except when invoked with the ``NO_POLICY_SCOPE`` option
(see also policy :policy:`CMP0011`).
The ``cmake_policy`` command provides an interface to manage custom
-entries on the policy stack::
+entries on the policy stack:
+
+.. code-block:: cmake
cmake_policy(PUSH)
cmake_policy(POP)
diff --git a/Help/command/configure_file.rst b/Help/command/configure_file.rst
index e08c57347..29e85bd16 100644
--- a/Help/command/configure_file.rst
+++ b/Help/command/configure_file.rst
@@ -3,7 +3,7 @@ configure_file
Copy a file to another location and modify its contents.
-::
+.. code-block:: cmake
configure_file(<input> <output>
[COPYONLY] [ESCAPE_QUOTES] [@ONLY]
@@ -13,15 +13,21 @@ Copies an ``<input>`` file to an ``<output>`` file and substitutes
variable values referenced as ``@VAR@`` or ``${VAR}`` in the input
file content. Each variable reference will be replaced with the
current value of the variable, or the empty string if the variable
-is not defined. Furthermore, input lines of the form::
+is not defined. Furthermore, input lines of the form
+
+.. code-block:: c
#cmakedefine VAR ...
-will be replaced with either::
+will be replaced with either
+
+.. code-block:: c
#define VAR ...
-or::
+or
+
+.. code-block:: c
/* #undef VAR */
@@ -33,12 +39,16 @@ 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::
+indentation will be preserved in the output lines:
+
+.. code-block:: c
# cmakedefine VAR
# cmakedefine01 VAR
-will be replaced, if ``VAR`` is defined, with::
+will be replaced, if ``VAR`` is defined, with
+
+.. code-block:: c
# define VAR
# define VAR 1
diff --git a/Help/command/continue.rst b/Help/command/continue.rst
index 1c7d6730c..31c7089a1 100644
--- a/Help/command/continue.rst
+++ b/Help/command/continue.rst
@@ -3,10 +3,12 @@ continue
Continue to the top of enclosing foreach or while loop.
-::
+.. code-block:: cmake
continue()
The ``continue`` command allows a cmake script to abort the rest of a block
in a :command:`foreach` or :command:`while` loop, and start at the top of
-the next iteration. See also the :command:`break` command.
+the next iteration.
+
+See also the :command:`break` command.
diff --git a/Help/command/create_test_sourcelist.rst b/Help/command/create_test_sourcelist.rst
index dde6812e1..77e37c50f 100644
--- a/Help/command/create_test_sourcelist.rst
+++ b/Help/command/create_test_sourcelist.rst
@@ -3,7 +3,7 @@ create_test_sourcelist
Create a test driver and source list for building test programs.
-::
+.. code-block:: cmake
create_test_sourcelist(sourceListName driverName
test1 test2 test3
diff --git a/Help/command/ctest_build.rst b/Help/command/ctest_build.rst
index 55bb4a317..66e1844e9 100644
--- a/Help/command/ctest_build.rst
+++ b/Help/command/ctest_build.rst
@@ -50,9 +50,7 @@ The options are:
for an example.
``PROJECT_NAME <project-name>``
- Set the name of the project to build. This should correspond
- to the top-level call to the :command:`project` command.
- If not specified the ``CTEST_PROJECT_NAME`` variable will be checked.
+ Ignored. This was once used but is no longer needed.
``TARGET <target-name>``
Specify the name of a target to build. If not specified the
diff --git a/Help/command/ctest_submit.rst b/Help/command/ctest_submit.rst
index 2ba6bef3d..fba03fd58 100644
--- a/Help/command/ctest_submit.rst
+++ b/Help/command/ctest_submit.rst
@@ -6,6 +6,7 @@ Perform the :ref:`CTest Submit Step` as a :ref:`Dashboard Client`.
::
ctest_submit([PARTS <part>...] [FILES <file>...]
+ [SUBMIT_URL <url>]
[HTTPHEADER <header>]
[RETRY_COUNT <count>]
[RETRY_DELAY <delay>]
@@ -33,11 +34,16 @@ The options are:
ExtraFiles = Files listed by CTEST_EXTRA_SUBMIT_FILES
Upload = Files prepared for upload by ctest_upload(), in Upload.xml
Submit = nothing
+ Done = Build is complete, in Done.xml
``FILES <file>...``
Specify an explicit list of specific files to be submitted.
Each individual file must exist at the time of the call.
+``SUBMIT_URL <url>``
+ 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.
+
``HTTPHEADER <HTTP-header>``
Specify HTTP header to be included in the request to CDash during submission.
This suboption can be repeated several times.
@@ -67,6 +73,7 @@ Submit to CDash Upload API
::
ctest_submit(CDASH_UPLOAD <file> [CDASH_UPLOAD_TYPE <type>]
+ [SUBMIT_URL <url>]
[HTTPHEADER <header>]
[RETRY_COUNT <count>]
[RETRY_DELAY <delay>]
@@ -79,5 +86,5 @@ 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 ``HTTPHEADER``, ``RETRY_COUNT``, ``RETRY_DELAY``,
-``RETURN_VALUE`` and ``QUIET`` options as described above.
+This signature accepts the ``SUBMIT_URL``, ``HTTPHEADER``, ``RETRY_COUNT``,
+``RETRY_DELAY``, ``RETURN_VALUE`` and ``QUIET`` options as described above.
diff --git a/Help/command/define_property.rst b/Help/command/define_property.rst
index da2631c09..8f7439bbe 100644
--- a/Help/command/define_property.rst
+++ b/Help/command/define_property.rst
@@ -3,7 +3,7 @@ define_property
Define and document custom properties.
-::
+.. code-block:: cmake
define_property(<GLOBAL | DIRECTORY | TARGET | SOURCE |
TEST | VARIABLE | CACHED_VARIABLE>
@@ -11,7 +11,7 @@ Define and document custom properties.
BRIEF_DOCS <brief-doc> [docs...]
FULL_DOCS <full-doc> [docs...])
-Define one property in a scope for use with the :command:`set_property` and
+Defines one property in a scope for use with the :command:`set_property` and
:command:`get_property` commands. This is primarily useful to associate
documentation with property names that may be retrieved with the
:command:`get_property` command. The first argument determines the kind of
diff --git a/Help/command/else.rst b/Help/command/else.rst
index 0e5a19810..a98fcd88e 100644
--- a/Help/command/else.rst
+++ b/Help/command/else.rst
@@ -3,8 +3,8 @@ else
Starts the else portion of an if block.
-::
+.. code-block:: cmake
- else(expression)
+ else([<condition>])
See the :command:`if` command.
diff --git a/Help/command/elseif.rst b/Help/command/elseif.rst
index 9a8dfed1d..6bf8646fb 100644
--- a/Help/command/elseif.rst
+++ b/Help/command/elseif.rst
@@ -1,10 +1,11 @@
elseif
------
-Starts the elseif portion of an if block.
+Starts an elseif portion of an if block.
-::
+.. code-block:: cmake
- elseif(expression)
+ elseif(<condition>)
-See the :command:`if` command.
+See the :command:`if` command, especially for the syntax and logic
+of the ``<condition>``.
diff --git a/Help/command/enable_language.rst b/Help/command/enable_language.rst
index 61dfc0351..fb49b4432 100644
--- a/Help/command/enable_language.rst
+++ b/Help/command/enable_language.rst
@@ -3,12 +3,12 @@ enable_language
Enable a language (CXX/C/Fortran/etc)
-::
+.. code-block:: cmake
enable_language(<lang> [OPTIONAL] )
-This command enables support for the named language in CMake. This is
-the same as the project command but does not create any of the extra
+Enables support for the named language in CMake. This is
+the same as the :command:`project` command but does not create any of the extra
variables that are created by the project command. Example languages
are ``CXX``, ``C``, ``CUDA``, ``Fortran``, and ``ASM``.
diff --git a/Help/command/enable_testing.rst b/Help/command/enable_testing.rst
index 1e3e2799c..e2028d21b 100644
--- a/Help/command/enable_testing.rst
+++ b/Help/command/enable_testing.rst
@@ -3,7 +3,7 @@ enable_testing
Enable testing for current directory and below.
-::
+.. code-block:: cmake
enable_testing()
diff --git a/Help/command/endforeach.rst b/Help/command/endforeach.rst
index 9af972bee..fd923d56a 100644
--- a/Help/command/endforeach.rst
+++ b/Help/command/endforeach.rst
@@ -3,8 +3,12 @@ endforeach
Ends a list of commands in a foreach block.
-::
+.. code-block:: cmake
- endforeach(expression)
+ endforeach([<loop_var>])
See the :command:`foreach` command.
+
+The optional ``<loop_var>`` argument is supported for backward compatibility
+only. If used it must be a verbatim repeat of the ``<loop_var>`` argument of
+the opening ``foreach`` clause.
diff --git a/Help/command/endfunction.rst b/Help/command/endfunction.rst
index 6cc196cde..e27129d8a 100644
--- a/Help/command/endfunction.rst
+++ b/Help/command/endfunction.rst
@@ -3,8 +3,12 @@ endfunction
Ends a list of commands in a function block.
-::
+.. code-block:: cmake
- endfunction(expression)
+ endfunction([<name>])
See the :command:`function` command.
+
+The optional ``<name>`` argument is supported for backward compatibility
+only. If used it must be a verbatim repeat of the ``<name>`` argument
+of the opening ``function`` command.
diff --git a/Help/command/endif.rst b/Help/command/endif.rst
index a0163bf33..fc4f03822 100644
--- a/Help/command/endif.rst
+++ b/Help/command/endif.rst
@@ -3,8 +3,12 @@ endif
Ends a list of commands in an if block.
-::
+.. code-block:: cmake
- endif(expression)
+ endif([<condition>])
See the :command:`if` command.
+
+The optional ``<condition>`` argument is supported for backward compatibility
+only. If used it must be a verbatim repeat of the argument of the opening
+``if`` clause.
diff --git a/Help/command/endmacro.rst b/Help/command/endmacro.rst
index 47327a783..4290ba748 100644
--- a/Help/command/endmacro.rst
+++ b/Help/command/endmacro.rst
@@ -3,8 +3,12 @@ endmacro
Ends a list of commands in a macro block.
-::
+.. code-block:: cmake
- endmacro(expression)
+ endmacro([<name>])
See the :command:`macro` command.
+
+The optional ``<name>`` argument is supported for backward compatibility
+only. If used it must be a verbatim repeat of the ``<name>`` argument
+of the opening ``macro`` command.
diff --git a/Help/command/endwhile.rst b/Help/command/endwhile.rst
index 798c20e71..5ef585bdc 100644
--- a/Help/command/endwhile.rst
+++ b/Help/command/endwhile.rst
@@ -3,8 +3,12 @@ endwhile
Ends a list of commands in a while block.
-::
+.. code-block:: cmake
- endwhile(expression)
+ endwhile([<condition>])
See the :command:`while` command.
+
+The optional ``<condition>`` argument is supported for backward compatibility
+only. If used it must be a verbatim repeat of the argument of the opening
+``while`` clause.
diff --git a/Help/command/exec_program.rst b/Help/command/exec_program.rst
index 6dfdad394..bc9b06916 100644
--- a/Help/command/exec_program.rst
+++ b/Help/command/exec_program.rst
@@ -1,7 +1,9 @@
exec_program
------------
-Deprecated. Use the :command:`execute_process` command instead.
+.. deprecated:: 3.0
+
+ Use the :command:`execute_process` command instead.
Run an executable program during the processing of the CMakeList.txt
file.
diff --git a/Help/command/execute_process.rst b/Help/command/execute_process.rst
index 716f45790..3a56dce97 100644
--- a/Help/command/execute_process.rst
+++ b/Help/command/execute_process.rst
@@ -5,8 +5,8 @@ Execute one or more child processes.
.. code-block:: cmake
- execute_process(COMMAND <cmd1> [args1...]]
- [COMMAND <cmd2> [args2...] [...]]
+ execute_process(COMMAND <cmd1> [<arguments>]
+ [COMMAND <cmd2> [<arguments>]]...
[WORKING_DIRECTORY <directory>]
[TIMEOUT <seconds>]
[RESULT_VARIABLE <variable>]
@@ -56,7 +56,7 @@ Options:
``RESULTS_VARIABLE <variable>``
The variable will be set to contain the result of all processes as a
- :ref:`;-list <CMake Language Lists>`, in order of the given ``COMMAND``
+ :ref:`semicolon-separated list <CMake Language Lists>`, in order of the given ``COMMAND``
arguments. Each entry will be an integer return code from the
corresponding child or a string describing an error condition.
diff --git a/Help/command/export.rst b/Help/command/export.rst
index 8c4932848..b255ee84e 100644
--- a/Help/command/export.rst
+++ b/Help/command/export.rst
@@ -3,11 +3,11 @@ export
Export targets from the build tree for use by outside projects.
-::
+.. code-block:: cmake
export(EXPORT <export-name> [NAMESPACE <namespace>] [FILE <filename>])
-Create a file ``<filename>`` that may be included by outside projects to
+Creates a file ``<filename>`` that may be included by outside projects to
import targets from the current project's build tree. This is useful
during cross-compiling to build utility executables that can run on
the host platform in one project and then import them into another
@@ -25,7 +25,7 @@ export targets from an installation tree.
The properties set on the generated IMPORTED targets will have the
same values as the final values of the input TARGETS.
-::
+.. code-block:: cmake
export(TARGETS [target1 [target2 [...]]] [NAMESPACE <namespace>]
[APPEND] FILE <filename> [EXPORT_LINK_INTERFACE_LIBRARIES])
@@ -49,7 +49,7 @@ unspecified.
transitive usage requirements of other targets that link to the
object libraries in their implementation.
-::
+.. code-block:: cmake
export(PACKAGE <PackageName>)
@@ -65,7 +65,7 @@ wide installations, it is not desirable to write the user package
registry. If the :variable:`CMAKE_EXPORT_NO_PACKAGE_REGISTRY` variable
is enabled, the ``export(PACKAGE)`` command will do nothing.
-::
+.. code-block:: cmake
export(TARGETS [target1 [target2 [...]]] [ANDROID_MK <filename>])
diff --git a/Help/command/export_library_dependencies.rst b/Help/command/export_library_dependencies.rst
index 2cb437e77..9753abf54 100644
--- a/Help/command/export_library_dependencies.rst
+++ b/Help/command/export_library_dependencies.rst
@@ -1,7 +1,7 @@
export_library_dependencies
---------------------------
-Disallowed. See CMake Policy :policy:`CMP0033`.
+Disallowed since version 3.0. See CMake Policy :policy:`CMP0033`.
Use :command:`install(EXPORT)` or :command:`export` command.
diff --git a/Help/command/file.rst b/Help/command/file.rst
index d4a60062d..465e56743 100644
--- a/Help/command/file.rst
+++ b/Help/command/file.rst
@@ -25,6 +25,9 @@ Synopsis
file({`REMOVE`_ | `REMOVE_RECURSE`_ } [<files>...])
file(`MAKE_DIRECTORY`_ [<dir>...])
file({`COPY`_ | `INSTALL`_} <file>... DESTINATION <dir> [...])
+ file(`SIZE`_ <filename> <out-var>)
+ file(`READ_SYMLINK`_ <linkname> <out-var>)
+ file(`CREATE_LINK`_ <original> <linkname> [...])
`Path Conversion`_
file(`RELATIVE_PATH`_ <out-var> <directory> <file>)
@@ -42,7 +45,7 @@ Reading
.. _READ:
-::
+.. code-block:: cmake
file(READ <filename> <variable>
[OFFSET <offset>] [LIMIT <max-in>] [HEX])
@@ -54,7 +57,7 @@ be converted to a hexadecimal representation (useful for binary data).
.. _STRINGS:
-::
+.. code-block:: cmake
file(STRINGS <filename> <variable> [<options>...])
@@ -105,7 +108,7 @@ from the input file.
.. _HASH:
-::
+.. code-block:: cmake
file(<HASH> <filename> <variable>)
@@ -116,7 +119,7 @@ command.
.. _TIMESTAMP:
-::
+.. code-block:: cmake
file(TIMESTAMP <filename> <variable> [<format>] [UTC])
@@ -133,7 +136,7 @@ Writing
.. _WRITE:
.. _APPEND:
-::
+.. code-block:: cmake
file(WRITE <filename> <content>...)
file(APPEND <filename> <content>...)
@@ -150,7 +153,7 @@ to update the file only when its content changes.
.. _TOUCH:
.. _TOUCH_NOCREATE:
-::
+.. code-block:: cmake
file(TOUCH [<files>...])
file(TOUCH_NOCREATE [<files>...])
@@ -167,7 +170,7 @@ modified.
.. _GENERATE:
-::
+.. code-block:: cmake
file(GENERATE OUTPUT output-file
<INPUT input-file|CONTENT content>
@@ -217,7 +220,7 @@ Filesystem
.. _GLOB:
.. _GLOB_RECURSE:
-::
+.. code-block:: cmake
file(GLOB <variable>
[LIST_DIRECTORIES true|false] [RELATIVE <path>] [CONFIGURE_DEPENDS]
@@ -272,7 +275,7 @@ Examples of recursive globbing include::
.. _RENAME:
-::
+.. code-block:: cmake
file(RENAME <oldname> <newname>)
@@ -282,7 +285,7 @@ Move a file or directory within a filesystem from ``<oldname>`` to
.. _REMOVE:
.. _REMOVE_RECURSE:
-::
+.. code-block:: cmake
file(REMOVE [<files>...])
file(REMOVE_RECURSE [<files>...])
@@ -293,7 +296,7 @@ given file does not exist.
.. _MAKE_DIRECTORY:
-::
+.. code-block:: cmake
file(MAKE_DIRECTORY [<directories>...])
@@ -302,7 +305,7 @@ Create the given directories and their parents as needed.
.. _COPY:
.. _INSTALL:
-::
+.. code-block:: cmake
file(<COPY|INSTALL> <files>... DESTINATION <dir>
[FILE_PERMISSIONS <permissions>...]
@@ -333,12 +336,67 @@ and ``NO_SOURCE_PERMISSIONS`` is default.
Installation scripts generated by the :command:`install` command
use this signature (with some undocumented options for internal use).
+.. _SIZE:
+
+.. code-block:: cmake
+
+ file(SIZE <filename> <variable>)
+
+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.
+
+.. _READ_SYMLINK:
+
+.. code-block:: cmake
+
+ file(READ_SYMLINK <linkname> <variable>)
+
+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.
+
+Note that this command returns the raw symlink path and does not resolve
+a relative path. The following is an example of how to ensure that an
+absolute path is obtained:
+
+.. code-block:: cmake
+
+ set(linkname "/path/to/foo.sym")
+ file(READ_SYMLINK "${linkname}" result)
+ if(NOT IS_ABSOLUTE "${result}")
+ get_filename_component(dir "${linkname}" DIRECTORY)
+ set(result "${dir}/${result}")
+ endif()
+
+.. _CREATE_LINK:
+
+.. code-block:: cmake
+
+ file(CREATE_LINK <original> <linkname>
+ [RESULT <result>] [COPY_ON_ERROR] [SYMBOLIC])
+
+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``
+exists and is a file, not a directory. If ``<linkname>`` already exists,
+it will be overwritten.
+
+The ``<result>`` variable, if specified, receives the status of the operation.
+It is set to ``0`` upon success or an error message otherwise. If ``RESULT``
+is not specified and the operation fails, a fatal error is emitted.
+
+Specifying ``COPY_ON_ERROR`` enables copying the file as a fallback if
+creating the link fails. It can be useful for handling situations such as
+``<original>`` and ``<linkname>`` being on different drives or mount points,
+which would make them unable to support a hard link.
+
Path Conversion
^^^^^^^^^^^^^^^
.. _RELATIVE_PATH:
-::
+.. code-block:: cmake
file(RELATIVE_PATH <variable> <directory> <file>)
@@ -348,7 +406,7 @@ store it in the ``<variable>``.
.. _TO_CMAKE_PATH:
.. _TO_NATIVE_PATH:
-::
+.. code-block:: cmake
file(TO_CMAKE_PATH "<path>" <variable>)
file(TO_NATIVE_PATH "<path>" <variable>)
@@ -370,7 +428,7 @@ Transfer
.. _DOWNLOAD:
.. _UPLOAD:
-::
+.. code-block:: cmake
file(DOWNLOAD <url> <file> [<options>...])
file(UPLOAD <file> <url> [<options>...])
@@ -460,7 +518,7 @@ Locking
.. _LOCK:
-::
+.. code-block:: cmake
file(LOCK <path> [DIRECTORY] [RELEASE]
[GUARD <FUNCTION|FILE|PROCESS>]
diff --git a/Help/command/find_package.rst b/Help/command/find_package.rst
index 3ad571cdb..54d5f68fe 100644
--- a/Help/command/find_package.rst
+++ b/Help/command/find_package.rst
@@ -12,7 +12,7 @@ Find an external project, and load its settings.
Basic Signature and Module Mode
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
+.. code-block:: cmake
find_package(<PackageName> [version] [EXACT] [QUIET] [MODULE]
[REQUIRED] [[COMPONENTS] [components...]]
@@ -23,9 +23,9 @@ Finds and loads settings from an external project. ``<PackageName>_FOUND``
will be set to indicate whether the package was found. When the
package is found package-specific information is provided through
variables and :ref:`Imported Targets` documented by the package itself. The
-``QUIET`` option disables messages if the package cannot be found. The
-``REQUIRED`` option stops processing with an error message if the package
-cannot be found.
+``QUIET`` option disables informational messages, including those indicating
+that the package cannot be found if it is not ``REQUIRED``. The ``REQUIRED``
+option stops processing with an error message if the package cannot be found.
A package-specific list of required components may be listed after the
``COMPONENTS`` option (or after the ``REQUIRED`` option if present).
@@ -51,8 +51,9 @@ mode and "Config" mode. The above signature selects Module mode.
If no module is found the command falls back to Config mode, described
below. This fall back is disabled if the ``MODULE`` option is given.
-In Module mode, CMake searches for a file called ``Find<PackageName>.cmake``
-in the :variable:`CMAKE_MODULE_PATH` followed by the CMake installation.
+In Module mode, CMake searches for a file called ``Find<PackageName>.cmake``.
+The file is first searched in the :variable:`CMAKE_MODULE_PATH`,
+then among the :ref:`Find Modules` provided by the CMake installation.
If the file is found, it is read and processed by CMake. It is responsible
for finding the package, checking the version, and producing any needed
messages. Some find-modules provide limited or no support for versioning;
@@ -67,7 +68,9 @@ full command signature and details of the search process. Project
maintainers wishing to provide a package to be found by this command
are encouraged to read on.
-The complete Config mode command signature is::
+The complete Config mode command signature is
+
+.. code-block:: cmake
find_package(<PackageName> [version] [EXACT] [QUIET]
[REQUIRED] [[COMPONENTS] [components...]]
@@ -202,7 +205,9 @@ is set no attempt is made to choose a highest or closest version number.
To control the order in which ``find_package`` checks for compatibility use
the two variables :variable:`CMAKE_FIND_PACKAGE_SORT_ORDER` and
:variable:`CMAKE_FIND_PACKAGE_SORT_DIRECTION`.
-For instance in order to select the highest version one can set::
+For instance in order to select the highest version one can set
+
+.. code-block:: cmake
SET(CMAKE_FIND_PACKAGE_SORT_ORDER NATURAL)
SET(CMAKE_FIND_PACKAGE_SORT_DIRECTION DEC)
@@ -286,7 +291,7 @@ enabled.
2. Search paths specified in cmake-specific cache variables. These
are intended to be used on the command line with a ``-DVAR=value``.
- The values are interpreted as :ref:`;-lists <CMake Language Lists>`.
+ The values are interpreted as :ref:`semicolon-separated lists <CMake Language Lists>`.
This can be skipped if ``NO_CMAKE_PATH`` is passed::
CMAKE_PREFIX_PATH
@@ -349,6 +354,11 @@ enabled.
.. include:: FIND_XXX_ROOT.txt
.. include:: FIND_XXX_ORDER.txt
+By default the value stored in the result variable will be the path at
+which the file is found. The :variable:`CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS`
+variable may be set to ``TRUE`` before calling ``find_package`` in order
+to resolve symbolic links and store the real path to the file.
+
Every non-REQUIRED ``find_package`` call can be disabled by setting the
:variable:`CMAKE_DISABLE_FIND_PACKAGE_<PackageName>` variable to ``TRUE``.
diff --git a/Help/command/fltk_wrap_ui.rst b/Help/command/fltk_wrap_ui.rst
index 041e5a7e3..66752729d 100644
--- a/Help/command/fltk_wrap_ui.rst
+++ b/Help/command/fltk_wrap_ui.rst
@@ -3,7 +3,7 @@ fltk_wrap_ui
Create FLTK user interfaces Wrappers.
-::
+.. code-block:: cmake
fltk_wrap_ui(resultingLibraryName source1
source2 ... sourceN )
diff --git a/Help/command/foreach.rst b/Help/command/foreach.rst
index 106ba7318..ae2afb290 100644
--- a/Help/command/foreach.rst
+++ b/Help/command/foreach.rst
@@ -3,45 +3,82 @@ foreach
Evaluate a group of commands for each value in a list.
-::
+.. code-block:: cmake
- foreach(loop_var arg1 arg2 ...)
- COMMAND1(ARGS ...)
- COMMAND2(ARGS ...)
- ...
- endforeach(loop_var)
+ foreach(<loop_var> <items>)
+ <commands>
+ endforeach()
-All commands between foreach and the matching endforeach are recorded
-without being invoked. Once the endforeach is evaluated, the recorded
-list of commands is invoked once for each argument listed in the
-original foreach command. Before each iteration of the loop
-``${loop_var}`` will be set as a variable with the current value in the
-list.
+where ``<items>`` is a list of items that are separated by
+semicolon or whitespace.
+All commands between ``foreach`` and the matching ``endforeach`` are recorded
+without being invoked. Once the ``endforeach`` is evaluated, the recorded
+list of commands is invoked once for each item in ``<items>``.
+At the beginning of each iteration the variable ``loop_var`` will be set
+to the value of the current item.
-::
+The commands :command:`break` and :command:`continue` provide means to
+escape from the normal control flow.
- foreach(loop_var RANGE total)
- foreach(loop_var RANGE start stop [step])
+Per legacy, the :command:`endforeach` command admits
+an optional ``<loop_var>`` argument.
+If used, it must be a verbatim
+repeat of the argument of the opening
+``foreach`` command.
-Foreach can also iterate over a generated range of numbers. There are
-three types of this iteration:
+.. code-block:: cmake
-* When specifying single number, the range will have elements [0, ... to
- "total"] (inclusive).
+ foreach(<loop_var> RANGE <stop>)
-* When specifying two numbers, the range will have elements from the
- first number to the second number (inclusive).
+In this variant, ``foreach`` iterates over the numbers
+0, 1, ... up to (and including) the nonnegative integer ``<stop>``.
-* The third optional number is the increment used to iterate from the
- first number to the second number (inclusive).
+.. code-block:: cmake
-::
+ foreach(<loop_var> RANGE <start> <stop> [<step>])
+
+In this variant, ``foreach`` iterates over the numbers from
+``<start>`` up to at most ``<stop>`` in steps of ``<step>``.
+If ``<step>`` is not specified, then the step size is 1.
+The three arguments ``<start>`` ``<stop>`` ``<step>`` must
+all be nonnegative integers, and ``<stop>`` must not be
+smaller than ``<start>``; otherwise you enter the danger zone
+of undocumented behavior that may change in future releases.
+
+.. code-block:: cmake
+
+ foreach(loop_var IN [LISTS [<lists>]] [ITEMS [<items>]])
- foreach(loop_var IN [LISTS [list1 [...]]]
- [ITEMS [item1 [...]]])
+In this variant, ``<lists>`` is a whitespace or semicolon
+separated list of list-valued variables. The ``foreach``
+command iterates over each item in each given list.
+The ``<items>`` following the ``ITEMS`` keyword are processed
+as in the first variant of the ``foreach`` command.
+The forms ``LISTS A`` and ``ITEMS ${A}`` are
+equivalent.
+
+The following example shows how the ``LISTS`` option is
+processed:
+
+.. code-block:: cmake
+
+ set(A 0;1)
+ set(B 2 3)
+ set(C "4 5")
+ set(D 6;7 8)
+ set(E "")
+ foreach(X IN LISTS A B C D E)
+ message(STATUS "X=${X}")
+ endforeach()
+
+yields
+::
-Iterates over a precise list of items. The ``LISTS`` option names
-list-valued variables to be traversed, including empty elements (an
-empty string is a zero-length list). (Note macro
-arguments are not variables.) The ``ITEMS`` option ends argument
-parsing and includes all arguments following it in the iteration.
+ -- X=0
+ -- X=1
+ -- X=2
+ -- X=3
+ -- X=4 5
+ -- X=6
+ -- X=7
+ -- X=8
diff --git a/Help/command/function.rst b/Help/command/function.rst
index 7ffdfee65..53ba75481 100644
--- a/Help/command/function.rst
+++ b/Help/command/function.rst
@@ -1,36 +1,70 @@
function
--------
-Start recording a function for later invocation as a command::
-
- function(<name> [arg1 [arg2 [arg3 ...]]])
- COMMAND1(ARGS ...)
- COMMAND2(ARGS ...)
- ...
- endfunction(<name>)
-
-Define a function named ``<name>`` that takes arguments named ``arg1``,
-``arg2``, ``arg3``, (...).
-Commands listed after function, but before the matching
-:command:`endfunction()`, are not invoked until the function is invoked.
-When it is invoked, the commands recorded in the function are first
-modified by replacing formal parameters (``${arg1}``) with the arguments
-passed, and then invoked as normal commands.
-In addition to referencing the formal parameters you can reference the
-``ARGC`` variable which will be set to the number of arguments passed
-into the function as well as ``ARGV0``, ``ARGV1``, ``ARGV2``, ... which
-will have the actual values of the arguments passed in.
-This facilitates creating functions with optional arguments.
-Additionally ``ARGV`` holds the list of all arguments given to the
-function and ``ARGN`` holds the list of arguments past the last expected
-argument.
-Referencing to ``ARGV#`` arguments beyond ``ARGC`` have undefined
-behavior. Checking that ``ARGC`` is greater than ``#`` is the only way
-to ensure that ``ARGV#`` was passed to the function as an extra
-argument.
+Start recording a function for later invocation as a command.
+
+.. code-block:: cmake
+
+ function(<name> [<arg1> ...])
+ <commands>
+ endfunction()
+
+Defines a function named ``<name>`` that takes arguments named
+``<arg1>``, ... The ``<commands>`` in the function definition
+are recorded; they are not executed until the function is invoked.
+
+Per legacy, the :command:`endfunction` command admits an optional
+``<name>`` argument. If used, it must be a verbatim repeat of the
+argument of the opening ``function`` command.
A function opens a new scope: see :command:`set(var PARENT_SCOPE)` for
details.
See the :command:`cmake_policy()` command documentation for the behavior
of policies inside functions.
+
+See the :command:`macro()` command documentation for differences
+between CMake functions and macros.
+
+Invocation
+^^^^^^^^^^
+
+The function invocation is case-insensitive. A function defined as
+
+.. code-block:: cmake
+
+ function(foo)
+ <commands>
+ endfunction()
+
+can be invoked through any of
+
+.. code-block:: cmake
+
+ foo()
+ Foo()
+ FOO()
+
+and so on. However, it is strongly recommended to stay with the
+case chosen in the function definition. Typically functions use
+all-lowercase names.
+
+Arguments
+^^^^^^^^^
+
+When the function is invoked, the recorded ``<commands>`` are first
+modified by replacing formal parameters (``${arg1}``, ...) with the
+arguments passed, and then invoked as normal commands.
+
+In addition to referencing the formal parameters you can reference the
+``ARGC`` variable which will be set to the number of arguments passed
+into the function as well as ``ARGV0``, ``ARGV1``, ``ARGV2``, ... which
+will have the actual values of the arguments passed in. This facilitates
+creating functions with optional arguments.
+
+Furthermore, ``ARGV`` holds the list of all arguments given to the
+function and ``ARGN`` holds the list of arguments past the last expected
+argument. Referencing to ``ARGV#`` arguments beyond ``ARGC`` have
+undefined behavior. Checking that ``ARGC`` is greater than ``#`` is
+the only way to ensure that ``ARGV#`` was passed to the function as an
+extra argument.
diff --git a/Help/command/get_cmake_property.rst b/Help/command/get_cmake_property.rst
index 497ab4eeb..58bf7412b 100644
--- a/Help/command/get_cmake_property.rst
+++ b/Help/command/get_cmake_property.rst
@@ -3,14 +3,14 @@ get_cmake_property
Get a global property of the CMake instance.
-::
+.. code-block:: cmake
- get_cmake_property(VAR property)
+ get_cmake_property(<var> <property>)
-Get a global property from the CMake instance. The value of the property is
-stored in the variable ``VAR``. If the property is not found, ``VAR``
-will be set to "NOTFOUND". See the :manual:`cmake-properties(7)` manual
-for available properties.
+Gets a global property from the CMake instance. The value of
+the ``<property>`` is stored in the variable ``<var>``.
+If the property is not found, ``<var>`` will be set to ``"NOTFOUND"``.
+See the :manual:`cmake-properties(7)` manual for available properties.
See also the :command:`get_property` command ``GLOBAL`` option.
diff --git a/Help/command/get_directory_property.rst b/Help/command/get_directory_property.rst
index bf8349cb1..218efa9d3 100644
--- a/Help/command/get_directory_property.rst
+++ b/Help/command/get_directory_property.rst
@@ -3,11 +3,11 @@ get_directory_property
Get a property of ``DIRECTORY`` scope.
-::
+.. code-block:: cmake
get_directory_property(<variable> [DIRECTORY <dir>] <prop-name>)
-Store a property of directory scope in the named ``<variable>``.
+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.
The specified directory must have already been traversed by CMake.
@@ -18,7 +18,7 @@ if the property is not found for the nominated directory scope,
the search will chain to a parent scope as described for the
:command:`define_property` command.
-::
+.. code-block:: cmake
get_directory_property(<variable> [DIRECTORY <dir>]
DEFINITION <var-name>)
diff --git a/Help/command/get_filename_component.rst b/Help/command/get_filename_component.rst
index f11c0fce6..9bbf87714 100644
--- a/Help/command/get_filename_component.rst
+++ b/Help/command/get_filename_component.rst
@@ -3,13 +3,11 @@ get_filename_component
Get a specific component of a full filename.
-------------------------------------------------------------------------------
+.. code-block:: cmake
-::
-
- get_filename_component(<VAR> <FileName> <COMP> [CACHE])
+ get_filename_component(<var> <FileName> <mode> [CACHE])
-Set ``<VAR>`` to a component of ``<FileName>``, where ``<COMP>`` is one of:
+Sets ``<var>`` to a component of ``<FileName>``, where ``<mode>`` is one of:
::
@@ -17,22 +15,19 @@ Set ``<VAR>`` to a component of ``<FileName>``, where ``<COMP>`` is one of:
NAME = File name without directory
EXT = File name longest extension (.b.c from d/a.b.c)
NAME_WE = File name without directory or longest extension
+ LAST_EXT = File name last extension (.c from d/a.b.c)
+ NAME_WLE = File name without directory or last extension
PATH = Legacy alias for DIRECTORY (use for CMake <= 2.8.11)
Paths are returned with forward slashes and have no trailing slashes.
-The longest file extension is always considered. If the optional
-``CACHE`` argument is specified, the result variable is added to the
-cache.
+If the optional ``CACHE`` argument is specified, the result variable is
+added to the cache.
-------------------------------------------------------------------------------
+.. code-block:: cmake
-::
+ get_filename_component(<var> <FileName> <mode> [BASE_DIR <dir>] [CACHE])
- get_filename_component(<VAR> <FileName>
- <COMP> [BASE_DIR <BASE_DIR>]
- [CACHE])
-
-Set ``<VAR>`` to the absolute path of ``<FileName>``, where ``<COMP>`` is one
+Sets ``<var>`` to the absolute path of ``<FileName>``, where ``<mode>`` is one
of:
::
@@ -41,7 +36,7 @@ of:
REALPATH = Full path to existing file with symlinks resolved
If the provided ``<FileName>`` is a relative path, it is evaluated relative
-to the given base directory ``<BASE_DIR>``. If no base directory is
+to the given base directory ``<dir>``. If no base directory is
provided, the default base directory will be
:variable:`CMAKE_CURRENT_SOURCE_DIR`.
@@ -49,16 +44,12 @@ 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.
-------------------------------------------------------------------------------
-
-::
+.. code-block:: cmake
- get_filename_component(<VAR> <FileName>
- PROGRAM [PROGRAM_ARGS <ARG_VAR>]
- [CACHE])
+ get_filename_component(<var> <FileName> PROGRAM [PROGRAM_ARGS <arg_var>] [CACHE])
The program in ``<FileName>`` will be found in the system search path or
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
+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.
diff --git a/Help/command/get_property.rst b/Help/command/get_property.rst
index 8b85f7d6f..c0f9b460a 100644
--- a/Help/command/get_property.rst
+++ b/Help/command/get_property.rst
@@ -3,32 +3,33 @@ get_property
Get a property.
-::
+.. code-block:: cmake
get_property(<variable>
<GLOBAL |
- DIRECTORY [dir] |
+ DIRECTORY [<dir>] |
TARGET <target> |
SOURCE <source> |
INSTALL <file> |
TEST <test> |
CACHE <entry> |
- VARIABLE>
+ VARIABLE >
PROPERTY <name>
[SET | DEFINED | BRIEF_DOCS | FULL_DOCS])
-Get one property from one object in a scope. The first argument
-specifies the variable in which to store the result. The second
-argument determines the scope from which to get the property. It must
-be one of the following:
+Gets one property from one object in a scope.
+
+The first argument specifies the variable in which to store the result.
+The second argument determines the scope from which to get the property.
+It must be one of the following:
``GLOBAL``
Scope is unique and does not accept a name.
``DIRECTORY``
Scope defaults to the current directory but another
- directory (already processed by CMake) may be named by full or
- relative path.
+ directory (already processed by CMake) may be named by the
+ full or relative path ``<dir>``.
``TARGET``
Scope must name one existing target.
@@ -58,6 +59,7 @@ value indicating whether the property has been set. If the ``DEFINED``
option is given the variable is set to a boolean value indicating
whether the property has been defined such as with the
:command:`define_property` command.
+
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
diff --git a/Help/command/get_source_file_property.rst b/Help/command/get_source_file_property.rst
index 51fbd33a6..decec1916 100644
--- a/Help/command/get_source_file_property.rst
+++ b/Help/command/get_source_file_property.rst
@@ -3,11 +3,11 @@ get_source_file_property
Get a property for a source file.
-::
+.. code-block:: cmake
get_source_file_property(VAR file property)
-Get a property from a source file. The value of the property is
+Gets a property from a source file. The value of the property is
stored in the variable ``VAR``. If the source property is not found, the
behavior depends on whether it has been defined to be an ``INHERITED`` property
or not (see :command:`define_property`). Non-inherited properties will set
diff --git a/Help/command/get_target_property.rst b/Help/command/get_target_property.rst
index 98e9db30a..43276811d 100644
--- a/Help/command/get_target_property.rst
+++ b/Help/command/get_target_property.rst
@@ -3,7 +3,7 @@ get_target_property
Get a property from a target.
-::
+.. code-block:: cmake
get_target_property(VAR target property)
@@ -23,3 +23,5 @@ target so far created. The targets do not need to be in the current
``CMakeLists.txt`` file.
See also the more general :command:`get_property` command.
+
+See :ref:`Target Properties` for the list of properties known to CMake.
diff --git a/Help/command/get_test_property.rst b/Help/command/get_test_property.rst
index 555c3b26d..e02b9bc77 100644
--- a/Help/command/get_test_property.rst
+++ b/Help/command/get_test_property.rst
@@ -3,7 +3,7 @@ get_test_property
Get a property of the test.
-::
+.. code-block:: cmake
get_test_property(test property VAR)
diff --git a/Help/command/if.rst b/Help/command/if.rst
index 5294ce8e3..a48a0faac 100644
--- a/Help/command/if.rst
+++ b/Help/command/if.rst
@@ -3,41 +3,49 @@ if
Conditionally execute a group of commands.
+Synopsis
+^^^^^^^^
+
.. code-block:: cmake
- if(expression)
- # then section.
- COMMAND1(ARGS ...)
- COMMAND2(ARGS ...)
- #...
- elseif(expression2)
- # elseif section.
- COMMAND1(ARGS ...)
- COMMAND2(ARGS ...)
- #...
- else(expression)
- # else section.
- COMMAND1(ARGS ...)
- COMMAND2(ARGS ...)
- #...
- endif(expression)
-
-Evaluates the given expression. If the result is true, the commands
-in the THEN section are invoked. Otherwise, the commands in the else
-section are invoked. The elseif and else sections are optional. You
-may have multiple elseif clauses. Note that the expression in the
-else and endif clause is optional. Long expressions can be used and
-there is a traditional order of precedence. Parenthetical expressions
-are evaluated first followed by unary tests such as ``EXISTS``,
-``COMMAND``, and ``DEFINED``. Then any binary tests such as
+ if(<condition>)
+ <commands>
+ elseif(<condition>) # optional block, can be repeated
+ <commands>
+ else() # optional block
+ <commands>
+ endif()
+
+Evaluates the ``condition`` argument of the ``if`` clause according to the
+`Condition syntax`_ described below. If the result is true, then the
+``commands`` in the ``if`` block are executed.
+Otherwise, optional ``elseif`` blocks are processed in the same way.
+Finally, if no ``condition`` is true, ``commands`` in the optional ``else``
+block are executed.
+
+Per legacy, the :command:`else` and :command:`endif` commands admit
+an optional ``<condition>`` argument.
+If used, it must be a verbatim
+repeat of the argument of the opening
+``if`` command.
+
+Condition Syntax
+^^^^^^^^^^^^^^^^
+
+The following syntax applies to the ``condition`` argument of
+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`` will be evaluated. Then boolean ``NOT`` operators and
-finally boolean ``AND`` and then ``OR`` operators will be evaluated.
+and ``MATCHES``. Then the boolean operators in the order ``NOT``, ``AND``,
+and finally ``OR``.
-Possible expressions are:
+Possible conditions are:
``if(<constant>)``
True if the constant is ``1``, ``ON``, ``YES``, ``TRUE``, ``Y``,
@@ -52,14 +60,14 @@ Possible expressions 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.)
-``if(NOT <expression>)``
- True if the expression is not true.
+``if(NOT <condition>)``
+ True if the condition is not true.
-``if(<expr1> AND <expr2>)``
- True if both expressions would be considered true individually.
+``if(<cond1> AND <cond2>)``
+ True if both conditions would be considered true individually.
-``if(<expr1> OR <expr2>)``
- True if either expression would be considered true individually.
+``if(<cond1> OR <cond2>)``
+ True if either condition would be considered true individually.
``if(COMMAND command-name)``
True if the given name is a command, macro or function that can be
@@ -103,7 +111,7 @@ Possible expressions are:
``if(<variable|string> MATCHES regex)``
True if the given string or variable's value matches the given regular
- expression. See :ref:`Regex Specification` for regex format.
+ condition. See :ref:`Regex Specification` for regex format.
``()`` groups are captured in :variable:`CMAKE_MATCH_<n>` variables.
``if(<variable|string> LESS <variable|string>)``
@@ -179,42 +187,51 @@ Possible expressions are:
``if(<variable|string> IN_LIST <variable>)``
True if the given element is contained in the named list variable.
-``if(DEFINED <variable>)``
- True if the given variable is defined. It does not matter if the
- variable is true or false just if it has been set. (Note macro
- arguments are not variables.)
+``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.
-``if((expression) AND (expression OR (expression)))``
- The expressions inside the parenthesis are evaluated first and then
- the remaining expression is evaluated as in the previous examples.
+``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 expression that contains them.
+ of evaluating the condition that contains them.
+
+Variable Expansion
+^^^^^^^^^^^^^^^^^^
The if command was written very early in CMake's history, predating
the ``${}`` variable evaluation syntax, and for convenience evaluates
variables named by its arguments as shown in the above signatures.
Note that normal variable evaluation with ``${}`` applies before the if
-command even receives the arguments. Therefore code like::
+command even receives the arguments. Therefore code like
+
+.. code-block:: cmake
set(var1 OFF)
set(var2 "var1")
if(${var2})
-appears to the if command as::
+appears to the if command as
- if(var1)
+.. code-block:: cmake
+
+ if(var1)
and is evaluated according to the ``if(<variable>)`` case documented
above. The result is ``OFF`` which is false. However, if we remove the
-``${}`` from the example then the command sees::
+``${}`` from the example then the command sees
+
+.. code-block:: cmake
- if(var2)
+ if(var2)
which is true because ``var2`` is defined to "var1" which is not a false
constant.
Automatic evaluation applies in the other cases whenever the
-above-documented signature accepts ``<variable|string>``:
+above-documented condition syntax accepts ``<variable|string>``:
* The left hand argument to ``MATCHES`` is first checked to see if it is
a defined variable, if so the variable's value is used, otherwise the
@@ -252,3 +269,8 @@ 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
+``$ENV{<name>}`` or ``$CACHE{<name>}`` wherever the above-documented
+condition syntax accepts ``<variable|string>``.
diff --git a/Help/command/include.rst b/Help/command/include.rst
index eeca4c6e3..80968da7b 100644
--- a/Help/command/include.rst
+++ b/Help/command/include.rst
@@ -3,16 +3,16 @@ include
Load and run CMake code from a file or module.
-::
+.. code-block:: cmake
- include(<file|module> [OPTIONAL] [RESULT_VARIABLE <VAR>]
+ include(<file|module> [OPTIONAL] [RESULT_VARIABLE <var>]
[NO_POLICY_SCOPE])
-Load and run CMake code from the file given. Variable reads and
+Loads and runs CMake code from the file given. Variable reads and
writes access the scope of the caller (dynamic scoping). If ``OPTIONAL``
is present, then no error is raised if the file does not exist. If
-``RESULT_VARIABLE`` is given the variable will be set to the full filename
-which has been included or NOTFOUND if it failed.
+``RESULT_VARIABLE`` is given the variable ``<var>`` will be set to the
+full filename which has been included or ``NOTFOUND`` if it failed.
If a module is specified instead of a file, the file with name
``<modulename>.cmake`` is searched first in :variable:`CMAKE_MODULE_PATH`,
diff --git a/Help/command/include_directories.rst b/Help/command/include_directories.rst
index e797b5df1..fe281c3c8 100644
--- a/Help/command/include_directories.rst
+++ b/Help/command/include_directories.rst
@@ -3,7 +3,7 @@ include_directories
Add include directories to the build.
-::
+.. code-block:: cmake
include_directories([AFTER|BEFORE] [SYSTEM] dir1 [dir2 ...])
diff --git a/Help/command/include_external_msproject.rst b/Help/command/include_external_msproject.rst
index 335282a30..375baf2f9 100644
--- a/Help/command/include_external_msproject.rst
+++ b/Help/command/include_external_msproject.rst
@@ -3,7 +3,7 @@ include_external_msproject
Include an external Microsoft project file in a workspace.
-::
+.. code-block:: cmake
include_external_msproject(projectname location
[TYPE projectTypeGUID]
diff --git a/Help/command/include_guard.rst b/Help/command/include_guard.rst
index 62cce2215..877aa86d9 100644
--- a/Help/command/include_guard.rst
+++ b/Help/command/include_guard.rst
@@ -3,7 +3,7 @@ include_guard
Provides an include guard for the file currently being processed by CMake.
-::
+.. code-block:: cmake
include_guard([DIRECTORY|GLOBAL])
diff --git a/Help/command/include_regular_expression.rst b/Help/command/include_regular_expression.rst
index ab5a56325..dde837892 100644
--- a/Help/command/include_regular_expression.rst
+++ b/Help/command/include_regular_expression.rst
@@ -3,11 +3,11 @@ include_regular_expression
Set the regular expression used for dependency checking.
-::
+.. code-block:: cmake
include_regular_expression(regex_match [regex_complain])
-Set the regular expressions used in dependency checking. Only files
+Sets the regular expressions used in dependency checking. Only files
matching ``regex_match`` will be traced as dependencies. Only files
matching ``regex_complain`` will generate warnings if they cannot be found
(standard header paths are not searched). The defaults are:
diff --git a/Help/command/install.rst b/Help/command/install.rst
index 98074d0b6..6910d6df0 100644
--- a/Help/command/install.rst
+++ b/Help/command/install.rst
@@ -9,11 +9,11 @@ Synopsis
.. parsed-literal::
install(`TARGETS`_ <target>... [...])
- install({`FILES`_ | `PROGRAMS`_} <file>... DESTINATION <dir> [...])
- install(`DIRECTORY`_ <dir>... DESTINATION <dir> [...])
+ install({`FILES`_ | `PROGRAMS`_} <file>... [...])
+ install(`DIRECTORY`_ <dir>... [...])
install(`SCRIPT`_ <file> [...])
install(`CODE`_ <code> [...])
- install(`EXPORT`_ <export-name> DESTINATION <dir> [...])
+ install(`EXPORT`_ <export-name> [...])
Introduction
^^^^^^^^^^^^
@@ -101,7 +101,7 @@ Installing Targets
.. _TARGETS:
-::
+.. code-block:: cmake
install(TARGETS targets... [EXPORT <export-name>]
[[ARCHIVE|LIBRARY|RUNTIME|OBJECTS|FRAMEWORK|BUNDLE|
@@ -172,6 +172,54 @@ installation properties apply to all target types. If only one is given then
only targets of that type will be installed (which can be used to install
just a DLL or just an import library.)
+For regular executables, static libraries and shared libraries, the
+``DESTINATION`` argument is not required. For these target types, when
+``DESTINATION`` is omitted, a default destination will be taken from the
+appropriate variable from :module:`GNUInstallDirs`, or set to a built-in
+default value if that variable is not defined. The same is true for the
+public and private headers associated with the installed targets through the
+:prop_tgt:`PUBLIC_HEADER` and :prop_tgt:`PRIVATE_HEADER` target properties.
+A destination must always be provided for module libraries, Apple bundles and
+frameworks. A destination can be omitted for interface and object libraries,
+but they are handled differently (see the discussion of this topic toward the
+end of this section).
+
+The following table shows the target types with their associated variables and
+built-in defaults that apply when no destination is given:
+
+================== =============================== ======================
+ Target Type GNUInstallDirs Variable Built-In Default
+================== =============================== ======================
+``RUNTIME`` ``${CMAKE_INSTALL_BINDIR}`` ``bin``
+``LIBRARY`` ``${CMAKE_INSTALL_LIBDIR}`` ``lib``
+``ARCHIVE`` ``${CMAKE_INSTALL_LIBDIR}`` ``lib``
+``PRIVATE_HEADER`` ``${CMAKE_INSTALL_INCLUDEDIR}`` ``include``
+``PUBLIC_HEADER`` ``${CMAKE_INSTALL_INCLUDEDIR}`` ``include``
+================== =============================== ======================
+
+Projects wishing to follow the common practice of installing headers into a
+project-specific subdirectory will need to provide a destination rather than
+rely on the above.
+
+To make packages compliant with distribution filesystem layout policies, if
+projects must specify a ``DESTINATION``, it is recommended that they use a
+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 following example shows a static library
+being installed to the default destination provided by
+:module:`GNUInstallDirs`, but with its headers installed to a project-specific
+subdirectory that follows the above recommendation:
+
+.. code-block:: cmake
+
+ add_library(mylib STATIC ...)
+ set_target_properties(mylib PROPERTIES PUBLIC_HEADER mylib.h)
+ include(GNUInstallDirs)
+ install(TARGETS mylib
+ PUBLIC_HEADER
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/myproj
+ )
+
In addition to the common options listed above, each target can accept
the following additional arguments:
@@ -195,11 +243,9 @@ the following additional arguments:
install(TARGETS mylib
LIBRARY
- DESTINATION lib
COMPONENT Libraries
NAMELINK_COMPONENT Development
PUBLIC_HEADER
- DESTINATION include
COMPONENT Development
)
@@ -295,7 +341,7 @@ targets from other directories are up-to-date. You can use
to ensure that such out-of-directory targets are built before the
subdirectory-specific install rules are run.
-The install destination given to the target install ``DESTINATION`` may
+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.
@@ -305,9 +351,10 @@ Installing Files
.. _FILES:
.. _PROGRAMS:
-::
+.. code-block:: cmake
- install(<FILES|PROGRAMS> files... DESTINATION <dir>
+ install(<FILES|PROGRAMS> files...
+ TYPE <type> | DESTINATION <dir>
[PERMISSIONS permissions...]
[CONFIGURATIONS [Debug|Release|...]]
[COMPONENT <component>]
@@ -331,7 +378,58 @@ The list of ``files...`` given to ``FILES`` or ``PROGRAMS`` may use
However, if any item begins in a generator expression it must evaluate
to a full path.
-The install destination given to the files install ``DESTINATION`` may
+Either a ``TYPE`` or a ``DESTINATION`` must be provided, but not both.
+A ``TYPE`` argument specifies the generic file type of the files being
+installed. A destination will then be set automatically by taking the
+corresponding variable from :module:`GNUInstallDirs`, or by using a
+built-in default if that variable is not defined. See the table below for
+the supported file types and their corresponding variables and built-in
+defaults. Projects can provide a ``DESTINATION`` argument instead of a
+file type if they wish to explicitly define the install destination.
+
+======================= ================================== =========================
+ ``TYPE`` Argument GNUInstallDirs Variable Built-In Default
+======================= ================================== =========================
+``BIN`` ``${CMAKE_INSTALL_BINDIR}`` ``bin``
+``SBIN`` ``${CMAKE_INSTALL_SBINDIR}`` ``sbin``
+``LIB`` ``${CMAKE_INSTALL_LIBDIR}`` ``lib``
+``INCLUDE`` ``${CMAKE_INSTALL_INCLUDEDIR}`` ``include``
+``SYSCONF`` ``${CMAKE_INSTALL_SYSCONFDIR}`` ``etc``
+``SHAREDSTATE`` ``${CMAKE_INSTALL_SHARESTATEDIR}`` ``com``
+``LOCALSTATE`` ``${CMAKE_INSTALL_LOCALSTATEDIR}`` ``var``
+``RUNSTATE`` ``${CMAKE_INSTALL_RUNSTATEDIR}`` ``<LOCALSTATE dir>/run``
+``DATA`` ``${CMAKE_INSTALL_DATADIR}`` ``<DATAROOT dir>``
+``INFO`` ``${CMAKE_INSTALL_INFODIR}`` ``<DATAROOT dir>/info``
+``LOCALE`` ``${CMAKE_INSTALL_LOCALEDIR}`` ``<DATAROOT dir>/locale``
+``MAN`` ``${CMAKE_INSTALL_MANDIR}`` ``<DATAROOT dir>/man``
+``DOC`` ``${CMAKE_INSTALL_DOCDIR}`` ``<DATAROOT dir>/doc``
+======================= ================================== =========================
+
+Projects wishing to follow the common practice of installing headers into a
+project-specific subdirectory will need to provide a destination rather than
+rely on the above.
+
+Note that some of the types' built-in defaults use the ``DATAROOT`` directory as
+a prefix. The ``DATAROOT`` prefix is calculated similarly to the types, with
+``CMAKE_INSTALL_DATAROOTDIR`` as the variable and ``share`` as the built-in
+default. You cannot use ``DATAROOT`` as a ``TYPE`` parameter; please use
+``DATA`` instead.
+
+To make packages compliant with distribution filesystem layout policies, if
+projects must specify a ``DESTINATION``, it is recommended that they use a
+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 following example shows how to follow
+this advice while installing headers to a project-specific subdirectory:
+
+.. code-block:: cmake
+
+ include(GNUInstallDirs)
+ install(FILES mylib.h
+ 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.
@@ -340,9 +438,10 @@ Installing Directories
.. _DIRECTORY:
-::
+.. code-block:: cmake
- install(DIRECTORY dirs... DESTINATION <dir>
+ install(DIRECTORY dirs...
+ TYPE <type> | DESTINATION <dir>
[FILE_PERMISSIONS permissions...]
[DIRECTORY_PERMISSIONS permissions...]
[USE_SOURCE_PERMISSIONS] [OPTIONAL] [MESSAGE_NEVER]
@@ -413,8 +512,48 @@ will install the ``icons`` directory to ``share/myproj/icons`` and the
file permissions, the scripts will be given specific permissions, and any
``CVS`` directories will be excluded.
-The list of ``dirs...`` given to ``DIRECTORY`` and the install destination
-given to the directory install ``DESTINATION`` may use "generator expressions"
+Either a ``TYPE`` or a ``DESTINATION`` must be provided, but not both.
+A ``TYPE`` argument specifies the generic file type of the files within the
+listed directories being installed. A destination will then be set
+automatically by taking the corresponding variable from
+:module:`GNUInstallDirs`, or by using a built-in default if that variable
+is not defined. See the table below for the supported file types and their
+corresponding variables and built-in defaults. Projects can provide a
+``DESTINATION`` argument instead of a file type if they wish to explicitly
+define the install destination.
+
+======================= ================================== =========================
+ ``TYPE`` Argument GNUInstallDirs Variable Built-In Default
+======================= ================================== =========================
+``BIN`` ``${CMAKE_INSTALL_BINDIR}`` ``bin``
+``SBIN`` ``${CMAKE_INSTALL_SBINDIR}`` ``sbin``
+``LIB`` ``${CMAKE_INSTALL_LIBDIR}`` ``lib``
+``INCLUDE`` ``${CMAKE_INSTALL_INCLUDEDIR}`` ``include``
+``SYSCONF`` ``${CMAKE_INSTALL_SYSCONFDIR}`` ``etc``
+``SHAREDSTATE`` ``${CMAKE_INSTALL_SHARESTATEDIR}`` ``com``
+``LOCALSTATE`` ``${CMAKE_INSTALL_LOCALSTATEDIR}`` ``var``
+``RUNSTATE`` ``${CMAKE_INSTALL_RUNSTATEDIR}`` ``<LOCALSTATE dir>/run``
+``DATA`` ``${CMAKE_INSTALL_DATADIR}`` ``<DATAROOT dir>``
+``INFO`` ``${CMAKE_INSTALL_INFODIR}`` ``<DATAROOT dir>/info``
+``LOCALE`` ``${CMAKE_INSTALL_LOCALEDIR}`` ``<DATAROOT dir>/locale``
+``MAN`` ``${CMAKE_INSTALL_MANDIR}`` ``<DATAROOT dir>/man``
+``DOC`` ``${CMAKE_INSTALL_DOCDIR}`` ``<DATAROOT dir>/doc``
+======================= ================================== =========================
+
+Note that some of the types' built-in defaults use the ``DATAROOT`` directory as
+a prefix. The ``DATAROOT`` prefix is calculated similarly to the types, with
+``CMAKE_INSTALL_DATAROOTDIR`` as the variable and ``share`` as the built-in
+default. You cannot use ``DATAROOT`` as a ``TYPE`` parameter; please use
+``DATA`` instead.
+
+To make packages compliant with distribution filesystem layout policies, if
+projects must specify a ``DESTINATION``, it is recommended that they use a
+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.
@@ -424,7 +563,7 @@ Custom Installation Logic
.. _CODE:
.. _SCRIPT:
-::
+.. code-block:: cmake
install([[SCRIPT <file>] [CODE <code>]]
[COMPONENT <component>] [EXCLUDE_FROM_ALL] [...])
@@ -442,12 +581,17 @@ 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.
+
Installing Exports
^^^^^^^^^^^^^^^^^^
.. _EXPORT:
-::
+.. code-block:: cmake
install(EXPORT <export-name> DESTINATION <dir>
[NAMESPACE <namespace>] [[FILE <name>.cmake]|
diff --git a/Help/command/install_files.rst b/Help/command/install_files.rst
index 1850be6e1..f5fb46d22 100644
--- a/Help/command/install_files.rst
+++ b/Help/command/install_files.rst
@@ -1,7 +1,9 @@
install_files
-------------
-Deprecated. Use the :command:`install(FILES)` command instead.
+.. deprecated:: 3.0
+
+ Use the :command:`install(FILES)` command instead.
This command has been superceded by the :command:`install` command. It is
provided for compatibility with older CMake code. The ``FILES`` form is
diff --git a/Help/command/install_programs.rst b/Help/command/install_programs.rst
index 79aa486a3..fab64820d 100644
--- a/Help/command/install_programs.rst
+++ b/Help/command/install_programs.rst
@@ -1,7 +1,9 @@
install_programs
----------------
-Deprecated. Use the :command:`install(PROGRAMS)` command instead.
+.. deprecated:: 3.0
+
+ Use the :command:`install(PROGRAMS)` command instead.
This command has been superceded by the :command:`install` command. It is
provided for compatibility with older CMake code. The ``FILES`` form is
diff --git a/Help/command/install_targets.rst b/Help/command/install_targets.rst
index 49ca69694..c9efdce67 100644
--- a/Help/command/install_targets.rst
+++ b/Help/command/install_targets.rst
@@ -1,7 +1,9 @@
install_targets
---------------
-Deprecated. Use the :command:`install(TARGETS)` command instead.
+.. deprecated:: 3.0
+
+ Use the :command:`install(TARGETS)` command instead.
This command has been superceded by the :command:`install` command. It is
provided for compatibility with older CMake code.
diff --git a/Help/command/link_directories.rst b/Help/command/link_directories.rst
index 1dce9a05a..9cb8faa74 100644
--- a/Help/command/link_directories.rst
+++ b/Help/command/link_directories.rst
@@ -3,11 +3,11 @@ link_directories
Add directories in which the linker will look for libraries.
-::
+.. code-block:: cmake
link_directories([AFTER|BEFORE] directory1 [directory2 ...])
-Add the paths in which the linker should search for libraries.
+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`.
diff --git a/Help/command/link_libraries.rst b/Help/command/link_libraries.rst
index fd5dc3723..8665cb789 100644
--- a/Help/command/link_libraries.rst
+++ b/Help/command/link_libraries.rst
@@ -3,7 +3,7 @@ link_libraries
Link libraries to all targets added later.
-::
+.. code-block:: cmake
link_libraries([item1 [item2 [...]]]
[[debug|optimized|general] <item>] ...)
diff --git a/Help/command/list.rst b/Help/command/list.rst
index 2357a9b8d..bfcdf34cd 100644
--- a/Help/command/list.rst
+++ b/Help/command/list.rst
@@ -64,7 +64,7 @@ Reading
.. _LENGTH:
-::
+.. code-block:: cmake
list(LENGTH <list> <output variable>)
@@ -72,7 +72,7 @@ Returns the list's length.
.. _GET:
-::
+.. code-block:: cmake
list(GET <list> <element index> [<element index> ...] <output variable>)
@@ -80,7 +80,7 @@ Returns the list of elements specified by indices from the list.
.. _JOIN:
-::
+.. code-block:: cmake
list(JOIN <list> <glue> <output variable>)
@@ -90,7 +90,7 @@ from :command:`string` command.
.. _SUBLIST:
-::
+.. code-block:: cmake
list(SUBLIST <list> <begin> <length> <output variable>)
@@ -104,7 +104,7 @@ Search
.. _FIND:
-::
+.. code-block:: cmake
list(FIND <list> <value> <output variable>)
@@ -116,7 +116,7 @@ Modification
.. _APPEND:
-::
+.. code-block:: cmake
list(APPEND <list> [<element> ...])
@@ -124,7 +124,7 @@ Appends elements to the list.
.. _FILTER:
-::
+.. code-block:: cmake
list(FILTER <list> <INCLUDE|EXCLUDE> REGEX <regular_expression>)
@@ -136,7 +136,7 @@ For more information on regular expressions see also the
.. _INSERT:
-::
+.. code-block:: cmake
list(INSERT <list> <element_index> <element> [<element> ...])
@@ -144,7 +144,7 @@ Inserts elements to the list to the specified location.
.. _REMOVE_ITEM:
-::
+.. code-block:: cmake
list(REMOVE_ITEM <list> <value> [<value> ...])
@@ -152,7 +152,7 @@ Removes the given items from the list.
.. _REMOVE_AT:
-::
+.. code-block:: cmake
list(REMOVE_AT <list> <index> [<index> ...])
@@ -160,7 +160,7 @@ Removes items at given indices from the list.
.. _REMOVE_DUPLICATES:
-::
+.. code-block:: cmake
list(REMOVE_DUPLICATES <list>)
@@ -168,7 +168,7 @@ Removes duplicated items in the list.
.. _TRANSFORM:
-::
+.. code-block:: cmake
list(TRANSFORM <list> <ACTION> [<SELECTOR>]
[OUTPUT_VARIABLE <output variable>])
@@ -190,30 +190,40 @@ The actions have exactly the same semantics as sub-commands of
The ``<ACTION>`` may be one of:
``APPEND``, ``PREPEND``: Append, prepend specified value to each element of
-the list. ::
+the list.
+
+.. code-block:: cmake
list(TRANSFORM <list> <APPEND|PREPEND> <value> ...)
``TOUPPER``, ``TOLOWER``: Convert each element of the list to upper, lower
-characters. ::
+characters.
+
+.. code-block:: cmake
list(TRANSFORM <list> <TOLOWER|TOUPPER> ...)
``STRIP``: Remove leading and trailing spaces from each element of the
-list. ::
+list.
+
+.. code-block:: cmake
list(TRANSFORM <list> STRIP ...)
``GENEX_STRIP``: Strip any
:manual:`generator expressions <cmake-generator-expressions(7)>` from each
-element of the list. ::
+element of the list.
+
+.. code-block:: cmake
list(TRANSFORM <list> GENEX_STRIP ...)
``REPLACE``: Match the regular expression as many times as possible and
substitute the replacement expression for the match for each element
of the list
-(Same semantic as ``REGEX REPLACE`` from :command:`string` command). ::
+(Same semantic as ``REGEX REPLACE`` from :command:`string` command).
+
+.. code-block:: cmake
list(TRANSFORM <list> REPLACE <regular_expression>
<replace_expression> ...)
@@ -223,17 +233,23 @@ type of selector can be specified at a time.
The ``<SELECTOR>`` may be one of:
-``AT``: Specify a list of indexes. ::
+``AT``: Specify a list of indexes.
+
+.. code-block:: cmake
list(TRANSFORM <list> <ACTION> AT <index> [<index> ...] ...)
``FOR``: Specify a range with, optionally, an increment used to iterate over
-the range. ::
+the range.
+
+.. code-block:: cmake
list(TRANSFORM <list> <ACTION> FOR <start> <stop> [<step>] ...)
``REGEX``: Specify a regular expression. Only elements matching the regular
-expression will be transformed. ::
+expression will be transformed.
+
+.. code-block:: cmake
list(TRANSFORM <list> <ACTION> REGEX <regular_expression> ...)
@@ -243,7 +259,7 @@ Ordering
.. _REVERSE:
-::
+.. code-block:: cmake
list(REVERSE <list>)
@@ -251,7 +267,7 @@ Reverses the contents of the list in-place.
.. _SORT:
-::
+.. code-block:: cmake
list(SORT <list> [COMPARE <compare>] [CASE <case>] [ORDER <order>])
diff --git a/Help/command/load_cache.rst b/Help/command/load_cache.rst
index f1134472d..33625c463 100644
--- a/Help/command/load_cache.rst
+++ b/Help/command/load_cache.rst
@@ -3,21 +3,20 @@ load_cache
Load in the values from another project's CMake cache.
-::
+.. code-block:: cmake
- load_cache(pathToCacheFile READ_WITH_PREFIX
- prefix entry1...)
+ load_cache(pathToCacheFile READ_WITH_PREFIX prefix entry1...)
-Read the cache and store the requested entries in variables with their
+Reads the cache and store the requested entries in variables with their
name prefixed with the given prefix. This only reads the values, and
does not create entries in the local project's cache.
-::
+.. code-block:: cmake
load_cache(pathToCacheFile [EXCLUDE entry1...]
[INCLUDE_INTERNALS entry1...])
-Load in the values from another cache and store them in the local
+Loads in the values from another cache and store them in the local
project's cache as internal entries. This is useful for a project
that depends on another project built in a different tree. ``EXCLUDE``
option can be used to provide a list of entries to be excluded.
diff --git a/Help/command/load_command.rst b/Help/command/load_command.rst
index a1576e8b5..dc235994c 100644
--- a/Help/command/load_command.rst
+++ b/Help/command/load_command.rst
@@ -1,7 +1,7 @@
load_command
------------
-Disallowed. See CMake Policy :policy:`CMP0031`.
+Disallowed since version 3.0. See CMake Policy :policy:`CMP0031`.
Load a command into a running CMake.
diff --git a/Help/command/macro.rst b/Help/command/macro.rst
index 6bee69c73..05e5d79ac 100644
--- a/Help/command/macro.rst
+++ b/Help/command/macro.rst
@@ -1,27 +1,66 @@
macro
-----
-Start recording a macro for later invocation as a command::
-
- macro(<name> [arg1 [arg2 [arg3 ...]]])
- COMMAND1(ARGS ...)
- COMMAND2(ARGS ...)
- ...
- endmacro(<name>)
-
-Define a macro named ``<name>`` that takes arguments named ``arg1``,
-``arg2``, ``arg3``, (...).
-Commands listed after macro, but before the matching
-:command:`endmacro()`, are not invoked until the macro is invoked.
-When it is invoked, the commands recorded in the macro are first
-modified by replacing formal parameters (``${arg1}``) with the arguments
-passed, and then invoked as normal commands.
+Start recording a macro for later invocation as a command
+
+.. code-block:: cmake
+
+ macro(<name> [<arg1> ...])
+ <commands>
+ endmacro()
+
+Defines a macro named ``<name>`` that takes arguments named
+``<arg1>``, ... Commands listed after macro, but before the
+matching :command:`endmacro()`, are not executed until the macro
+is invoked.
+
+Per legacy, the :command:`endmacro` command admits an optional
+``<name>`` argument. If used, it must be a verbatim repeat of the
+argument of the opening ``macro`` command.
+
+See the :command:`cmake_policy()` command documentation for the behavior
+of policies inside macros.
+
+See the :ref:`Macro vs Function` section below for differences
+between CMake macros and :command:`functions <function>`.
+
+Invocation
+^^^^^^^^^^
+
+The macro invocation is case-insensitive. A macro defined as
+
+.. code-block:: cmake
+
+ macro(foo)
+ <commands>
+ endmacro()
+
+can be invoked through any of
+
+.. code-block:: cmake
+
+ foo()
+ Foo()
+ FOO()
+
+and so on. However, it is strongly recommended to stay with the
+case chosen in the macro definition. Typically macros use
+all-lowercase names.
+
+Arguments
+^^^^^^^^^
+
+When a macro is invoked, the commands recorded in the macro are
+first modified by replacing formal parameters (``${arg1}``, ...)
+with the arguments passed, and then invoked as normal commands.
+
In addition to referencing the formal parameters you can reference the
values ``${ARGC}`` which will be set to the number of arguments passed
into the function as well as ``${ARGV0}``, ``${ARGV1}``, ``${ARGV2}``,
... which will have the actual values of the arguments passed in.
This facilitates creating macros with optional arguments.
-Additionally ``${ARGV}`` holds the list of all arguments given to the
+
+Furthermore, ``${ARGV}`` holds the list of all arguments given to the
macro and ``${ARGN}`` holds the list of arguments past the last expected
argument.
Referencing to ``${ARGV#}`` arguments beyond ``${ARGC}`` have undefined
@@ -29,48 +68,73 @@ behavior. Checking that ``${ARGC}`` is greater than ``#`` is the only
way to ensure that ``${ARGV#}`` was passed to the function as an extra
argument.
-See the :command:`cmake_policy()` command documentation for the behavior
-of policies inside macros.
+.. _`Macro vs Function`:
+
+Macro vs Function
+^^^^^^^^^^^^^^^^^
-Macro Argument Caveats
-^^^^^^^^^^^^^^^^^^^^^^
+The ``macro`` command is very similar to the :command:`function` command.
+Nonetheless, there are a few important differences.
-Note that the parameters to a macro and values such as ``ARGN`` are
-not variables in the usual CMake sense. They are string
-replacements much like the C preprocessor would do with a macro.
-Therefore you will NOT be able to use commands like::
+In a function, ``ARGN``, ``ARGC``, ``ARGV`` and ``ARGV0``, ``ARGV1``, ...
+are true variables in the usual CMake sense. In a macro, they are not,
+they are string replacements much like the C preprocessor would do
+with a macro. This has a number of consequences, as explained in
+the :ref:`Argument Caveats` section below.
+
+Another difference between macros and functions is the control flow.
+A function is executed by transferring control from the calling
+statement to the function body. A macro is executed as if the macro
+body were pasted in place of the calling statement. This has the
+consequence that a :command:`return()` in a macro body does not
+just terminate execution of the macro; rather, control is returned
+from the scope of the macro call. To avoid confusion, it is recommended
+to avoid :command:`return()` in macros altogether.
+
+.. _`Argument Caveats`:
+
+Argument Caveats
+^^^^^^^^^^^^^^^^
+
+Since ``ARGN``, ``ARGC``, ``ARGV``, ``ARGV0`` etc. are not variables,
+you will NOT be able to use commands like
+
+.. code-block:: cmake
if(ARGV1) # ARGV1 is not a variable
if(DEFINED ARGV2) # ARGV2 is not a variable
if(ARGC GREATER 2) # ARGC is not a variable
foreach(loop_var IN LISTS ARGN) # ARGN is not a variable
-In the first case, you can use ``if(${ARGV1})``.
-In the second and third case, the proper way to check if an optional
-variable was passed to the macro is to use ``if(${ARGC} GREATER 2)``.
-In the last case, you can use ``foreach(loop_var ${ARGN})`` but this
-will skip empty arguments.
-If you need to include them, you can use::
+In the first case, you can use ``if(${ARGV1})``. In the second and
+third case, the proper way to check if an optional variable was
+passed to the macro is to use ``if(${ARGC} GREATER 2)``. In the
+last case, you can use ``foreach(loop_var ${ARGN})`` but this will
+skip empty arguments. If you need to include them, you can use
+
+.. code-block:: cmake
set(list_var "${ARGN}")
foreach(loop_var IN LISTS list_var)
Note that if you have a variable with the same name in the scope from
which the macro is called, using unreferenced names will use the
-existing variable instead of the arguments. For example::
+existing variable instead of the arguments. For example:
+
+.. code-block:: cmake
- macro(_BAR)
+ macro(bar)
foreach(arg IN LISTS ARGN)
- [...]
+ <commands>
endforeach()
endmacro()
- function(_FOO)
- _bar(x y z)
+ function(foo)
+ bar(x y z)
endfunction()
- _foo(a b c)
+ foo(a b c)
-Will loop over ``a;b;c`` and not over ``x;y;z`` as one might be expecting.
+Will loop over ``a;b;c`` and not over ``x;y;z`` as one might have expected.
If you want true CMake variables and/or better CMake scope control you
should look at the function command.
diff --git a/Help/command/make_directory.rst b/Help/command/make_directory.rst
index 27ecf5194..8469b0a96 100644
--- a/Help/command/make_directory.rst
+++ b/Help/command/make_directory.rst
@@ -1,7 +1,9 @@
make_directory
--------------
-Deprecated. Use the :command:`file(MAKE_DIRECTORY)` command instead.
+.. deprecated:: 3.0
+
+ Use the :command:`file(MAKE_DIRECTORY)` command instead.
::
diff --git a/Help/command/mark_as_advanced.rst b/Help/command/mark_as_advanced.rst
index c3f94fc48..5712fb420 100644
--- a/Help/command/mark_as_advanced.rst
+++ b/Help/command/mark_as_advanced.rst
@@ -3,17 +3,22 @@ mark_as_advanced
Mark cmake cached variables as advanced.
-::
+.. code-block:: cmake
- mark_as_advanced([CLEAR|FORCE] VAR [VAR2 ...])
+ mark_as_advanced([CLEAR|FORCE] <var1> ...)
-Mark the named cached variables as advanced. An advanced variable
-will not be displayed in any of the cmake GUIs unless the show
-advanced option is on. If ``CLEAR`` is the first argument advanced
-variables are changed back to unadvanced. If ``FORCE`` is the first
-argument, then the variable is made advanced. If neither ``FORCE`` nor
-``CLEAR`` is specified, new values will be marked as advanced, but if the
-variable already has an advanced/non-advanced state, it will not be
-changed.
+Sets the advanced/non-advanced state of the named
+cached variables.
-It does nothing in script mode.
+An advanced variable will not be displayed in any
+of the cmake GUIs unless the ``show advanced`` option is on.
+In script mode, the advanced/non-advanced state has no effect.
+
+If the keyword ``CLEAR`` is given
+then advanced variables are changed back to unadvanced.
+If the keyword ``FORCE`` is given
+then the variables are made advanced.
+If neither ``FORCE`` nor ``CLEAR`` is specified,
+new values will be marked as advanced, but if a
+variable already has an advanced/non-advanced state,
+it will not be changed.
diff --git a/Help/command/math.rst b/Help/command/math.rst
index 63af931d8..4fa55f66c 100644
--- a/Help/command/math.rst
+++ b/Help/command/math.rst
@@ -1,30 +1,36 @@
math
----
-Mathematical expressions.
+Evaluate a mathematical expression.
-::
+.. code-block:: cmake
- math(EXPR <output-variable> <math-expression> [OUTPUT_FORMAT <format>])
+ math(EXPR <variable> "<expression>" [OUTPUT_FORMAT <format>])
-``EXPR`` evaluates mathematical expression and returns result in the
-output variable. Example mathematical expression is ``5 * (10 + 13)``.
+Evaluates a mathematical ``<expression>`` and sets ``<variable>`` to the
+resulting value.
+
+The mathematical expression must be given as a string (i.e. enclosed in
+double quotation marks). An example is ``"5 * (10 + 13)"``.
Supported operators are ``+``, ``-``, ``*``, ``/``, ``%``, ``|``, ``&``,
-``^``, ``~``, ``<<``, ``>>``, and ``(...)``. They have the same meaning
-as they do in C code.
+``^``, ``~``, ``<<``, ``>>``, and ``(...)``; they have the same meaning
+as in C code.
+
+Hexadecimal numbers are recognized when prefixed with "0x", as in C code.
-Numeric constants are evaluated in decimal or hexadecimal representation.
+The result is formatted according to the option ``OUTPUT_FORMAT``,
+where ``<format>`` is one of
-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.
- HEXADECIMAL = Result in output variable will be formatted in C code
- Hexadecimal notation.
- DECIMAL = Result in output variable will be formatted in decimal notation.
+For example
-For example::
+.. code-block:: cmake
- math(EXPR value "100 * 0xA" DECIMAL) results in value is set to "1000"
- math(EXPR value "100 * 0xA" HEXADECIMAL) results in value is set to "0x3e8"
+ math(EXPR value "100 * 0xA" OUTPUT_FORMAT DECIMAL) # value is set to "1000"
+ math(EXPR value "100 * 0xA" OUTPUT_FORMAT HEXADECIMAL) # value is set to "0x3e8"
diff --git a/Help/command/message.rst b/Help/command/message.rst
index 04c62fdff..2b4b1aa0d 100644
--- a/Help/command/message.rst
+++ b/Help/command/message.rst
@@ -3,7 +3,7 @@ message
Display a message to the user.
-::
+.. code-block:: cmake
message([<mode>] "message to display" ...)
diff --git a/Help/command/option.rst b/Help/command/option.rst
index 4fabb8747..8956307c5 100644
--- a/Help/command/option.rst
+++ b/Help/command/option.rst
@@ -1,17 +1,16 @@
option
------
-Provides an option that the user can optionally select.
+Provide an option that the user can optionally select.
-::
+.. code-block:: cmake
- option(<option_variable> "help string describing option"
- [initial value])
+ option(<variable> "<help_text>" [value])
-Provide an option for the user to select as ``ON`` or ``OFF``. If no
-initial value is provided, ``OFF`` is used. If the option is already
-set as a normal variable then the command does nothing
-(see policy :policy:`CMP0077`).
+Provides an option for the user to select as ``ON`` or ``OFF``.
+If no initial ``<value>`` is provided, ``OFF`` is used.
+If ``<variable>`` is already set as a normal variable
+then the command does nothing (see policy :policy:`CMP0077`).
If you have options that depend on the values of other options, see
the module help for :module:`CMakeDependentOption`.
diff --git a/Help/command/output_required_files.rst b/Help/command/output_required_files.rst
index 5e1355763..8bc6a730e 100644
--- a/Help/command/output_required_files.rst
+++ b/Help/command/output_required_files.rst
@@ -1,7 +1,7 @@
output_required_files
---------------------
-Disallowed. See CMake Policy :policy:`CMP0032`.
+Disallowed since version 3.0. See CMake Policy :policy:`CMP0032`.
Approximate C preprocessor dependency scanning.
diff --git a/Help/command/project.rst b/Help/command/project.rst
index bd8b4ef5c..688e56c3f 100644
--- a/Help/command/project.rst
+++ b/Help/command/project.rst
@@ -1,90 +1,119 @@
project
-------
-Sets project details such as name, version, etc. and enables languages.
+Set the name of the project.
+
+Synopsis
+^^^^^^^^
.. code-block:: cmake
- project(<PROJECT-NAME> [LANGUAGES] [<language-name>...])
+ project(<PROJECT-NAME> [<language-name>...])
project(<PROJECT-NAME>
[VERSION <major>[.<minor>[.<patch>[.<tweak>]]]]
[DESCRIPTION <project-description-string>]
[HOMEPAGE_URL <url-string>]
[LANGUAGES <language-name>...])
-Sets the name of the project and stores the name in the
-:variable:`PROJECT_NAME` variable. Additionally this sets variables
+Sets the name of the project, and stores it in the variable
+:variable:`PROJECT_NAME`. When called from the top-level
+``CMakeLists.txt`` also stores the project name in the
+variable :variable:`CMAKE_PROJECT_NAME`.
+
+Also sets the variables
* :variable:`PROJECT_SOURCE_DIR`,
:variable:`<PROJECT-NAME>_SOURCE_DIR`
* :variable:`PROJECT_BINARY_DIR`,
:variable:`<PROJECT-NAME>_BINARY_DIR`
-If ``VERSION`` is specified, given components must be non-negative integers.
-If ``VERSION`` is not specified, the default version is the empty string.
-The ``VERSION`` option may not be used unless policy :policy:`CMP0048` is
-set to ``NEW``.
-
-The :command:`project()` command stores the version number and its components
-in variables
-
-* :variable:`PROJECT_VERSION`,
- :variable:`<PROJECT-NAME>_VERSION`
-* :variable:`PROJECT_VERSION_MAJOR`,
- :variable:`<PROJECT-NAME>_VERSION_MAJOR`
-* :variable:`PROJECT_VERSION_MINOR`,
- :variable:`<PROJECT-NAME>_VERSION_MINOR`
-* :variable:`PROJECT_VERSION_PATCH`,
- :variable:`<PROJECT-NAME>_VERSION_PATCH`
-* :variable:`PROJECT_VERSION_TWEAK`,
- :variable:`<PROJECT-NAME>_VERSION_TWEAK`
-
-Variables corresponding to unspecified versions are set to the empty string
-(if policy :policy:`CMP0048` is set to ``NEW``).
-
-If the optional ``DESCRIPTION`` is given, then :variable:`PROJECT_DESCRIPTION`
-and :variable:`<PROJECT-NAME>_DESCRIPTION` will be set to its argument.
-These variables will be cleared if ``DESCRIPTION`` is not given.
-The description is expected to be a relatively short string, usually no more
-than a few words.
-
-The optional ``HOMEPAGE_URL`` sets the analogous variables
-:variable:`PROJECT_HOMEPAGE_URL` and :variable:`<PROJECT-NAME>_HOMEPAGE_URL`.
-When this option is given, the URL provided should be the canonical home for
-the project.
-These variables will be cleared if ``HOMEPAGE_URL`` is not given.
-
-Note that the description and homepage URL may be used as defaults for
-things like packaging meta-data, documentation, etc.
-
-Optionally you can specify which languages your project supports.
-Example languages include ``C``, ``CXX`` (i.e. C++), ``CUDA``,
-``Fortran``, and ``ASM``.
-By default ``C`` and ``CXX`` are enabled if no language options are
-given. Specify language ``NONE``, or use the ``LANGUAGES`` keyword
-and list no languages, to skip enabling any languages.
-
-If enabling ``ASM``, list it last so that CMake can check whether
-compilers for other languages like ``C`` work for assembly too.
-
-If a variable exists called :variable:`CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE`,
+Further variables are set by the optional arguments described in the following.
+If any of these arguments is not used, then the corresponding variables are
+set to the empty string.
+
+If the variable :variable:`CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE` exists,
the file pointed to by that variable will be included as the last step of the
project command.
+Options
+^^^^^^^
+
+The options are:
+
+``VERSION <version>``
+ Optional; may not be used unless policy :policy:`CMP0048` is
+ set to ``NEW``.
+
+ Takes a ``<version>`` argument composed of non-negative integer components,
+ i.e. ``<major>[.<minor>[.<patch>[.<tweak>]]]``,
+ and sets the variables
+
+ * :variable:`PROJECT_VERSION`,
+ :variable:`<PROJECT-NAME>_VERSION`
+ * :variable:`PROJECT_VERSION_MAJOR`,
+ :variable:`<PROJECT-NAME>_VERSION_MAJOR`
+ * :variable:`PROJECT_VERSION_MINOR`,
+ :variable:`<PROJECT-NAME>_VERSION_MINOR`
+ * :variable:`PROJECT_VERSION_PATCH`,
+ :variable:`<PROJECT-NAME>_VERSION_PATCH`
+ * :variable:`PROJECT_VERSION_TWEAK`,
+ :variable:`<PROJECT-NAME>_VERSION_TWEAK`.
+
+ When the :command:`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>``
+ Optional.
+ Sets the variables
+
+ * :variable:`PROJECT_DESCRIPTION`, :variable:`<PROJECT-NAME>_DESCRIPTION`
+
+ to ``<project-description-string>``.
+ It is recommended that this description is a relatively short string,
+ usually no more than a few words.
+
+ When the :command:`project()` command is called from the top-level ``CMakeLists.txt``,
+ then the description is also stored in the variable :variable:`CMAKE_PROJECT_DESCRIPTION`.
+
+``HOMEPAGE_URL <url-string>``
+ Optional.
+ Sets the variables
+
+ * :variable:`PROJECT_HOMEPAGE_URL`, :variable:`<PROJECT-NAME>_HOMEPAGE_URL`
+
+ to ``<url-string>``, which should be the canonical home URL for the project.
+
+ When the :command:`project()` command is called from the top-level ``CMakeLists.txt``,
+ then the URL also is stored in the variable :variable:`CMAKE_PROJECT_HOMEPAGE_URL`.
+
+``LANGUAGES <language-name>...``
+ Optional.
+ Can also be specified without ``LANGUAGES`` keyword per the first, short signature.
+
+ Selects which programming languages are needed to build the project.
+ Supported languages include ``C``, ``CXX`` (i.e. C++), ``CUDA``, ``Fortran``, and ``ASM``.
+ By default ``C`` and ``CXX`` are enabled if no language options are given.
+ Specify language ``NONE``, or use the ``LANGUAGES`` keyword and list no languages,
+ to skip enabling any languages.
+
+ If enabling ``ASM``, list it last so that CMake can check whether
+ compilers for other languages like ``C`` work for assembly too.
+
+The variables set through the ``VERSION``, ``DESCRIPTION`` and ``HOMEPAGE_URL``
+options are intended for use as default values in package metadata and documentation.
+
+Usage
+^^^^^
+
The top-level ``CMakeLists.txt`` file for a project must contain a
literal, direct call to the :command:`project` command; loading one
through the :command:`include` command is not sufficient. If no such
call exists CMake will implicitly add one to the top that enables the
-default languages (``C`` and ``CXX``). The name of the project set in
-the top level ``CMakeLists.txt`` file is available from the
-:variable:`CMAKE_PROJECT_NAME` variable, its description from
-:variable:`CMAKE_PROJECT_DESCRIPTION`, its homepage URL from
-:variable:`CMAKE_PROJECT_HOMEPAGE_URL` and its version from
-:variable:`CMAKE_PROJECT_VERSION`.
+default languages (``C`` and ``CXX``).
.. note::
Call the :command:`cmake_minimum_required` command at the beginning
of the top-level ``CMakeLists.txt`` file even before calling the
- ``project()`` command. It is important to establish version and
+ :command:`project()` command. It is important to establish version and
policy settings before invoking other commands whose behavior they
may affect. See also policy :policy:`CMP0000`.
diff --git a/Help/command/qt_wrap_cpp.rst b/Help/command/qt_wrap_cpp.rst
index 3843bf5e9..ce11c2d09 100644
--- a/Help/command/qt_wrap_cpp.rst
+++ b/Help/command/qt_wrap_cpp.rst
@@ -1,12 +1,23 @@
qt_wrap_cpp
-----------
-Create Qt Wrappers.
+.. deprecated:: 3.14
-::
+ This command was originally added to support Qt 3 before the
+ :command:`add_custom_command()` command was sufficiently mature. The
+ :module:`FindQt4` module provides the ``qt4_wrap_cpp()`` macro, which
+ should be used instead for Qt 4 projects. For projects using Qt 5 or
+ later, use the equivalent macro provided by Qt itself (e.g. Qt 5 provides
+ ``qt5_wrap_cpp()``).
- qt_wrap_cpp(resultingLibraryName DestName
- SourceLists ...)
+Manually create Qt Wrappers.
-Produce moc files for all the .h files listed in the SourceLists. The
+.. code-block:: cmake
+
+ qt_wrap_cpp(resultingLibraryName DestName SourceLists ...)
+
+Produces moc files for all the .h files listed in the SourceLists. The
moc files will be added to the library using the ``DestName`` source list.
+
+Consider updating the project to use the :prop_tgt:`AUTOMOC` target property
+instead for a more automated way of invoking the ``moc`` tool.
diff --git a/Help/command/qt_wrap_ui.rst b/Help/command/qt_wrap_ui.rst
index f731ed9a8..efbbc5472 100644
--- a/Help/command/qt_wrap_ui.rst
+++ b/Help/command/qt_wrap_ui.rst
@@ -1,14 +1,26 @@
qt_wrap_ui
----------
-Create Qt user interfaces Wrappers.
+.. deprecated:: 3.14
-::
+ This command was originally added to support Qt 3 before the
+ :command:`add_custom_command()` command was sufficiently mature. The
+ :module:`FindQt4` module provides the ``qt4_wrap_ui()`` macro, which
+ should be used instead for Qt 4 projects. For projects using Qt 5 or
+ later, use the equivalent macro provided by Qt itself (e.g. Qt 5 provides
+ ``qt5_wrap_ui()``).
+
+Manually create Qt user interfaces Wrappers.
+
+.. code-block:: cmake
qt_wrap_ui(resultingLibraryName HeadersDestName
SourcesDestName SourceLists ...)
-Produce .h and .cxx files for all the .ui files listed in the
+Produces .h and .cxx files for all the .ui files listed in the
``SourceLists``. The .h files will be added to the library using the
``HeadersDestNamesource`` list. The .cxx files will be added to the
library using the ``SourcesDestNamesource`` list.
+
+Consider updating the project to use the :prop_tgt:`AUTOUIC` target property
+instead for a more automated way of invoking the ``uic`` tool.
diff --git a/Help/command/remove.rst b/Help/command/remove.rst
index 462827796..543d01671 100644
--- a/Help/command/remove.rst
+++ b/Help/command/remove.rst
@@ -1,7 +1,9 @@
remove
------
-Deprecated. Use the :command:`list(REMOVE_ITEM)` command instead.
+.. deprecated:: 3.0
+
+ Use the :command:`list(REMOVE_ITEM)` command instead.
::
diff --git a/Help/command/remove_definitions.rst b/Help/command/remove_definitions.rst
index ea189181c..faad16dcb 100644
--- a/Help/command/remove_definitions.rst
+++ b/Help/command/remove_definitions.rst
@@ -1,9 +1,9 @@
remove_definitions
------------------
-Removes -D define flags added by :command:`add_definitions`.
+Remove -D define flags added by :command:`add_definitions`.
-::
+.. code-block:: cmake
remove_definitions(-DFOO -DBAR ...)
diff --git a/Help/command/return.rst b/Help/command/return.rst
index e49fb3c8d..830992c25 100644
--- a/Help/command/return.rst
+++ b/Help/command/return.rst
@@ -3,7 +3,7 @@ return
Return from a file, directory or function.
-::
+.. code-block:: cmake
return()
@@ -14,5 +14,6 @@ and control is returned to the including file. If it is encountered in a
file which is not included by another file, e.g. a ``CMakeLists.txt``,
control is returned to the parent directory if there is one. If return is
called in a function, control is returned to the caller of the function.
-Note that a macro is not a function and does not handle return like a
-function does.
+
+Note that a :command:`macro <macro>`, unlike a :command:`function <function>`,
+is expanded in place and therefore cannot handle ``return()``.
diff --git a/Help/command/separate_arguments.rst b/Help/command/separate_arguments.rst
index 47982a503..fbca859f2 100644
--- a/Help/command/separate_arguments.rst
+++ b/Help/command/separate_arguments.rst
@@ -1,33 +1,43 @@
separate_arguments
------------------
-Parse space-separated arguments into a semicolon-separated list.
+Parse command-line arguments into a semicolon-separated list.
-::
+.. code-block:: cmake
- separate_arguments(<var> <NATIVE|UNIX|WINDOWS>_COMMAND "<args>")
+ separate_arguments(<variable> <mode> <args>)
-Parses a UNIX- or Windows-style command-line string "<args>" and
-stores a semicolon-separated list of the arguments in ``<var>``. The
-entire command line must be given in one "<args>" argument.
+Parses a space-separated string ``<args>`` into a list of items,
+and stores this list in semicolon-separated standard form in ``<variable>``.
-The ``UNIX_COMMAND`` mode separates arguments by unquoted whitespace. It
-recognizes both single-quote and double-quote pairs. A backslash
-escapes the next literal character (``\"`` is ``"``); there are no special
-escapes (``\n`` is just ``n``).
+This function is intended for parsing command-line arguments.
+The entire command line must be passed as one string in the
+argument ``<args>``.
-The ``WINDOWS_COMMAND`` mode parses a Windows command-line using the same
-syntax the runtime library uses to construct argv at startup. It
-separates arguments by whitespace that is not double-quoted.
-Backslashes are literal unless they precede double-quotes. See the
-MSDN article `Parsing C Command-Line Arguments`_ for details.
+The exact parsing rules depend on the operating system.
+They are specified by the ``<mode>`` argument which must
+be one of the following keywords:
-The ``NATIVE_COMMAND`` mode parses a Windows command-line if the host
-system is Windows, and a UNIX command-line otherwise.
+``UNIX_COMMAND``
+ Arguments are separated by by unquoted whitespace.
+ Both single-quote and double-quote pairs are respected.
+ A backslash escapes the next literal character (``\"`` is ``"``);
+ there are no special escapes (``\n`` is just ``n``).
+
+``WINDOWS_COMMAND``
+ A Windows command-line is parsed using the same
+ syntax the runtime library uses to construct argv at startup. It
+ separates arguments by whitespace that is not double-quoted.
+ Backslashes are literal unless they precede double-quotes. See the
+ MSDN article `Parsing C Command-Line Arguments`_ for details.
+
+``NATIVE_COMMAND``
+ Proceeds as in ``WINDOWS_COMMAND`` mode if the host system is Windows.
+ Otherwise proceeds as in ``UNIX_COMMAND`` mode.
.. _`Parsing C Command-Line Arguments`: https://msdn.microsoft.com/library/a1y7w461.aspx
-::
+.. code-block:: cmake
separate_arguments(<var>)
diff --git a/Help/command/set.rst b/Help/command/set.rst
index b24ebefeb..c0e02e246 100644
--- a/Help/command/set.rst
+++ b/Help/command/set.rst
@@ -8,18 +8,18 @@ and cache entries.
Signatures of this command that specify a ``<value>...`` placeholder
expect zero or more arguments. Multiple arguments will be joined as
-a :ref:`;-list <CMake Language Lists>` to form the actual variable
+a :ref:`semicolon-separated list <CMake Language Lists>` to form the actual variable
value to be set. Zero arguments will cause normal variables to be
unset. See the :command:`unset` command to unset variables explicitly.
Set Normal Variable
^^^^^^^^^^^^^^^^^^^
-::
+.. code-block:: cmake
set(<variable> <value>... [PARENT_SCOPE])
-Set the given ``<variable>`` in the current function or directory scope.
+Sets the given ``<variable>`` in the current function or directory scope.
If the ``PARENT_SCOPE`` option is given the variable will be set in
the scope above the current scope. Each new directory or function
@@ -32,11 +32,11 @@ undefined and if it had a value, it is still that value).
Set Cache Entry
^^^^^^^^^^^^^^^
-::
+.. code-block:: cmake
set(<variable> <value>... CACHE <type> <docstring> [FORCE])
-Set the given cache ``<variable>`` (cache entry). Since cache entries
+Sets the given cache ``<variable>`` (cache entry). Since cache entries
are meant to provide user-settable values this does not overwrite
existing cache entries by default. Use the ``FORCE`` option to
overwrite existing entries.
@@ -84,8 +84,21 @@ current working directory and convert it to an absolute path.
Set Environment Variable
^^^^^^^^^^^^^^^^^^^^^^^^
-::
+.. code-block:: cmake
- set(ENV{<variable>} <value>...)
+ set(ENV{<variable>} [<value>])
-Set the current process environment ``<variable>`` to the given value.
+Sets an :manual:`Environment Variable <cmake-env-variables(7)>`
+to the given value.
+Subsequent calls of ``$ENV{<variable>}`` will return this new value.
+
+This command affects only the current CMake process, not the process
+from which CMake was called, nor the system environment at large,
+nor the environment of subsequent build or test processes.
+
+If no argument is given after ``ENV{<variable>}`` or if ``<value>`` is
+an empty string, then this command will clear any existing value of the
+environment variable.
+
+Arguments after ``<value>`` are ignored. If extra arguments are found,
+then an author warning is issued.
diff --git a/Help/command/set_directory_properties.rst b/Help/command/set_directory_properties.rst
index 42e7fd783..f02a8e6c7 100644
--- a/Help/command/set_directory_properties.rst
+++ b/Help/command/set_directory_properties.rst
@@ -1,11 +1,15 @@
set_directory_properties
------------------------
-Set properties of the current directory and subdirectories in key-value pairs.
+Set properties of the current directory and subdirectories.
-::
+.. code-block:: cmake
- set_directory_properties(PROPERTIES prop1 value1 prop2 value2)
+ set_directory_properties(PROPERTIES prop1 value1 [prop2 value2] ...)
+
+Sets properties of the current directory and its subdirectories in key-value pairs.
+
+See also the :command:`set_property(DIRECTORY)` command.
See :ref:`Directory Properties` for the list of properties known to CMake
and their individual documentation for the behavior of each property.
diff --git a/Help/command/set_property.rst b/Help/command/set_property.rst
index c89e1ced3..2624b4bc8 100644
--- a/Help/command/set_property.rst
+++ b/Help/command/set_property.rst
@@ -3,37 +3,40 @@ set_property
Set a named property in a given scope.
-::
-
- set_property(<GLOBAL |
- DIRECTORY [dir] |
- TARGET [target1 [target2 ...]] |
- SOURCE [src1 [src2 ...]] |
- INSTALL [file1 [file2 ...]] |
- TEST [test1 [test2 ...]] |
- CACHE [entry1 [entry2 ...]]>
+.. code-block:: cmake
+
+ set_property(<GLOBAL |
+ DIRECTORY [<dir>] |
+ TARGET [<target1> ...] |
+ SOURCE [<src1> ...] |
+ INSTALL [<file1> ...] |
+ TEST [<test1> ...] |
+ CACHE [<entry1> ...] >
[APPEND] [APPEND_STRING]
- PROPERTY <name> [value1 [value2 ...]])
+ PROPERTY <name> [value1 ...])
-Set one property on zero or more objects of a scope. The first
-argument determines the scope in which the property is set. It must
-be one of the following:
+Sets one property on zero or more objects of a scope.
+
+The first argument determines the scope in which the property is set.
+It must be one of the following:
``GLOBAL``
Scope is unique and does not accept a name.
``DIRECTORY``
- Scope defaults to the current directory but another
- directory (already processed by CMake) may be named by full or
- relative path.
+ Scope defaults to the current directory but another directory
+ (already processed by CMake) may be named by full or relative path.
+ See also the :command:`set_directory_properties` command.
``TARGET``
Scope may name zero or more existing targets.
+ See also the :command:`set_target_properties` command.
``SOURCE``
Scope may name zero or more source files. Note that source
file properties are visible only to targets added in the same
directory (CMakeLists.txt).
+ See also the :command:`set_source_files_properties` command.
``INSTALL``
Scope may name zero or more installed file paths.
@@ -53,6 +56,7 @@ be one of the following:
``TEST``
Scope may name zero or more existing tests.
+ See also the :command:`set_tests_properties` command.
``CACHE``
Scope must name zero or more cache existing entries.
diff --git a/Help/command/set_source_files_properties.rst b/Help/command/set_source_files_properties.rst
index b4904e8d0..91f995ce5 100644
--- a/Help/command/set_source_files_properties.rst
+++ b/Help/command/set_source_files_properties.rst
@@ -3,13 +3,17 @@ set_source_files_properties
Source files can have properties that affect how they are built.
-::
+.. code-block:: cmake
set_source_files_properties([file1 [file2 [...]]]
PROPERTIES prop1 value1
[prop2 value2 [...]])
-Set properties associated with source files using a key/value paired
-list. See :ref:`Source File Properties` for the list of properties known
+Sets properties associated with source files using a key/value paired
+list.
+
+See also the :command:`set_property(SOURCE)` command.
+
+See :ref:`Source File Properties` for the list of properties known
to CMake. Source file properties are visible only to targets added
in the same directory (CMakeLists.txt).
diff --git a/Help/command/set_target_properties.rst b/Help/command/set_target_properties.rst
index 7db952d6d..597be231a 100644
--- a/Help/command/set_target_properties.rst
+++ b/Help/command/set_target_properties.rst
@@ -3,13 +3,13 @@ set_target_properties
Targets can have properties that affect how they are built.
-::
+.. code-block:: cmake
set_target_properties(target1 target2 ...
PROPERTIES prop1 value1
prop2 value2 ...)
-Set properties on targets. The syntax for the command is to list all
+Sets properties on targets. The syntax for the command is to list all
the targets you want to change, and then provide the values you want to
set next. You can use any prop value pair you want and extract it
later with the :command:`get_property` or :command:`get_target_property`
diff --git a/Help/command/set_tests_properties.rst b/Help/command/set_tests_properties.rst
index 3efb1653e..9bc94ae38 100644
--- a/Help/command/set_tests_properties.rst
+++ b/Help/command/set_tests_properties.rst
@@ -3,12 +3,15 @@ set_tests_properties
Set a property of the tests.
-::
+.. code-block:: cmake
set_tests_properties(test1 [test2...] PROPERTIES prop1 value1 prop2 value2)
-Set a property for the tests. If the test is not found, CMake
+Sets a property for the tests. If the test is not found, CMake
will report an error.
:manual:`Generator expressions <cmake-generator-expressions(7)>` will be
-expanded the same as supported by the test's :command:`add_test` call. See
-:ref:`Test Properties` for the list of properties known to CMake.
+expanded the same as supported by the test's :command:`add_test` call.
+
+See also the :command:`set_property(TEST)` command.
+
+See :ref:`Test Properties` for the list of properties known to CMake.
diff --git a/Help/command/site_name.rst b/Help/command/site_name.rst
index e17c1ee68..1bcaeada0 100644
--- a/Help/command/site_name.rst
+++ b/Help/command/site_name.rst
@@ -3,6 +3,6 @@ site_name
Set the given variable to the name of the computer.
-::
+.. code-block:: cmake
site_name(variable)
diff --git a/Help/command/source_group.rst b/Help/command/source_group.rst
index 938ca40f2..6623c9837 100644
--- a/Help/command/source_group.rst
+++ b/Help/command/source_group.rst
@@ -4,7 +4,7 @@ source_group
Define a grouping for source files in IDE project generation.
There are two different signatures to create source groups.
-::
+.. code-block:: cmake
source_group(<name> [FILES <src>...] [REGULAR_EXPRESSION <regex>])
source_group(TREE <root> [PREFIX <prefix>] [FILES <src>...])
diff --git a/Help/command/string.rst b/Help/command/string.rst
index cc18069f4..893fb4324 100644
--- a/Help/command/string.rst
+++ b/Help/command/string.rst
@@ -48,7 +48,7 @@ Search and Replace
.. _FIND:
-::
+.. code-block:: cmake
string(FIND <string> <substring> <output variable> [REVERSE])
@@ -59,7 +59,7 @@ substring. If the substring is not found, a position of -1 is returned.
.. _REPLACE:
-::
+.. code-block:: cmake
string(REPLACE <match_string>
<replace_string> <output variable>
@@ -73,7 +73,7 @@ Regular Expressions
.. _`REGEX MATCH`:
-::
+.. code-block:: cmake
string(REGEX MATCH <regular_expression>
<output variable> <input> [<input>...])
@@ -83,7 +83,7 @@ All ``<input>`` arguments are concatenated before matching.
.. _`REGEX MATCHALL`:
-::
+.. code-block:: cmake
string(REGEX MATCHALL <regular_expression>
<output variable> <input> [<input>...])
@@ -94,7 +94,7 @@ All ``<input>`` arguments are concatenated before matching.
.. _`REGEX REPLACE`:
-::
+.. code-block:: cmake
string(REGEX REPLACE <regular_expression>
<replace_expression> <output variable>
@@ -177,7 +177,7 @@ Manipulation
.. _APPEND:
-::
+.. code-block:: cmake
string(APPEND <string variable> [<input>...])
@@ -185,7 +185,7 @@ Append all the input arguments to the string.
.. _PREPEND:
-::
+.. code-block:: cmake
string(PREPEND <string variable> [<input>...])
@@ -193,7 +193,7 @@ Prepend all the input arguments to the string.
.. _CONCAT:
-::
+.. code-block:: cmake
string(CONCAT <output variable> [<input>...])
@@ -202,7 +202,7 @@ the result in the named output variable.
.. _JOIN:
-::
+.. code-block:: cmake
string(JOIN <glue> <output variable> [<input>...])
@@ -215,7 +215,7 @@ special characters like ``;`` in them.
.. _TOLOWER:
-::
+.. code-block:: cmake
string(TOLOWER <string1> <output variable>)
@@ -223,7 +223,7 @@ Convert string to lower characters.
.. _TOUPPER:
-::
+.. code-block:: cmake
string(TOUPPER <string1> <output variable>)
@@ -231,7 +231,7 @@ Convert string to upper characters.
.. _LENGTH:
-::
+.. code-block:: cmake
string(LENGTH <string> <output variable>)
@@ -239,7 +239,7 @@ Store in an output variable a given string's length.
.. _SUBSTRING:
-::
+.. code-block:: cmake
string(SUBSTRING <string> <begin> <length> <output variable>)
@@ -253,7 +253,7 @@ If string is shorter than length then end of string is used instead.
.. _STRIP:
-::
+.. code-block:: cmake
string(STRIP <string> <output variable>)
@@ -262,7 +262,7 @@ trailing spaces removed.
.. _GENEX_STRIP:
-::
+.. code-block:: cmake
string(GENEX_STRIP <input string> <output variable>)
@@ -274,7 +274,7 @@ Comparison
.. _COMPARE:
-::
+.. code-block:: cmake
string(COMPARE LESS <string1> <string2> <output variable>)
string(COMPARE GREATER <string1> <string2> <output variable>)
@@ -292,7 +292,7 @@ Hashing
.. _`HASH`:
-::
+.. code-block:: cmake
string(<HASH> <output variable> <input>)
@@ -325,7 +325,7 @@ Generation
.. _ASCII:
-::
+.. code-block:: cmake
string(ASCII <number> [<number> ...] <output variable>)
@@ -333,7 +333,7 @@ Convert all numbers into corresponding ASCII characters.
.. _CONFIGURE:
-::
+.. code-block:: cmake
string(CONFIGURE <string1> <output variable>
[@ONLY] [ESCAPE_QUOTES])
@@ -342,7 +342,7 @@ Transform a string like :command:`configure_file` transforms a file.
.. _MAKE_C_IDENTIFIER:
-::
+.. code-block:: cmake
string(MAKE_C_IDENTIFIER <input string> <output variable>)
@@ -353,7 +353,7 @@ the result.
.. _RANDOM:
-::
+.. code-block:: cmake
string(RANDOM [LENGTH <length>] [ALPHABET <alphabet>]
[RANDOM_SEED <seed>] <output variable>)
@@ -366,7 +366,7 @@ random number generator.
.. _TIMESTAMP:
-::
+.. code-block:: cmake
string(TIMESTAMP <output variable> [<format string>] [UTC])
@@ -421,7 +421,7 @@ If no explicit ``<format string>`` is given it will default to:
.. _UUID:
-::
+.. code-block:: cmake
string(UUID <output variable> NAMESPACE <namespace> NAME <name>
TYPE <MD5|SHA1> [UPPER])
diff --git a/Help/command/subdir_depends.rst b/Help/command/subdir_depends.rst
index 5676c8f40..0c1b3c1ce 100644
--- a/Help/command/subdir_depends.rst
+++ b/Help/command/subdir_depends.rst
@@ -1,7 +1,7 @@
subdir_depends
--------------
-Disallowed. See CMake Policy :policy:`CMP0029`.
+Disallowed since version 3.0. See CMake Policy :policy:`CMP0029`.
Does nothing.
diff --git a/Help/command/subdirs.rst b/Help/command/subdirs.rst
index 43b87d4d7..530951bd1 100644
--- a/Help/command/subdirs.rst
+++ b/Help/command/subdirs.rst
@@ -1,7 +1,9 @@
subdirs
-------
-Deprecated. Use the :command:`add_subdirectory` command instead.
+.. deprecated:: 3.0
+
+ Use the :command:`add_subdirectory` command instead.
Add a list of subdirectories to the build.
diff --git a/Help/command/target_compile_definitions.rst b/Help/command/target_compile_definitions.rst
index a74011797..9e9c69093 100644
--- a/Help/command/target_compile_definitions.rst
+++ b/Help/command/target_compile_definitions.rst
@@ -3,13 +3,13 @@ target_compile_definitions
Add compile definitions to a target.
-::
+.. code-block:: cmake
target_compile_definitions(<target>
<INTERFACE|PUBLIC|PRIVATE> [items1...]
[<INTERFACE|PUBLIC|PRIVATE> [items2...] ...])
-Specify compile definitions to use when compiling a given ``<target>``. The
+Specifies compile definitions to use when compiling a given ``<target>``. 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_features.rst b/Help/command/target_compile_features.rst
index bf413bf1b..9271cd56c 100644
--- a/Help/command/target_compile_features.rst
+++ b/Help/command/target_compile_features.rst
@@ -3,11 +3,11 @@ target_compile_features
Add expected compiler features to a target.
-::
+.. code-block:: cmake
target_compile_features(<target> <PRIVATE|PUBLIC|INTERFACE> <feature> [...])
-Specify compiler features required when compiling a given target. If the
+Specifies compiler features required when compiling a given target. If the
feature is not listed in the :variable:`CMAKE_C_COMPILE_FEATURES` variable
or :variable:`CMAKE_CXX_COMPILE_FEATURES` variable,
then an error will be reported by CMake. If the use of the feature requires
diff --git a/Help/command/target_compile_options.rst b/Help/command/target_compile_options.rst
index 88b7f1542..47e7d86f8 100644
--- a/Help/command/target_compile_options.rst
+++ b/Help/command/target_compile_options.rst
@@ -3,28 +3,24 @@ target_compile_options
Add compile options to a target.
-::
+.. code-block:: cmake
target_compile_options(<target> [BEFORE]
<INTERFACE|PUBLIC|PRIVATE> [items1...]
[<INTERFACE|PUBLIC|PRIVATE> [items2...] ...])
-Specify compile options to use when compiling a given target. 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>`.
+Adds options to the :prop_tgt:`COMPILE_OPTIONS` or
+:prop_tgt:`INTERFACE_COMPILE_OPTIONS` target properties. These options
+are used when compiling the given ``<target>``, which 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>`.
+
+Arguments
+^^^^^^^^^
If ``BEFORE`` is specified, the content will be prepended to the property
instead of being appended.
-This command can be used to add any options, but
-alternative commands exist to add preprocessor definitions
-(:command:`target_compile_definitions` and :command:`add_compile_definitions`)
-or include directories (:command:`target_include_directories` and
-:command:`include_directories`). See documentation of the
-:prop_dir:`directory <COMPILE_OPTIONS>` and
-:prop_tgt:`target <COMPILE_OPTIONS>` ``COMPILE_OPTIONS`` properties.
-
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:`COMPILE_OPTIONS` property of
@@ -40,3 +36,13 @@ manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.
.. include:: OPTIONS_SHELL.txt
+
+See Also
+^^^^^^^^
+
+This command can be used to add any options. However, for adding
+preprocessor definitions and include directories it is recommended
+to use the more specific commands :command:`target_compile_definitions`
+and :command:`target_include_directories`.
+
+For directory-wide settings, there is the command :command:`add_compile_options`.
diff --git a/Help/command/target_include_directories.rst b/Help/command/target_include_directories.rst
index e71be64eb..660e15c9b 100644
--- a/Help/command/target_include_directories.rst
+++ b/Help/command/target_include_directories.rst
@@ -3,13 +3,13 @@ target_include_directories
Add include directories to a target.
-::
+.. code-block:: cmake
target_include_directories(<target> [SYSTEM] [BEFORE]
<INTERFACE|PUBLIC|PRIVATE> [items1...]
[<INTERFACE|PUBLIC|PRIVATE> [items2...] ...])
-Specify include directories to use when compiling a given target.
+Specifies include directories to use when compiling a given target.
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_link_directories.rst b/Help/command/target_link_directories.rst
index b46aac07d..76da94dc1 100644
--- a/Help/command/target_link_directories.rst
+++ b/Help/command/target_link_directories.rst
@@ -3,13 +3,13 @@ target_link_directories
Add link directories to a target.
-::
+.. code-block:: cmake
target_link_directories(<target> [BEFORE]
<INTERFACE|PUBLIC|PRIVATE> [items1...]
[<INTERFACE|PUBLIC|PRIVATE> [items2...] ...])
-Specify the paths in which the linker should search for libraries when
+Specifies the paths in which the linker should search for libraries when
linking a given target. Each item can be an absolute or relative path,
with the latter being interpreted as relative to the current source
directory. These items will be added to the link command.
diff --git a/Help/command/target_link_libraries.rst b/Help/command/target_link_libraries.rst
index 58f312e1a..c5e4f9fcf 100644
--- a/Help/command/target_link_libraries.rst
+++ b/Help/command/target_link_libraries.rst
@@ -14,7 +14,9 @@ Overview
^^^^^^^^
This command has several signatures as detailed in subsections below.
-All of them have the general form::
+All of them have the general form
+
+.. code-block:: cmake
target_link_libraries(<target> ... <item>... ...)
@@ -92,7 +94,7 @@ Each ``<item>`` may be:
* **A generator expression**: A ``$<...>`` :manual:`generator expression
<cmake-generator-expressions(7)>` may evaluate to any of the above
- items or to a :ref:`;-list <CMake Language Lists>` of them.
+ items or to a :ref:`semicolon-separated list <CMake Language Lists>` of them.
If the ``...`` contains any ``;`` characters, e.g. after evaluation
of a ``${list}`` variable, be sure to use an explicitly quoted
argument ``"$<...>"`` so that this command receives it as a
@@ -128,7 +130,7 @@ buildsystem properties.
Libraries for a Target and/or its Dependents
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
+.. code-block:: cmake
target_link_libraries(<target>
<PRIVATE|PUBLIC|INTERFACE> <item>...
@@ -145,7 +147,7 @@ used for linking ``<target>``.
Libraries for both a Target and its Dependents
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
+.. code-block:: cmake
target_link_libraries(<target> <item>...)
@@ -163,7 +165,7 @@ exclusively by this signature private.
Libraries for a Target and/or its Dependents (Legacy)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
+.. code-block:: cmake
target_link_libraries(<target>
<LINK_PRIVATE|LINK_PUBLIC> <lib>...
@@ -185,7 +187,7 @@ made part of the :prop_tgt:`INTERFACE_LINK_LIBRARIES`. If policy
Libraries for Dependents Only (Legacy)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
+.. code-block:: cmake
target_link_libraries(<target> LINK_INTERFACE_LIBRARIES <item>...)
diff --git a/Help/command/target_link_options.rst b/Help/command/target_link_options.rst
index 0b45a8b2c..285455a81 100644
--- a/Help/command/target_link_options.rst
+++ b/Help/command/target_link_options.rst
@@ -3,13 +3,13 @@ target_link_options
Add link options to a target.
-::
+.. code-block:: cmake
target_link_options(<target> [BEFORE]
<INTERFACE|PUBLIC|PRIVATE> [items1...]
[<INTERFACE|PUBLIC|PRIVATE> [items2...] ...])
-Specify link options to use when linking a given target. The
+Specifies link options to use when linking a given target. 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_sources.rst b/Help/command/target_sources.rst
index 5dd8d86cc..27e737bf0 100644
--- a/Help/command/target_sources.rst
+++ b/Help/command/target_sources.rst
@@ -3,13 +3,13 @@ target_sources
Add sources to a target.
-::
+.. code-block:: cmake
target_sources(<target>
<INTERFACE|PUBLIC|PRIVATE> [items1...]
[<INTERFACE|PUBLIC|PRIVATE> [items2...] ...])
-Specify sources to use when compiling a given target. Relative
+Specifies sources to use when compiling a given target. 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
diff --git a/Help/command/try_compile.rst b/Help/command/try_compile.rst
index 66ea3d7f2..ca8fc77fa 100644
--- a/Help/command/try_compile.rst
+++ b/Help/command/try_compile.rst
@@ -10,14 +10,14 @@ Try building some code.
Try Compiling Whole Projects
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
+.. code-block:: cmake
- try_compile(RESULT_VAR <bindir> <srcdir>
+ try_compile(<resultVar> <bindir> <srcdir>
<projectName> [<targetName>] [CMAKE_FLAGS <flags>...]
[OUTPUT_VARIABLE <var>])
Try building a project. The success or failure of the ``try_compile``,
-i.e. ``TRUE`` or ``FALSE`` respectively, is returned in ``RESULT_VAR``.
+i.e. ``TRUE`` or ``FALSE`` respectively, is returned in ``<resultVar>``.
In this form, ``<srcdir>`` should contain a complete CMake project with a
``CMakeLists.txt`` file and all sources. The ``<bindir>`` and ``<srcdir>``
@@ -28,11 +28,12 @@ below for the meaning of other options.
Try Compiling Source Files
^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
+.. code-block:: cmake
- try_compile(RESULT_VAR <bindir> <srcfile|SOURCES srcfile...>
+ try_compile(<resultVar> <bindir> <srcfile|SOURCES srcfile...>
[CMAKE_FLAGS <flags>...]
[COMPILE_DEFINITIONS <defs>...]
+ [LINK_OPTIONS <options>...]
[LINK_LIBRARIES <libs>...]
[OUTPUT_VARIABLE <var>]
[COPY_FILE <fileName> [COPY_FILE_ERROR <var>]]
@@ -41,18 +42,27 @@ Try Compiling Source Files
[<LANG>_EXTENSIONS <bool>]
)
-Try building an executable from one or more source files. The success or
-failure of the ``try_compile``, i.e. ``TRUE`` or ``FALSE`` respectively, is
-returned in ``RESULT_VAR``.
+Try building an executable or static library from one or more source files
+(which one is determined by the :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE`
+variable). The success or failure of the ``try_compile``, i.e. ``TRUE`` or
+``FALSE`` respectively, is returned in ``<resultVar>``.
-In this form the user need only supply one or more source files that include a
-definition for ``main``. CMake will create a ``CMakeLists.txt`` file to build
-the source(s) as an executable that looks something like this::
+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
+``CMakeLists.txt`` file to build the source(s) as an executable.
+If :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` is set to ``STATIC_LIBRARY``,
+a static library will be built instead and no definition for ``main`` is
+required. For an executable, the generated ``CMakeLists.txt`` file would
+contain something like the following:
+
+.. code-block:: cmake
add_definitions(<expanded COMPILE_DEFINITIONS from caller>)
include_directories(${INCLUDE_DIRECTORIES})
link_directories(${LINK_DIRECTORIES})
add_executable(cmTryCompileExec <srcfile>...)
+ target_link_options(cmTryCompileExec PRIVATE <LINK_OPTIONS from caller>)
target_link_libraries(cmTryCompileExec ${LINK_LIBRARIES})
The options are:
@@ -65,11 +75,11 @@ The options are:
are used.
``COMPILE_DEFINITIONS <defs>...``
- Specify ``-Ddefinition`` arguments to pass to ``add_definitions``
+ Specify ``-Ddefinition`` arguments to pass to :command:`add_definitions`
in the generated test project.
``COPY_FILE <fileName>``
- Copy the linked executable to the given ``<fileName>``.
+ Copy the built executable or static library to the given ``<fileName>``.
``COPY_FILE_ERROR <var>``
Use after ``COPY_FILE`` to capture into variable ``<var>`` any error
@@ -83,8 +93,13 @@ The options are:
If this option is specified, any ``-DLINK_LIBRARIES=...`` value
given to the ``CMAKE_FLAGS`` option will be ignored.
+``LINK_OPTIONS <options>...``
+ 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.
+
``OUTPUT_VARIABLE <var>``
- Store the output from the build process the given variable.
+ Store the output from the build process in the given variable.
``<LANG>_STANDARD <std>``
Specify the :prop_tgt:`C_STANDARD`, :prop_tgt:`CXX_STANDARD`,
@@ -105,7 +120,7 @@ passed to ``cmake`` to avoid this clean. However, multiple sequential
``try_compile`` operations reuse this single output directory. If you use
``--debug-trycompile``, you can only debug one ``try_compile`` call at a time.
The recommended procedure is to protect all ``try_compile`` calls in your
-project by ``if(NOT DEFINED RESULT_VAR)`` logic, configure with cmake
+project by ``if(NOT DEFINED <resultVar>)`` logic, configure with cmake
all the way through once, then delete the cache entry associated with
the try_compile call of interest, and then re-run cmake again with
``--debug-trycompile``.
@@ -125,7 +140,13 @@ default values:
If :policy:`CMP0056` is set to ``NEW``, then
:variable:`CMAKE_EXE_LINKER_FLAGS` is passed in as well.
-The current setting of :policy:`CMP0065` is set in the generated project.
+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.
Set the :variable:`CMAKE_TRY_COMPILE_CONFIGURATION` variable to choose
a build configuration.
@@ -135,7 +156,9 @@ 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.
+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,
@@ -153,3 +176,6 @@ then the language standard variables are honored:
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.
diff --git a/Help/command/try_run.rst b/Help/command/try_run.rst
index e3bd57d50..d401ebe92 100644
--- a/Help/command/try_run.rst
+++ b/Help/command/try_run.rst
@@ -10,11 +10,12 @@ Try compiling and then running some code.
Try Compiling and Running Source Files
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
+.. code-block:: cmake
- try_run(RUN_RESULT_VAR COMPILE_RESULT_VAR
- bindir srcfile [CMAKE_FLAGS <flags>...]
+ try_run(<runResultVar> <compileResultVar>
+ <bindir> <srcfile> [CMAKE_FLAGS <flags>...]
[COMPILE_DEFINITIONS <defs>...]
+ [LINK_OPTIONS <options>...]
[LINK_LIBRARIES <libs>...]
[COMPILE_OUTPUT_VARIABLE <var>]
[RUN_OUTPUT_VARIABLE <var>]
@@ -22,9 +23,9 @@ Try Compiling and Running Source Files
[ARGS <args>...])
Try compiling a ``<srcfile>``. Returns ``TRUE`` or ``FALSE`` for success
-or failure in ``COMPILE_RESULT_VAR``. If the compile succeeded, runs the
-executable and returns its exit code in ``RUN_RESULT_VAR``. If the
-executable was built, but failed to run, then ``RUN_RESULT_VAR`` will be
+or failure in ``<compileResultVar>``. If the compile succeeded, runs the
+executable and returns its exit code in ``<runResultVar>``. If the
+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.
@@ -38,7 +39,7 @@ The options are:
are used.
``COMPILE_DEFINITIONS <defs>...``
- Specify ``-Ddefinition`` arguments to pass to ``add_definitions``
+ Specify ``-Ddefinition`` arguments to pass to :command:`add_definitions`
in the generated test project.
``COMPILE_OUTPUT_VARIABLE <var>``
@@ -52,6 +53,10 @@ The options are:
If this option is specified, any ``-DLINK_LIBRARIES=...`` value
given to the ``CMAKE_FLAGS`` option will be ignored.
+``LINK_OPTIONS <options>...``
+ Specify link step options to pass to :command:`target_link_options` in the
+ generated project.
+
``OUTPUT_VARIABLE <var>``
Report the compile build output and the output from running the executable
in the given variable. This option exists for legacy reasons. Prefer
@@ -80,10 +85,10 @@ presetting them in some CMake script file to the values the executable
would have produced if it had been run on its actual target platform.
These cache entries are:
-``<RUN_RESULT_VAR>``
+``<runResultVar>``
Exit code if the executable were to be run on the target platform.
-``<RUN_RESULT_VAR>__TRYRUN_OUTPUT``
+``<runResultVar>__TRYRUN_OUTPUT``
Output from stdout and stderr if the executable were to be run on
the target platform. This is created only if the
``RUN_OUTPUT_VARIABLE`` or ``OUTPUT_VARIABLE`` option was used.
diff --git a/Help/command/unset.rst b/Help/command/unset.rst
index c19dd318a..75210521e 100644
--- a/Help/command/unset.rst
+++ b/Help/command/unset.rst
@@ -3,7 +3,10 @@ unset
Unset a variable, cache variable, or environment variable.
-::
+Unset Normal Variable or Cache Entry
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. code-block:: cmake
unset(<variable> [CACHE | PARENT_SCOPE])
@@ -22,11 +25,17 @@ If ``PARENT_SCOPE`` is present then the variable is removed from the scope
above the current scope. See the same option in the :command:`set` command
for further details.
-``<variable>`` can be an environment variable such as:
+Unset Environment Variable
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. code-block:: cmake
-::
+ unset(ENV{<variable>})
- unset(ENV{LD_LIBRARY_PATH})
+Removes ``<variable>`` from the currently available
+:manual:`Environment Variables <cmake-env-variables(7)>`.
+Subsequent calls of ``$ENV{<variable>}`` will return the empty string.
-in which case the variable will be removed from the current
-environment.
+This command affects only the current CMake process, not the process
+from which CMake was called, nor the system environment at large,
+nor the environment of subsequent build or test processes.
diff --git a/Help/command/use_mangled_mesa.rst b/Help/command/use_mangled_mesa.rst
index 6f4d7aca6..4d9e12b3e 100644
--- a/Help/command/use_mangled_mesa.rst
+++ b/Help/command/use_mangled_mesa.rst
@@ -1,7 +1,7 @@
use_mangled_mesa
----------------
-Disallowed. See CMake Policy :policy:`CMP0030`.
+Disallowed since version 3.0. See CMake Policy :policy:`CMP0030`.
Copy mesa headers for use in combination with system GL.
diff --git a/Help/command/utility_source.rst b/Help/command/utility_source.rst
index ee34492c3..94d6a4e64 100644
--- a/Help/command/utility_source.rst
+++ b/Help/command/utility_source.rst
@@ -1,7 +1,7 @@
utility_source
--------------
-Disallowed. See CMake Policy :policy:`CMP0034`.
+Disallowed since version 3.0. See CMake Policy :policy:`CMP0034`.
Specify the source tree of a third-party utility.
diff --git a/Help/command/variable_requires.rst b/Help/command/variable_requires.rst
index 9cf9f3ffd..b4742a523 100644
--- a/Help/command/variable_requires.rst
+++ b/Help/command/variable_requires.rst
@@ -1,7 +1,7 @@
variable_requires
-----------------
-Disallowed. See CMake Policy :policy:`CMP0035`.
+Disallowed since version 3.0. See CMake Policy :policy:`CMP0035`.
Use the :command:`if` command instead.
diff --git a/Help/command/variable_watch.rst b/Help/command/variable_watch.rst
index a2df058eb..ce69bcfcd 100644
--- a/Help/command/variable_watch.rst
+++ b/Help/command/variable_watch.rst
@@ -3,11 +3,13 @@ variable_watch
Watch the CMake variable for change.
-::
+.. code-block:: cmake
- variable_watch(<variable name> [<command to execute>])
+ variable_watch(<variable> [<command>])
-If the specified variable changes, the message will be printed about
-the variable being changed. If the command is specified, the command
-will be executed. The command will receive the following arguments:
-COMMAND(<variable> <access> <value> <current list file> <stack>)
+If the specified ``<variable>`` changes, a message will be printed
+to inform about the change.
+
+Additionally, if ``<command>`` is given, this command will be executed.
+The command will receive the following arguments:
+``COMMAND(<variable> <access> <value> <current_list_file> <stack>)``
diff --git a/Help/command/while.rst b/Help/command/while.rst
index 7509da309..a4957c1db 100644
--- a/Help/command/while.rst
+++ b/Help/command/while.rst
@@ -3,15 +3,23 @@ while
Evaluate a group of commands while a condition is true
-::
+.. code-block:: cmake
- while(condition)
- COMMAND1(ARGS ...)
- COMMAND2(ARGS ...)
- ...
- endwhile(condition)
+ while(<condition>)
+ <commands>
+ endwhile()
All commands between while and the matching :command:`endwhile` are recorded
without being invoked. Once the :command:`endwhile` is evaluated, the
-recorded list of commands is invoked as long as the condition is true. The
-condition is evaluated using the same logic as the :command:`if` command.
+recorded list of commands is invoked as long as the ``<condition>`` is true.
+
+The ``<condition>`` has the same syntax and is evaluated using the same logic
+as described at length for the :command:`if` command.
+
+The commands :command:`break` and :command:`continue` provide means to
+escape from the normal control flow.
+
+Per legacy, the :command:`endwhile` command admits
+an optional ``<condition>`` argument.
+If used, it must be a verbatim repeat of the argument of the opening
+``while`` command.
diff --git a/Help/command/write_file.rst b/Help/command/write_file.rst
index 40e755763..4d476bd5a 100644
--- a/Help/command/write_file.rst
+++ b/Help/command/write_file.rst
@@ -1,7 +1,9 @@
write_file
----------
-Deprecated. Use the :command:`file(WRITE)` command instead.
+.. deprecated:: 3.0
+
+ Use the :command:`file(WRITE)` command instead.
::
diff --git a/Help/cpack_gen/deb.rst b/Help/cpack_gen/deb.rst
index fdde6544b..23f051530 100644
--- a/Help/cpack_gen/deb.rst
+++ b/Help/cpack_gen/deb.rst
@@ -15,9 +15,9 @@ better deb package when Debian specific tools ``dpkg-xxx`` are usable on
the build system.
The CPack DEB generator has specific features which are controlled by the
-specifics :code:`CPACK_DEBIAN_XXX` variables.
+specifics ``CPACK_DEBIAN_XXX`` variables.
-:code:`CPACK_DEBIAN_<COMPONENT>_XXXX` variables may be used in order to have
+``CPACK_DEBIAN_<COMPONENT>_XXXX`` variables may be used in order to have
**component** specific values. Note however that ``<COMPONENT>`` refers to
the **grouping name** written in upper case. It may be either a component name
or a component GROUP name.
@@ -133,8 +133,8 @@ List of CPack DEB generator specific variables:
The Debian package architecture
* Mandatory : YES
- * Default : Output of :code:`dpkg --print-architecture` (or :code:`i386`
- if :code:`dpkg` is not found)
+ * Default : Output of ``dpkg --print-architecture`` (or ``i386``
+ if ``dpkg`` is not found)
.. variable:: CPACK_DEBIAN_PACKAGE_DEPENDS
CPACK_DEBIAN_<COMPONENT>_PACKAGE_DEPENDS
@@ -176,7 +176,7 @@ List of CPack DEB generator specific variables:
The Debian package maintainer
* Mandatory : YES
- * Default : :code:`CPACK_PACKAGE_CONTACT`
+ * Default : ``CPACK_PACKAGE_CONTACT``
.. variable:: CPACK_DEBIAN_PACKAGE_DESCRIPTION
CPACK_COMPONENT_<COMPONENT>_DESCRIPTION
@@ -205,18 +205,18 @@ List of CPack DEB generator specific variables:
The archive format used for creating the Debian package.
* Mandatory : YES
- * Default : "paxr"
+ * Default : "gnutar"
- Possible values are:
+ Possible value is:
- - paxr
- gnutar
.. note::
- Default pax archive format is the most portable format and generates
- packages that do not treat sparse files specially.
- GNU tar format on the other hand supports longer filenames.
+ This variable previously defaulted to the ``paxr`` value, but ``dpkg``
+ has never supported that tar format. For backwards compatibility the
+ ``paxr`` value will be mapped to ``gnutar`` and a deprecation message
+ will be emitted.
.. variable:: CPACK_DEBIAN_COMPRESSION_TYPE
@@ -260,7 +260,7 @@ List of CPack DEB generator specific variables:
.. variable:: CPACK_DEBIAN_PACKAGE_SHLIBDEPS
CPACK_DEBIAN_<COMPONENT>_PACKAGE_SHLIBDEPS
- May be set to ON in order to use :code:`dpkg-shlibdeps` to generate
+ May be set to ON in order to use ``dpkg-shlibdeps`` to generate
better package dependency list.
* Mandatory : NO
@@ -272,7 +272,7 @@ List of CPack DEB generator specific variables:
.. note::
You may need set :variable:`CMAKE_INSTALL_RPATH` to an appropriate value
- if you use this feature, because if you don't :code:`dpkg-shlibdeps`
+ if you use this feature, because if you don't ``dpkg-shlibdeps``
may fail to find your own shared libs.
See https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling
@@ -289,7 +289,7 @@ List of CPack DEB generator specific variables:
Sets the `Pre-Depends` field of the Debian package.
Like :variable:`Depends <CPACK_DEBIAN_PACKAGE_DEPENDS>`, except that it
- also forces :code:`dpkg` to complete installation of the packages named
+ also forces ``dpkg`` to complete installation of the packages named
before even starting the installation of the package which declares the
pre-dependency.
@@ -324,7 +324,7 @@ List of CPack DEB generator specific variables:
Sets the `Breaks` field of the Debian package.
When a binary package (P) declares that it breaks other packages (B),
- :code:`dpkg` will not allow the package (P) which declares `Breaks` be
+ ``dpkg`` will not allow the package (P) which declares `Breaks` be
**unpacked** unless the packages that will be broken (B) are deconfigured
first.
As long as the package (P) is configured, the previously deconfigured
@@ -344,7 +344,7 @@ List of CPack DEB generator specific variables:
Sets the `Conflicts` field of the Debian package.
When one binary package declares a conflict with another using a `Conflicts`
- field, :code:`dpkg` will not allow them to be unpacked on the system at
+ field, ``dpkg`` will not allow them to be unpacked on the system at
the same time.
* Mandatory : NO
diff --git a/Help/cpack_gen/freebsd.rst b/Help/cpack_gen/freebsd.rst
index b22ea9a81..a8dd32050 100644
--- a/Help/cpack_gen/freebsd.rst
+++ b/Help/cpack_gen/freebsd.rst
@@ -20,7 +20,7 @@ The CPack FreeBSD generator should work on any host with libpkg installed. The
packages it produces are specific to the host architecture and ABI.
The CPack FreeBSD generator sets package-metadata through
-:code:`CPACK_FREEBSD_XXX` variables. The CPack FreeBSD generator, unlike the
+``CPACK_FREEBSD_XXX`` variables. The CPack FreeBSD generator, unlike the
CPack Deb generator, does not specially support componentized packages; a
single package is created from all the software artifacts created through
CMake.
diff --git a/Help/cpack_gen/nuget.rst b/Help/cpack_gen/nuget.rst
index c8c481f8e..f8aa6266b 100644
--- a/Help/cpack_gen/nuget.rst
+++ b/Help/cpack_gen/nuget.rst
@@ -18,7 +18,7 @@ The CPack NuGet generator may be used to create NuGet packages using
it uses the ``CPACK_XXX`` variables used by :module:`CPack`.
The CPack NuGet generator has specific features which are controlled by the
-specifics :code:`CPACK_NUGET_XXX` variables. In the "one per group" mode
+specifics ``CPACK_NUGET_XXX`` variables. In the "one per group" mode
(see :variable:`CPACK_COMPONENTS_GROUPING`), ``<compName>`` placeholder
in the variables below would contain a group name (uppercased and turned into
a "C" identifier).
diff --git a/Help/cpack_gen/rpm.rst b/Help/cpack_gen/rpm.rst
index 5c543ffce..65009db84 100644
--- a/Help/cpack_gen/rpm.rst
+++ b/Help/cpack_gen/rpm.rst
@@ -11,9 +11,9 @@ The CPack RPM generator is a :module:`CPack` generator thus it uses the
``CPACK_XXX`` variables used by :module:`CPack`.
The CPack RPM generator has specific features which are controlled by the specifics
-:code:`CPACK_RPM_XXX` variables.
+``CPACK_RPM_XXX`` variables.
-:code:`CPACK_RPM_<COMPONENT>_XXXX` variables may be used in order to have
+``CPACK_RPM_<COMPONENT>_XXXX`` variables may be used in order to have
**component** specific values. Note however that ``<COMPONENT>`` refers to the
**grouping name** written in upper case. It may be either a component name or
a component GROUP name. Usually those variables correspond to RPM spec file
diff --git a/Help/dev/README.rst b/Help/dev/README.rst
index ce62abc4b..84da4f1d3 100644
--- a/Help/dev/README.rst
+++ b/Help/dev/README.rst
@@ -36,8 +36,10 @@ Developer Documentation
CMake developer documentation is provided by the following documents:
* The `CMake Source Code Guide`_.
+* The `CMake Documentation Guide`_.
.. _`CMake Source Code Guide`: source.rst
+.. _`CMake Documentation Guide`: documentation.rst
Maintainer Documentation
========================
diff --git a/Help/dev/documentation.rst b/Help/dev/documentation.rst
new file mode 100644
index 000000000..c302790aa
--- /dev/null
+++ b/Help/dev/documentation.rst
@@ -0,0 +1,530 @@
+CMake Documentation Guide
+*************************
+
+The following is a guide to the CMake documentation source for developers.
+See documentation on `CMake Development`_ for more information.
+
+.. _`CMake Development`: README.rst
+
+Help
+====
+
+The ``Help`` directory contains CMake help manual source files.
+They are written using the `reStructuredText`_ markup syntax and
+processed by `Sphinx`_ to generate the CMake help manuals.
+
+.. _`reStructuredText`: http://docutils.sourceforge.net/docs/ref/rst/introduction.html
+.. _`Sphinx`: http://sphinx-doc.org
+
+Markup Constructs
+-----------------
+
+In addition to using Sphinx to generate the CMake help manuals, we
+also use a C++-implemented document processor to print documents for
+the ``--help-*`` command-line help options. It supports a subset of
+reStructuredText markup. When authoring or modifying documents,
+please verify that the command-line help looks good in addition to the
+Sphinx-generated html and man pages.
+
+The command-line help processor supports the following constructs
+defined by reStructuredText, Sphinx, and a CMake extension to Sphinx.
+
+..
+ Note: This list must be kept consistent with the cmRST implementation.
+
+CMake Domain directives
+ Directives defined in the `CMake Domain`_ for defining CMake
+ documentation objects are printed in command-line help output as
+ if the lines were normal paragraph text with interpretation.
+
+CMake Domain interpreted text roles
+ Interpreted text roles defined in the `CMake Domain`_ for
+ cross-referencing CMake documentation objects are replaced by their
+ link text in command-line help output. Other roles are printed
+ literally and not processed.
+
+``code-block`` directive
+ Add a literal code block without interpretation. The command-line
+ help processor prints the block content without the leading directive
+ line and with common indentation replaced by one space.
+
+``include`` directive
+ Include another document source file. The command-line help
+ processor prints the included document inline with the referencing
+ document.
+
+literal block after ``::``
+ A paragraph ending in ``::`` followed by a blank line treats
+ the following indented block as literal text without interpretation.
+ The command-line help processor prints the ``::`` literally and
+ prints the block content with common indentation replaced by one
+ space.
+
+``note`` directive
+ Call out a side note. The command-line help processor prints the
+ block content as if the lines were normal paragraph text with
+ interpretation.
+
+``parsed-literal`` directive
+ Add a literal block with markup interpretation. The command-line
+ help processor prints the block content without the leading
+ directive line and with common indentation replaced by one space.
+
+``productionlist`` directive
+ Render context-free grammar productions. The command-line help
+ processor prints the block content as if the lines were normal
+ paragraph text with interpretation.
+
+``replace`` directive
+ Define a ``|substitution|`` replacement.
+ The command-line help processor requires a substitution replacement
+ to be defined before it is referenced.
+
+``|substitution|`` reference
+ Reference a substitution replacement previously defined by
+ the ``replace`` directive. The command-line help processor
+ performs the substitution and replaces all newlines in the
+ replacement text with spaces.
+
+``toctree`` directive
+ Include other document sources in the Table-of-Contents
+ document tree. The command-line help processor prints
+ the referenced documents inline as part of the referencing
+ document.
+
+Inline markup constructs not listed above are printed literally in the
+command-line help output. We prefer to use inline markup constructs that
+look correct in source form, so avoid use of \\-escapes in favor of inline
+literals when possible.
+
+Explicit markup blocks not matching directives listed above are removed from
+command-line help output. Do not use them, except for plain ``..`` comments
+that are removed by Sphinx too.
+
+Note that nested indentation of blocks is not recognized by the
+command-line help processor. Therefore:
+
+* Explicit markup blocks are recognized only when not indented
+ inside other blocks.
+
+* Literal blocks after paragraphs ending in ``::`` but not
+ at the top indentation level may consume all indented lines
+ following them.
+
+Try to avoid these cases in practice.
+
+CMake Domain
+------------
+
+CMake adds a `Sphinx Domain`_ called ``cmake``, also called the
+"CMake Domain". It defines several "object" types for CMake
+documentation:
+
+``command``
+ A CMake language command.
+
+``generator``
+ A CMake native build system generator.
+ See the `cmake(1)`_ command-line tool's ``-G`` option.
+
+``manual``
+ A CMake manual page, like the `cmake(1)`_ manual.
+
+``module``
+ A CMake module.
+ See the `cmake-modules(7)`_ manual
+ and the `include()`_ command.
+
+``policy``
+ A CMake policy.
+ See the `cmake-policies(7)`_ manual
+ and the `cmake_policy()`_ command.
+
+``prop_cache, prop_dir, prop_gbl, prop_sf, prop_inst, prop_test, prop_tgt``
+ A CMake cache, directory, global, source file, installed file, test,
+ or target property, respectively. See the `cmake-properties(7)`_
+ manual and the `set_property()`_ command.
+
+``variable``
+ A CMake language variable.
+ See the `cmake-variables(7)`_ manual
+ and the `set()`_ command.
+
+Documentation objects in the CMake Domain come from two sources.
+First, the CMake extension to Sphinx transforms every document named
+with the form ``Help/<type>/<file-name>.rst`` to a domain object with
+type ``<type>``. The object name is extracted from the document title,
+which is expected to be of the form::
+
+ <object-name>
+ -------------
+
+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
+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.
+
+Second, the CMake Domain provides directives to define objects inside
+other documents:
+
+.. code-block:: rst
+
+ .. command:: <command-name>
+
+ This indented block documents <command-name>.
+
+ .. variable:: <variable-name>
+
+ This indented block documents <variable-name>.
+
+Object types for which no directive is available must be defined using
+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-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
+.. _`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
+
+Cross-References
+----------------
+
+Sphinx uses reStructuredText interpreted text roles to provide
+cross-reference syntax. The `CMake Domain`_ provides for each
+domain object type a role of the same name to cross-reference it.
+CMake Domain roles are inline markup of the forms::
+
+ :type:`name`
+ :type:`text <name>`
+
+where ``type`` is the domain object type and ``name`` is the
+domain object name. In the first form the link text will be
+``name`` (or ``name()`` if the type is ``command``) and in
+the second form the link text will be the explicit ``text``.
+For example, the code:
+
+.. code-block:: rst
+
+ * The :command:`list` command.
+ * The :command:`list(APPEND)` sub-command.
+ * The :command:`list() command <list>`.
+ * The :command:`list(APPEND) sub-command <list>`.
+ * The :variable:`CMAKE_VERSION` variable.
+ * The :prop_tgt:`OUTPUT_NAME_<CONFIG>` target property.
+
+produces:
+
+* The `list()`_ command.
+* The `list(APPEND)`_ sub-command.
+* The `list() command`_.
+* The `list(APPEND) sub-command`_.
+* The `CMAKE_VERSION`_ variable.
+* The `OUTPUT_NAME_<CONFIG>`_ target property.
+
+Note that CMake Domain roles differ from Sphinx and reStructuredText
+convention in that the form ``a<b>``, without a space preceding ``<``,
+is interpreted as a name instead of link text with an explicit target.
+This is necessary because we use ``<placeholders>`` frequently in
+object names like ``OUTPUT_NAME_<CONFIG>``. The form ``a <b>``,
+with a space preceding ``<``, is still interpreted as a link text
+with an explicit target.
+
+.. _`list()`: https://cmake.org/cmake/help/latest/command/list.html
+.. _`list(APPEND)`: https://cmake.org/cmake/help/latest/command/list.html
+.. _`list(APPEND) sub-command`: https://cmake.org/cmake/help/latest/command/list.html
+.. _`list() command`: https://cmake.org/cmake/help/latest/command/list.html
+.. _`CMAKE_VERSION`: https://cmake.org/cmake/help/latest/variable/CMAKE_VERSION.html
+.. _`OUTPUT_NAME_<CONFIG>`: https://cmake.org/cmake/help/latest/prop_tgt/OUTPUT_NAME_CONFIG.html
+
+Style
+-----
+
+Style: Section Headers
+^^^^^^^^^^^^^^^^^^^^^^
+
+When marking section titles, make the section decoration line as long as
+the title text. Use only a line below the title, not above. For
+example:
+
+.. code-block:: rst
+
+ Title Text
+ ----------
+
+Capitalize the first letter of each non-minor word in the title.
+
+The section header underline character hierarchy is
+
+* ``#``: Manual group (part) in the master document
+* ``*``: Manual (chapter) title
+* ``=``: Section within a manual
+* ``-``: Subsection or `CMake Domain`_ object document title
+* ``^``: Subsubsection or `CMake Domain`_ object document section
+* ``"``: Paragraph or `CMake Domain`_ object document subsection
+
+Style: Whitespace
+^^^^^^^^^^^^^^^^^
+
+Use two spaces for indentation. Use two spaces between sentences in
+prose.
+
+Style: Line Length
+^^^^^^^^^^^^^^^^^^
+
+Prefer to restrict the width of lines to 75-80 columns. This is not a
+hard restriction, but writing new paragraphs wrapped at 75 columns
+allows space for adding minor content without significant re-wrapping of
+content.
+
+Style: Prose
+^^^^^^^^^^^^
+
+Use American English spellings in prose.
+
+Style: Starting Literal Blocks
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Prefer to mark the start of literal blocks with ``::`` at the end of
+the preceding paragraph. In cases where the following block gets
+a ``code-block`` marker, put a single ``:`` at the end of the preceding
+paragraph.
+
+Style: CMake Command Signatures
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Command signatures should be marked up as plain literal blocks, not as
+cmake ``code-blocks``.
+
+Signatures are separated from preceding content by a section header.
+That is, use:
+
+.. code-block:: rst
+
+ ... preceding paragraph.
+
+ Normal Libraries
+ ^^^^^^^^^^^^^^^^
+
+ ::
+
+ add_library(<lib> ...)
+
+ This signature is used for ...
+
+Signatures of commands should wrap optional parts with square brackets,
+and should mark list of optional arguments with an ellipsis (``...``).
+Elements of the signature which are specified by the user should be
+specified with angle brackets, and may be referred to in prose using
+``inline-literal`` syntax.
+
+Style: Boolean Constants
+^^^^^^^^^^^^^^^^^^^^^^^^
+
+Use "``OFF``" and "``ON``" for boolean values which can be modified by
+the user, such as ``POSITION_INDEPENDENT_CODE``. Such properties
+may be "enabled" and "disabled". Use "``True``" and "``False``" for
+inherent values which can't be modified after being set, such as the
+``IMPORTED`` property of a build target.
+
+Style: Inline Literals
+^^^^^^^^^^^^^^^^^^^^^^
+
+Mark up references to keywords in signatures, file names, and other
+technical terms with ``inline-literal`` syntax, for example:
+
+.. code-block:: rst
+
+ If ``WIN32`` is used with :command:`add_executable`, the
+ :prop_tgt:`WIN32_EXECUTABLE` target property is enabled. That command
+ creates the file ``<name>.exe`` on Windows.
+
+Style: Cross-References
+^^^^^^^^^^^^^^^^^^^^^^^
+
+Mark up linkable references as links, including repeats.
+An alternative, which is used by wikipedia
+(`<http://en.wikipedia.org/wiki/WP:REPEATLINK>`_),
+is to link to a reference only once per article. That style is not used
+in CMake documentation.
+
+Style: Referencing CMake Concepts
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+If referring to a concept which corresponds to a property, and that
+concept is described in a high-level manual, prefer to link to the
+manual section instead of the property. For example:
+
+.. code-block:: rst
+
+ This command creates an :ref:`Imported Target <Imported Targets>`.
+
+instead of:
+
+.. code-block:: rst
+
+ This command creates an :prop_tgt:`IMPORTED` target.
+
+The latter should be used only when referring specifically to the
+property.
+
+References to manual sections are not automatically created by creating
+a section, but code such as:
+
+.. code-block:: rst
+
+ .. _`Imported Targets`:
+
+creates a suitable anchor. Use an anchor name which matches the name
+of the corresponding section. Refer to the anchor using a
+cross-reference with specified text.
+
+Imported Targets need the ``IMPORTED`` term marked up with care in
+particular because the term may refer to a command keyword, a target
+property, or a concept.
+
+Where a property, command or variable is related conceptually to others,
+by for example, being related to the buildsystem description, generator
+expressions or Qt, each relevant property, command or variable should
+link to the primary manual, which provides high-level information. Only
+particular information relating to the command should be in the
+documentation of the command.
+
+Style: Referencing CMake Domain Objects
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+When referring to `CMake Domain`_ objects such as properties, variables,
+commands etc, prefer to link to the target object and follow that with
+the type of object it is. For example:
+
+.. code-block:: rst
+
+ Set the :prop_tgt:`AUTOMOC` target property to ``ON``.
+
+Instead of
+
+.. code-block:: rst
+
+ Set the target property :prop_tgt:`AUTOMOC` to ``ON``.
+
+The ``policy`` directive is an exception, and the type us usually
+referred to before the link:
+
+.. code-block:: rst
+
+ If policy :policy:`CMP0022` is set to ``NEW`` the behavior is ...
+
+However, markup self-references with ``inline-literal`` syntax.
+For example, within the ``add_executable`` command documentation, use
+
+.. code-block:: rst
+
+ ``add_executable``
+
+not
+
+.. code-block:: rst
+
+ :command:`add_executable`
+
+which is used elsewhere.
+
+Modules
+=======
+
+The ``Modules`` directory contains CMake-language ``.cmake`` module files.
+
+Module Documentation
+--------------------
+
+To document CMake module ``Modules/<module-name>.cmake``, modify
+``Help/manual/cmake-modules.7.rst`` to reference the module in the
+``toctree`` directive, in sorted order, as::
+
+ /module/<module-name>
+
+Then add the module document file ``Help/module/<module-name>.rst``
+containing just the line::
+
+ .. cmake-module:: ../../Modules/<module-name>.cmake
+
+The ``cmake-module`` directive will scan the module file to extract
+reStructuredText markup from comment blocks that start in ``.rst:``.
+At the top of ``Modules/<module-name>.cmake``, begin with the following
+license notice:
+
+::
+
+ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ # file Copyright.txt or https://cmake.org/licensing for details.
+
+After this notice, add a *BLANK* line. Then, add documentation using
+a `Bracket Comment`_ of the form:
+
+::
+
+ #[=======================================================================[.rst:
+ <module-name>
+ -------------
+
+ <reStructuredText documentation of module>
+ #]=======================================================================]
+
+Any number of ``=`` may be used in the opening and closing brackets
+as long as they match. Content on the line containing the closing
+bracket is excluded if and only if the line starts in ``#``.
+
+Additional such ``.rst:`` comments may appear anywhere in the module file.
+All such comments must start with ``#`` in the first column.
+
+For example, a ``Findxxx.cmake`` module may contain:
+
+::
+
+ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ # file Copyright.txt or https://cmake.org/licensing for details.
+
+ #[=======================================================================[.rst:
+ FindXxx
+ -------
+
+ This is a cool module.
+ This module does really cool stuff.
+ It can do even more than you think.
+
+ It even needs two paragraphs to tell you about it.
+ And it defines the following variables:
+
+ ``VAR_COOL``
+ this is great isn't it?
+ ``VAR_REALLY_COOL``
+ cool right?
+ #]=======================================================================]
+
+ <code>
+
+ #[=======================================================================[.rst:
+ .. command:: xxx_do_something
+
+ This command does something for Xxx::
+
+ xxx_do_something(some arguments)
+ #]=======================================================================]
+ macro(xxx_do_something)
+ <code>
+ endmacro()
+
+Test the documentation formatting by running
+``cmake --help-module <module-name>``, and also by enabling the
+``SPHINX_HTML`` and ``SPHINX_MAN`` options to build the documentation.
+Edit the comments until generated documentation looks satisfactory. To
+have a .cmake file in this directory NOT show up in the modules
+documentation, simply leave out the ``Help/module/<module-name>.rst``
+file and the ``Help/manual/cmake-modules.7.rst`` toctree entry.
+
+.. _`Bracket Comment`: https://cmake.org/cmake/help/latest/manual/cmake-language.7.html#bracket-comment
diff --git a/Help/dev/review.rst b/Help/dev/review.rst
index a524115a5..1d664c4b8 100644
--- a/Help/dev/review.rst
+++ b/Help/dev/review.rst
@@ -238,12 +238,10 @@ Referencing Commits in Commit Messages
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The preferred form for references to other commits is
-``commit <commit> (<subject>, <date>)``, where:
+``commit <shorthash> (<subject>, <date>)``, where:
-* ``<commit>``:
- If available, a tag-relative name of the commit produced by
- ``git describe --contains <commit-ish>``. Otherwise, the first
- 8-10 characters of the commit ``<hash>``.
+* ``<shorthash>``:
+ The abbreviated hash of the commit.
* ``<subject>``:
The first line of the commit message.
@@ -252,6 +250,17 @@ The preferred form for references to other commits is
The author date of the commit, in its original time zone, formatted as
``CCYY-MM-DD``. ``git-log(1)`` shows the original time zone by default.
+This may be generated with
+``git show -s --date=short --pretty="format:%h (%s, %ad)" <commit>``.
+
+If the commit is a fix for the mentioned commit, consider using a ``Fixes:``
+trailer in the commit message with the specified format. This trailer should
+not be word-wrapped. Note that if there is also an issue for what is being
+fixed, it is preferrable to link to the issue instead.
+
+If relevant, add the first release tag of CMake containing the commit after
+the ``<date>``, i.e., ``commit <shorthash> (<subject>, <date>, <tag>)``.
+
Alternatively, the full commit ``<hash>`` may be used.
Revising Commit Messages
@@ -323,6 +332,14 @@ branch (e.g. ``master``) branch followed by a sequence of merges each
integrating changes from an open MR that has been staged for integration
testing. Each time the target integration branch is updated the stage
is rebuilt automatically by merging the staged MR topics again.
+The branch is stored in the upstream repository by special refs:
+
+* ``refs/stage/master/head``: The current topic stage branch.
+ This is used by continuous builds that report to CDash.
+* ``refs/stage/master/nightly/latest``: Topic stage as of 1am UTC each night.
+ This is used by most nightly builds that report to CDash.
+* ``refs/stage/master/nightly/<yyyy>/<mm>/<dd>``: Topic stage as of 1am UTC
+ on the date specified. This is used for historical reference.
`CMake GitLab Project Developers`_ may stage a MR for integration testing
by adding a comment with a command among the `comment trailing lines`_::
diff --git a/Help/dev/source.rst b/Help/dev/source.rst
index 57de81885..47baff42d 100644
--- a/Help/dev/source.rst
+++ b/Help/dev/source.rst
@@ -30,23 +30,6 @@ building on older toolchains some constructs need to be handled with care:
The ``std::auto_ptr`` template is deprecated in C++11. Use ``std::unique_ptr``.
-* Use ``CM_DISABLE_COPY(Class)`` to mark classes as non-copyable.
-
- The ``CM_DISABLE_COPY`` macro should be used in the private section of a
- class to make sure that attempts to copy or assign an instance of the class
- lead to compiler errors even if the compiler does not support *deleted*
- functions. As a guideline, all polymorphic classes should be made
- non-copyable in order to avoid slicing. Classes that are composed of or
- derived from non-copyable classes must also be made non-copyable explicitly
- with ``CM_DISABLE_COPY``.
-
-* Use ``size_t`` instead of ``std::size_t``.
-
- Various implementations have differing implementation of ``size_t``.
- When assigning the result of ``.size()`` on a container for example,
- the result should be assigned to ``size_t`` not to ``std::size_t``,
- ``unsigned int`` or similar types.
-
Source Tree Layout
==================
@@ -56,7 +39,7 @@ The CMake source tree is organized as follows.
Shell and editor integration files.
* ``Help/``:
- Documentation.
+ Documentation. See the `CMake Documentation Guide`_.
* ``Help/dev/``:
Developer documentation.
@@ -92,4 +75,5 @@ The CMake source tree is organized as follows.
* ``Utilities/Release/``:
Scripts used to package CMake itself for distribution on ``cmake.org``.
+.. _`CMake Documentation Guide`: documentation.rst
.. _`Tests/README.rst`: ../../Tests/README.rst
diff --git a/Help/envvar/ASM_DIALECT.rst b/Help/envvar/ASM_DIALECT.rst
index ec48f7145..cabb95971 100644
--- a/Help/envvar/ASM_DIALECT.rst
+++ b/Help/envvar/ASM_DIALECT.rst
@@ -1,6 +1,8 @@
ASM<DIALECT>
------------
+.. include:: ENV_VAR.txt
+
Preferred executable for compiling a specific dialect of assembly language
files. ``ASM<DIALECT>`` can be ``ASM``, ``ASM_NASM``, ``ASM_MASM`` or
``ASM-ATT``. Will only be used by CMake on the first configuration to determine
diff --git a/Help/envvar/ASM_DIALECTFLAGS.rst b/Help/envvar/ASM_DIALECTFLAGS.rst
index 4ed02fe22..90cbbdb39 100644
--- a/Help/envvar/ASM_DIALECTFLAGS.rst
+++ b/Help/envvar/ASM_DIALECTFLAGS.rst
@@ -1,6 +1,8 @@
ASM<DIALECT>FLAGS
-----------------
+.. include:: ENV_VAR.txt
+
Default compilation flags to be used when compiling a specific dialect of an
assembly language. ``ASM<DIALECT>FLAGS`` can be ``ASMFLAGS``, ``ASM_NASMFLAGS``,
``ASM_MASMFLAGS`` or ``ASM-ATTFLAGS``. Will only be used by CMake on the
diff --git a/Help/envvar/CC.rst b/Help/envvar/CC.rst
index 7e68110a1..ef120593e 100644
--- a/Help/envvar/CC.rst
+++ b/Help/envvar/CC.rst
@@ -1,6 +1,8 @@
CC
--
+.. include:: ENV_VAR.txt
+
Preferred executable for compiling ``C`` language files. Will only be used by
CMake on the first configuration to determine ``C`` compiler, after which the
value for ``CC`` is stored in the cache as
diff --git a/Help/envvar/CFLAGS.rst b/Help/envvar/CFLAGS.rst
index 60b2cd36a..fda9ccc48 100644
--- a/Help/envvar/CFLAGS.rst
+++ b/Help/envvar/CFLAGS.rst
@@ -1,6 +1,8 @@
CFLAGS
------
+.. include:: ENV_VAR.txt
+
Default compilation flags to be used when compiling ``C`` files. Will only be
used by CMake on the first configuration to determine ``CC`` default compilation
flags, after which the value for ``CFLAGS`` is stored in the cache
diff --git a/Help/envvar/CMAKE_BUILD_PARALLEL_LEVEL.rst b/Help/envvar/CMAKE_BUILD_PARALLEL_LEVEL.rst
index 198dc513f..199ca3e4b 100644
--- a/Help/envvar/CMAKE_BUILD_PARALLEL_LEVEL.rst
+++ b/Help/envvar/CMAKE_BUILD_PARALLEL_LEVEL.rst
@@ -1,6 +1,8 @@
CMAKE_BUILD_PARALLEL_LEVEL
--------------------------
+.. include:: ENV_VAR.txt
+
Specifies the maximum number of concurrent processes to use when building
using the ``cmake --build`` command line
:ref:`Build Tool Mode <Build Tool Mode>`.
diff --git a/Help/envvar/CMAKE_CONFIG_TYPE.rst b/Help/envvar/CMAKE_CONFIG_TYPE.rst
index 1306b47da..168593d50 100644
--- a/Help/envvar/CMAKE_CONFIG_TYPE.rst
+++ b/Help/envvar/CMAKE_CONFIG_TYPE.rst
@@ -1,5 +1,7 @@
CMAKE_CONFIG_TYPE
-----------------
+.. include:: ENV_VAR.txt
+
The default build configuration for :ref:`Build Tool Mode` and
``ctest`` build handler when there is no explicit configuration given.
diff --git a/Help/envvar/CMAKE_MSVCIDE_RUN_PATH.rst b/Help/envvar/CMAKE_MSVCIDE_RUN_PATH.rst
index 54d5f9e02..77ead4d55 100644
--- a/Help/envvar/CMAKE_MSVCIDE_RUN_PATH.rst
+++ b/Help/envvar/CMAKE_MSVCIDE_RUN_PATH.rst
@@ -1,6 +1,8 @@
CMAKE_MSVCIDE_RUN_PATH
----------------------
+.. include:: ENV_VAR.txt
+
Extra PATH locations for custom commands when using
:generator:`Visual Studio 9 2008` (or above) generators.
diff --git a/Help/envvar/CMAKE_NO_VERBOSE.rst b/Help/envvar/CMAKE_NO_VERBOSE.rst
new file mode 100644
index 000000000..149efbd6f
--- /dev/null
+++ b/Help/envvar/CMAKE_NO_VERBOSE.rst
@@ -0,0 +1,8 @@
+CMAKE_NO_VERBOSE
+----------------
+
+Disables verbose output from CMake when :envvar:`VERBOSE` environment variable
+is set.
+
+Only your build tool of choice will still print verbose output when you start
+to actually build your project.
diff --git a/Help/envvar/CMAKE_OSX_ARCHITECTURES.rst b/Help/envvar/CMAKE_OSX_ARCHITECTURES.rst
index 5fd6e5223..ef7d5470b 100644
--- a/Help/envvar/CMAKE_OSX_ARCHITECTURES.rst
+++ b/Help/envvar/CMAKE_OSX_ARCHITECTURES.rst
@@ -1,6 +1,8 @@
CMAKE_OSX_ARCHITECTURES
-----------------------
+.. include:: ENV_VAR.txt
+
Target specific architectures for macOS.
The ``CMAKE_OSX_ARCHITECTURES`` environment variable sets the default value for
diff --git a/Help/envvar/CSFLAGS.rst b/Help/envvar/CSFLAGS.rst
index 251ddc577..404bb5930 100644
--- a/Help/envvar/CSFLAGS.rst
+++ b/Help/envvar/CSFLAGS.rst
@@ -1,6 +1,8 @@
CSFLAGS
-------
+.. include:: ENV_VAR.txt
+
Preferred executable for compiling ``CSharp`` language files. Will only be
used by CMake on the first configuration to determine ``CSharp`` default
compilation flags, after which the value for ``CSFLAGS`` is stored in the cache
diff --git a/Help/envvar/CTEST_INTERACTIVE_DEBUG_MODE.rst b/Help/envvar/CTEST_INTERACTIVE_DEBUG_MODE.rst
index 25ed14f1b..b769d51d8 100644
--- a/Help/envvar/CTEST_INTERACTIVE_DEBUG_MODE.rst
+++ b/Help/envvar/CTEST_INTERACTIVE_DEBUG_MODE.rst
@@ -1,5 +1,7 @@
CTEST_INTERACTIVE_DEBUG_MODE
----------------------------
+.. include:: ENV_VAR.txt
+
Environment variable that will exist and be set to ``1`` when a test executed
by CTest is run in interactive mode.
diff --git a/Help/envvar/CTEST_OUTPUT_ON_FAILURE.rst b/Help/envvar/CTEST_OUTPUT_ON_FAILURE.rst
index 1fcf42bcf..bf860cb40 100644
--- a/Help/envvar/CTEST_OUTPUT_ON_FAILURE.rst
+++ b/Help/envvar/CTEST_OUTPUT_ON_FAILURE.rst
@@ -1,6 +1,8 @@
CTEST_OUTPUT_ON_FAILURE
-----------------------
+.. include:: ENV_VAR.txt
+
Boolean environment variable that controls if the output should be logged for
failed tests. Set the value to 1, True, or ON to enable output on failure.
See :manual:`ctest(1)` for more information on controlling output of failed
diff --git a/Help/envvar/CTEST_PARALLEL_LEVEL.rst b/Help/envvar/CTEST_PARALLEL_LEVEL.rst
index c767a01ae..fd4936e37 100644
--- a/Help/envvar/CTEST_PARALLEL_LEVEL.rst
+++ b/Help/envvar/CTEST_PARALLEL_LEVEL.rst
@@ -1,5 +1,7 @@
CTEST_PARALLEL_LEVEL
--------------------
+.. include:: ENV_VAR.txt
+
Specify the number of tests for CTest to run in parallel. See :manual:`ctest(1)`
for more information on parallel test execution.
diff --git a/Help/envvar/CTEST_PROGRESS_OUTPUT.rst b/Help/envvar/CTEST_PROGRESS_OUTPUT.rst
index a8e15bc2f..de23e1191 100644
--- a/Help/envvar/CTEST_PROGRESS_OUTPUT.rst
+++ b/Help/envvar/CTEST_PROGRESS_OUTPUT.rst
@@ -1,6 +1,8 @@
CTEST_PROGRESS_OUTPUT
---------------------
+.. include:: ENV_VAR.txt
+
Boolean environment variable that affects how :manual:`ctest <ctest(1)>`
command output reports overall progress. When set to 1, TRUE, ON or anything
else that evaluates to boolean true, progress is reported by repeatedly
diff --git a/Help/envvar/CTEST_USE_LAUNCHERS_DEFAULT.rst b/Help/envvar/CTEST_USE_LAUNCHERS_DEFAULT.rst
index 8d8eea5f8..79dbb79f3 100644
--- a/Help/envvar/CTEST_USE_LAUNCHERS_DEFAULT.rst
+++ b/Help/envvar/CTEST_USE_LAUNCHERS_DEFAULT.rst
@@ -1,4 +1,6 @@
CTEST_USE_LAUNCHERS_DEFAULT
---------------------------
+.. include:: ENV_VAR.txt
+
Initializes the :variable:`CTEST_USE_LAUNCHERS` variable if not already defined.
diff --git a/Help/envvar/CUDACXX.rst b/Help/envvar/CUDACXX.rst
index 8a5fd4be3..10c0f9dd7 100644
--- a/Help/envvar/CUDACXX.rst
+++ b/Help/envvar/CUDACXX.rst
@@ -1,6 +1,8 @@
CUDACXX
-------
+.. include:: ENV_VAR.txt
+
Preferred executable for compiling ``CUDA`` language files. Will only be used by
CMake on the first configuration to determine ``CUDA`` compiler, after which the
value for ``CUDA`` is stored in the cache as
diff --git a/Help/envvar/CUDAFLAGS.rst b/Help/envvar/CUDAFLAGS.rst
index 3dff49fb6..4456d6bf8 100644
--- a/Help/envvar/CUDAFLAGS.rst
+++ b/Help/envvar/CUDAFLAGS.rst
@@ -1,6 +1,8 @@
CUDAFLAGS
---------
+.. include:: ENV_VAR.txt
+
Default compilation flags to be used when compiling ``CUDA`` files. Will only be
used by CMake on the first configuration to determine ``CUDA`` default
compilation flags, after which the value for ``CUDAFLAGS`` is stored in the
diff --git a/Help/envvar/CUDAHOSTCXX.rst b/Help/envvar/CUDAHOSTCXX.rst
index bb786ca83..b9f65bd1e 100644
--- a/Help/envvar/CUDAHOSTCXX.rst
+++ b/Help/envvar/CUDAHOSTCXX.rst
@@ -1,6 +1,8 @@
CUDAHOSTCXX
-----------
+.. include:: ENV_VAR.txt
+
Preferred executable for compiling host code when compiling ``CUDA``
language files. Will only be used by CMake on the first configuration to
determine ``CUDA`` host compiler, after which the value for ``CUDAHOSTCXX`` is
diff --git a/Help/envvar/CXX.rst b/Help/envvar/CXX.rst
index 3b1e445b4..d6553501a 100644
--- a/Help/envvar/CXX.rst
+++ b/Help/envvar/CXX.rst
@@ -1,6 +1,8 @@
CXX
---
+.. include:: ENV_VAR.txt
+
Preferred executable for compiling ``CXX`` language files. Will only be used by
CMake on the first configuration to determine ``CXX`` compiler, after which the
value for ``CXX`` is stored in the cache as
diff --git a/Help/envvar/CXXFLAGS.rst b/Help/envvar/CXXFLAGS.rst
index 8b58abd06..d7296dca0 100644
--- a/Help/envvar/CXXFLAGS.rst
+++ b/Help/envvar/CXXFLAGS.rst
@@ -1,6 +1,8 @@
CXXFLAGS
--------
+.. include:: ENV_VAR.txt
+
Default compilation flags to be used when compiling ``CXX`` (C++) files. Will
only be used by CMake on the first configuration to determine ``CXX`` default
compilation flags, after which the value for ``CXXFLAGS`` is stored in the cache
diff --git a/Help/envvar/DASHBOARD_TEST_FROM_CTEST.rst b/Help/envvar/DASHBOARD_TEST_FROM_CTEST.rst
index fab1c0c33..2b303a4e9 100644
--- a/Help/envvar/DASHBOARD_TEST_FROM_CTEST.rst
+++ b/Help/envvar/DASHBOARD_TEST_FROM_CTEST.rst
@@ -1,5 +1,7 @@
DASHBOARD_TEST_FROM_CTEST
-------------------------
+.. include:: ENV_VAR.txt
+
Environment variable that will exist when a test executed by CTest is run
in non-interactive mode. The value will be equal to :variable:`CMAKE_VERSION`.
diff --git a/Help/envvar/DESTDIR.rst b/Help/envvar/DESTDIR.rst
index 87f1115c4..d2144ae7c 100644
--- a/Help/envvar/DESTDIR.rst
+++ b/Help/envvar/DESTDIR.rst
@@ -1,6 +1,8 @@
DESTDIR
-------
+.. include:: ENV_VAR.txt
+
On UNIX one can use the ``DESTDIR`` mechanism in order to relocate the
whole installation. ``DESTDIR`` means DESTination DIRectory. It is
commonly used by makefile users in order to install software at
diff --git a/Help/envvar/ENV_VAR.txt b/Help/envvar/ENV_VAR.txt
new file mode 100644
index 000000000..e1e70cd99
--- /dev/null
+++ b/Help/envvar/ENV_VAR.txt
@@ -0,0 +1,3 @@
+This is a CMake :ref:`Environment Variable <CMake Language
+Environment Variables>`. Its initial value is taken from
+the calling process environment.
diff --git a/Help/envvar/FC.rst b/Help/envvar/FC.rst
index 7d293fdd4..d6cabbc90 100644
--- a/Help/envvar/FC.rst
+++ b/Help/envvar/FC.rst
@@ -1,6 +1,8 @@
FC
--
+.. include:: ENV_VAR.txt
+
Preferred executable for compiling ``Fortran`` language files. Will only be used
by CMake on the first configuration to determine ``Fortran`` compiler, after
which the value for ``Fortran`` is stored in the cache as
diff --git a/Help/envvar/FFLAGS.rst b/Help/envvar/FFLAGS.rst
index 19d61690c..02d3c3461 100644
--- a/Help/envvar/FFLAGS.rst
+++ b/Help/envvar/FFLAGS.rst
@@ -1,6 +1,8 @@
FFLAGS
------
+.. include:: ENV_VAR.txt
+
Default compilation flags to be used when compiling ``Fortran`` files. Will only
be used by CMake on the first configuration to determine ``Fortran`` default
compilation flags, after which the value for ``FFLAGS`` is stored in the cache
diff --git a/Help/envvar/LDFLAGS.rst b/Help/envvar/LDFLAGS.rst
index 52da99c1b..816d6ef77 100644
--- a/Help/envvar/LDFLAGS.rst
+++ b/Help/envvar/LDFLAGS.rst
@@ -1,6 +1,8 @@
LDFLAGS
-------
+.. include:: ENV_VAR.txt
+
Will only be used by CMake on the first configuration to determine the default
linker flags, after which the value for ``LDFLAGS`` is stored in the cache
as :variable:`CMAKE_EXE_LINKER_FLAGS_INIT`,
diff --git a/Help/envvar/MACOSX_DEPLOYMENT_TARGET.rst b/Help/envvar/MACOSX_DEPLOYMENT_TARGET.rst
index 9dafa3234..662bd03ec 100644
--- a/Help/envvar/MACOSX_DEPLOYMENT_TARGET.rst
+++ b/Help/envvar/MACOSX_DEPLOYMENT_TARGET.rst
@@ -1,6 +1,8 @@
MACOSX_DEPLOYMENT_TARGET
------------------------
+.. include:: ENV_VAR.txt
+
Specify the minimum version of macOS on which the target binaries are
to be deployed.
diff --git a/Help/envvar/PackageName_ROOT.rst b/Help/envvar/PackageName_ROOT.rst
index e01009bc7..ecec63bd0 100644
--- a/Help/envvar/PackageName_ROOT.rst
+++ b/Help/envvar/PackageName_ROOT.rst
@@ -1,6 +1,8 @@
<PackageName>_ROOT
------------------
+.. include:: ENV_VAR.txt
+
Calls to :command:`find_package(<PackageName>)` will search in prefixes
specified by the ``<PackageName>_ROOT`` environment variable, where
``<PackageName>`` is the name given to the ``find_package`` call
diff --git a/Help/envvar/RC.rst b/Help/envvar/RC.rst
index 6c2db1984..557520e8f 100644
--- a/Help/envvar/RC.rst
+++ b/Help/envvar/RC.rst
@@ -1,6 +1,8 @@
RC
--
+.. include:: ENV_VAR.txt
+
Preferred executable for compiling ``resource`` files. Will only be used by CMake
on the first configuration to determine ``resource`` compiler, after which the
value for ``RC`` is stored in the cache as
diff --git a/Help/envvar/RCFLAGS.rst b/Help/envvar/RCFLAGS.rst
index 4f2f31c03..45419fed1 100644
--- a/Help/envvar/RCFLAGS.rst
+++ b/Help/envvar/RCFLAGS.rst
@@ -1,6 +1,8 @@
RCFLAGS
-------
+.. include:: ENV_VAR.txt
+
Default compilation flags to be used when compiling ``resource`` files. Will
only be used by CMake on the first configuration to determine ``resource``
default compilation flags, after which the value for ``RCFLAGS`` is stored in
diff --git a/Help/envvar/VERBOSE.rst b/Help/envvar/VERBOSE.rst
new file mode 100644
index 000000000..2d775a5be
--- /dev/null
+++ b/Help/envvar/VERBOSE.rst
@@ -0,0 +1,10 @@
+VERBOSE
+-------
+
+Activates verbose output from CMake and your build tools of choice when
+you start to actually build your project.
+
+Note that any given value is ignored. It's just checked for existence.
+
+See also :ref:`Build Tool Mode <Build Tool Mode>` and
+:envvar:`CMAKE_NO_VERBOSE` environment variable
diff --git a/Help/generator/Green Hills MULTI.rst b/Help/generator/Green Hills MULTI.rst
index 1b4960d89..e474682b6 100644
--- a/Help/generator/Green Hills MULTI.rst
+++ b/Help/generator/Green Hills MULTI.rst
@@ -3,49 +3,64 @@ Green Hills MULTI
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 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 ``-T <toolset>`` can be supplied for setting the toolset to be used.
-All toolsets are expected to be located at ``GHS_TOOLSET_ROOT``.
-If the toolset is not specified then the latest toolset 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:
* ``GHS_TARGET_PLATFORM``
-Default to ``integrity``.
-Usual values are ``integrity``, ``threadx``, ``uvelosity``,
-``velosity``, ``vxworks``, ``standalone``.
+ | Defaults to ``integrity``.
+ | Usual values are ``integrity``, ``threadx``, ``uvelosity``, ``velosity``,
+ ``vxworks``, ``standalone``.
* ``GHS_PRIMARY_TARGET``
-Sets ``primaryTarget`` field in project file.
-Defaults to ``<arch>_<GHS_TARGET_PLATFORM>.tgt``.
+ | Sets ``primaryTarget`` entry in project file.
+ | Defaults to ``<arch>_<GHS_TARGET_PLATFORM>.tgt``.
* ``GHS_TOOLSET_ROOT``
-Default to ``C:/ghs``. Root path for ``toolset``.
+ | Root path for ``toolset`` searches.
+ | Defaults to ``C:/ghs``.
* ``GHS_OS_ROOT``
-Default to ``C:/ghs``. Root path for RTOS searches.
+ | Root path for RTOS searches.
+ | Defaults to ``C:/ghs``.
* ``GHS_OS_DIR``
-Default to latest platform OS installation at ``GHS_OS_ROOT``. Set this value if
-a specific RTOS is to be used.
+ | Sets ``-os_dir`` entry in project file.
+ | Defaults to latest platform OS installation at ``GHS_OS_ROOT``. Set this value if
+ a specific RTOS is to be used.
* ``GHS_BSP_NAME``
-Defaults to ``sim<arch>`` if not set by user.
+ | Sets ``-bsp`` entry in project file.
+ | Defaults to ``sim<arch>`` for ``integrity`` platforms.
Customizations are available through the following cache variables:
* ``GHS_CUSTOMIZATION``
* ``GHS_GPJ_MACROS``
+The following properties are available:
+
+* :prop_tgt:`GHS_INTEGRITY_APP`
+* :prop_tgt:`GHS_NO_SOURCE_GROUP_FILE`
+
.. note::
This generator is deemed experimental as of CMake |release|
and is still a work in progress. Future versions of CMake
diff --git a/Help/generator/VS_TOOLSET_HOST_ARCH.txt b/Help/generator/VS_TOOLSET_HOST_ARCH.txt
index 5d13e7741..4eb900f81 100644
--- a/Help/generator/VS_TOOLSET_HOST_ARCH.txt
+++ b/Help/generator/VS_TOOLSET_HOST_ARCH.txt
@@ -1,6 +1,7 @@
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). By default Visual Studio
-chooses the 32-bit variant even on a 64-bit host. One may request use of the
-64-bit host tools by adding a ``host=x64`` option to the toolset specification.
+(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.
diff --git a/Help/generator/Visual Studio 10 2010.rst b/Help/generator/Visual Studio 10 2010.rst
index 0446b8c1a..4bf9a8f15 100644
--- a/Help/generator/Visual Studio 10 2010.rst
+++ b/Help/generator/Visual Studio 10 2010.rst
@@ -15,6 +15,8 @@ projects (Database, Website, etc.) are not supported.
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:
diff --git a/Help/generator/Visual Studio 11 2012.rst b/Help/generator/Visual Studio 11 2012.rst
index 8fddbb301..5d89a6e7c 100644
--- a/Help/generator/Visual Studio 11 2012.rst
+++ b/Help/generator/Visual Studio 11 2012.rst
@@ -15,6 +15,8 @@ projects (JavaScript, Database, Website, etc.) are not supported.
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:
diff --git a/Help/generator/Visual Studio 12 2013.rst b/Help/generator/Visual Studio 12 2013.rst
index 8b4c16295..fb8e021bc 100644
--- a/Help/generator/Visual Studio 12 2013.rst
+++ b/Help/generator/Visual Studio 12 2013.rst
@@ -15,6 +15,8 @@ projects (JavaScript, Powershell, Python, etc.) are not supported.
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:
@@ -40,4 +42,7 @@ The ``v120`` toolset that comes with Visual Studio 12 2013 is selected by
default. The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps
via the :manual:`cmake(1)` ``-T`` option, to specify another toolset.
+.. |VS_TOOLSET_HOST_ARCH_DEFAULT| replace::
+ By default this generator uses the 32-bit variant even on a 64-bit host.
+
.. include:: VS_TOOLSET_HOST_ARCH.txt
diff --git a/Help/generator/Visual Studio 14 2015.rst b/Help/generator/Visual Studio 14 2015.rst
index 917d8e5c4..7383f7a6f 100644
--- a/Help/generator/Visual Studio 14 2015.rst
+++ b/Help/generator/Visual Studio 14 2015.rst
@@ -12,6 +12,8 @@ projects (JavaScript, Powershell, Python, etc.) are not supported.
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:
@@ -37,4 +39,7 @@ The ``v140`` toolset that comes with Visual Studio 14 2015 is selected by
default. The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps
via the :manual:`cmake(1)` ``-T`` option, to specify another toolset.
+.. |VS_TOOLSET_HOST_ARCH_DEFAULT| replace::
+ By default this generator uses the 32-bit variant even on a 64-bit host.
+
.. include:: VS_TOOLSET_HOST_ARCH.txt
diff --git a/Help/generator/Visual Studio 15 2017.rst b/Help/generator/Visual Studio 15 2017.rst
index 42a3bb6b3..7e6f0fb20 100644
--- a/Help/generator/Visual Studio 15 2017.rst
+++ b/Help/generator/Visual Studio 15 2017.rst
@@ -28,6 +28,8 @@ by default.
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:
@@ -54,4 +56,7 @@ The ``v141`` toolset that comes with Visual Studio 15 2017 is selected by
default. The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps
via the :manual:`cmake(1)` ``-T`` option, to specify another toolset.
+.. |VS_TOOLSET_HOST_ARCH_DEFAULT| replace::
+ By default this generator uses the 32-bit variant even on a 64-bit host.
+
.. include:: VS_TOOLSET_HOST_ARCH.txt
diff --git a/Help/generator/Visual Studio 16 2019.rst b/Help/generator/Visual Studio 16 2019.rst
new file mode 100644
index 000000000..b456554b9
--- /dev/null
+++ b/Help/generator/Visual Studio 16 2019.rst
@@ -0,0 +1,53 @@
+Visual Studio 16 2019
+---------------------
+
+Generates Visual Studio 16 (VS 2019) project files.
+
+Project Types
+^^^^^^^^^^^^^
+
+Only Visual C++ and C# projects may be generated. Other types of
+projects (JavaScript, Powershell, Python, etc.) are not supported.
+
+Instance Selection
+^^^^^^^^^^^^^^^^^^
+
+VS 2019 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 ``VS160COMNTOOLS`` 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
+^^^^^^^^^^^^^^^^^^
+
+The default target platform name (architecture) is that of the host.
+
+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 16 2019" -A Win32``
+* ``cmake -G "Visual Studio 16 2019" -A x64``
+* ``cmake -G "Visual Studio 16 2019" -A ARM``
+* ``cmake -G "Visual Studio 16 2019" -A ARM64``
+
+Toolset Selection
+^^^^^^^^^^^^^^^^^
+
+The ``v142`` toolset that comes with Visual Studio 16 2019 is selected by
+default. The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps
+via the :manual:`cmake(1)` ``-T`` option, to specify another toolset.
+
+.. |VS_TOOLSET_HOST_ARCH_DEFAULT| replace::
+ By default this generator uses the 64-bit variant on x64 hosts and
+ the 32-bit variant otherwise.
+
+.. include:: VS_TOOLSET_HOST_ARCH.txt
diff --git a/Help/generator/Visual Studio 9 2008.rst b/Help/generator/Visual Studio 9 2008.rst
index a29033f01..a09d047ae 100644
--- a/Help/generator/Visual Studio 9 2008.rst
+++ b/Help/generator/Visual Studio 9 2008.rst
@@ -6,6 +6,8 @@ Generates Visual Studio 9 2008 project files.
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:
diff --git a/Help/generator/Xcode.rst b/Help/generator/Xcode.rst
index 968c26a70..71430c7aa 100644
--- a/Help/generator/Xcode.rst
+++ b/Help/generator/Xcode.rst
@@ -3,7 +3,9 @@ Xcode
Generate Xcode project files.
-This supports Xcode 3.0 and above.
+This supports Xcode 3.0 and above. Support for Xcode versions prior
+to Xcode 5 is deprecated and will be dropped in a future version of
+CMake.
Toolset Selection
^^^^^^^^^^^^^^^^^
diff --git a/Help/index.rst b/Help/index.rst
index fe1b73c26..a94893972 100644
--- a/Help/index.rst
+++ b/Help/index.rst
@@ -30,6 +30,7 @@ Reference Manuals
/manual/cmake-compile-features.7
/manual/cmake-developer.7
/manual/cmake-env-variables.7
+ /manual/cmake-file-api.7
/manual/cmake-generator-expressions.7
/manual/cmake-generators.7
/manual/cmake-language.7
diff --git a/Help/manual/ccmake.1.rst b/Help/manual/ccmake.1.rst
index cc3ceec1b..954847150 100644
--- a/Help/manual/ccmake.1.rst
+++ b/Help/manual/ccmake.1.rst
@@ -13,7 +13,7 @@ Synopsis
Description
===========
-The "ccmake" executable is the CMake curses interface. Project
+The **ccmake** executable is the CMake curses interface. Project
configuration settings may be specified interactively through this
GUI. Brief instructions are provided at the bottom of the terminal
when the program is running.
diff --git a/Help/manual/cmake-buildsystem.7.rst b/Help/manual/cmake-buildsystem.7.rst
index 4fc484b2d..a1328f230 100644
--- a/Help/manual/cmake-buildsystem.7.rst
+++ b/Help/manual/cmake-buildsystem.7.rst
@@ -978,6 +978,7 @@ are:
* Built-in properties matching ``COMPATIBLE_INTERFACE_*``
* ``EXPORT_NAME``
* ``IMPORTED``
+* ``MANUALLY_ADDED_DEPENDENCIES``
* ``NAME``
* Properties matching ``IMPORTED_LIBNAME_*``
* Properties matching ``MAP_IMPORTED_CONFIG_*``
diff --git a/Help/manual/cmake-commands.7.rst b/Help/manual/cmake-commands.7.rst
index 0cc5fca83..a3bc46519 100644
--- a/Help/manual/cmake-commands.7.rst
+++ b/Help/manual/cmake-commands.7.rst
@@ -22,8 +22,8 @@ These commands are always available.
/command/cmake_policy
/command/configure_file
/command/continue
- /command/elseif
/command/else
+ /command/elseif
/command/endforeach
/command/endfunction
/command/endif
@@ -53,9 +53,9 @@ These commands are always available.
/command/option
/command/return
/command/separate_arguments
+ /command/set
/command/set_directory_properties
/command/set_property
- /command/set
/command/site_name
/command/string
/command/unset
@@ -100,8 +100,6 @@ These commands are available only in CMake projects.
/command/link_libraries
/command/load_cache
/command/project
- /command/qt_wrap_cpp
- /command/qt_wrap_ui
/command/remove_definitions
/command/set_source_files_properties
/command/set_target_properties
@@ -145,8 +143,10 @@ These commands are available only in CTest scripts.
Deprecated Commands
===================
-These commands are available only for compatibility with older
-versions of CMake. Do not use them in new code.
+These commands are deprecated and are only made available to maintain
+backward compatibility. The documentation of each command states the
+CMake version in which it was deprecated. Do not use these commands
+in new code.
.. toctree::
:maxdepth: 1
@@ -160,6 +160,8 @@ versions of CMake. Do not use them in new code.
/command/load_command
/command/make_directory
/command/output_required_files
+ /command/qt_wrap_cpp
+ /command/qt_wrap_ui
/command/remove
/command/subdir_depends
/command/subdirs
diff --git a/Help/manual/cmake-developer.7.rst b/Help/manual/cmake-developer.7.rst
index f05c4b129..85ed935e6 100644
--- a/Help/manual/cmake-developer.7.rst
+++ b/Help/manual/cmake-developer.7.rst
@@ -10,576 +10,20 @@ cmake-developer(7)
Introduction
============
-This manual is intended for reference by developers modifying the CMake
-source tree itself, and by those authoring externally-maintained modules.
-
-Adding Compile Features
-=======================
-
-CMake reports an error if a compiler whose features are known does not report
-support for a particular requested feature. A compiler is considered to have
-known features if it reports support for at least one feature.
-
-When adding a new compile feature to CMake, it is therefore necessary to list
-support for the feature for all CompilerIds which already have one or more
-feature supported, if the new feature is available for any version of the
-compiler.
-
-When adding the first supported feature to a particular CompilerId, it is
-necessary to list support for all features known to cmake (See
-:variable:`CMAKE_C_COMPILE_FEATURES` and
-:variable:`CMAKE_CXX_COMPILE_FEATURES` as appropriate), where available for
-the compiler. Ensure that the ``CMAKE_<LANG>_STANDARD_DEFAULT`` is set to
-the computed internal variable ``CMAKE_<LANG>_STANDARD_COMPUTED_DEFAULT``
-for compiler versions which should be supported.
-
-It is sensible to record the features for the most recent version of a
-particular CompilerId first, and then work backwards. It is sensible to
-try to create a continuous range of versions of feature releases of the
-compiler. Gaps in the range indicate incorrect features recorded for
-intermediate releases.
-
-Generally, features are made available for a particular version if the
-compiler vendor documents availability of the feature with that
-version. Note that sometimes partially implemented features appear to
-be functional in previous releases (such as ``cxx_constexpr`` in GNU 4.6,
-though availability is documented in GNU 4.7), and sometimes compiler vendors
-document availability of features, though supporting infrastructure is
-not available (such as ``__has_feature(cxx_generic_lambdas)`` indicating
-non-availability in Clang 3.4, though it is documented as available, and
-fixed in Clang 3.5). Similar cases for other compilers and versions
-need to be investigated when extending CMake to support them.
-
-When a vendor releases a new version of a known compiler which supports
-a previously unsupported feature, and there are already known features for
-that compiler, the feature should be listed as supported in CMake for
-that version of the compiler as soon as reasonably possible.
-
-Standard-specific/compiler-specific variables such
-``CMAKE_CXX98_COMPILE_FEATURES`` are deliberately not documented. They
-only exist for the compiler-specific implementation of adding the ``-std``
-compile flag for compilers which need that.
-
-Help
-====
-
-The ``Help`` directory contains CMake help manual source files.
-They are written using the `reStructuredText`_ markup syntax and
-processed by `Sphinx`_ to generate the CMake help manuals.
-
-.. _`reStructuredText`: http://docutils.sourceforge.net/docs/ref/rst/introduction.html
-.. _`Sphinx`: http://sphinx-doc.org
-
-Markup Constructs
------------------
-
-In addition to using Sphinx to generate the CMake help manuals, we
-also use a C++-implemented document processor to print documents for
-the ``--help-*`` command-line help options. It supports a subset of
-reStructuredText markup. When authoring or modifying documents,
-please verify that the command-line help looks good in addition to the
-Sphinx-generated html and man pages.
-
-The command-line help processor supports the following constructs
-defined by reStructuredText, Sphinx, and a CMake extension to Sphinx.
-
-..
- Note: This list must be kept consistent with the cmRST implementation.
-
-CMake Domain directives
- Directives defined in the `CMake Domain`_ for defining CMake
- documentation objects are printed in command-line help output as
- if the lines were normal paragraph text with interpretation.
-
-CMake Domain interpreted text roles
- Interpreted text roles defined in the `CMake Domain`_ for
- cross-referencing CMake documentation objects are replaced by their
- link text in command-line help output. Other roles are printed
- literally and not processed.
-
-``code-block`` directive
- Add a literal code block without interpretation. The command-line
- help processor prints the block content without the leading directive
- line and with common indentation replaced by one space.
-
-``include`` directive
- Include another document source file. The command-line help
- processor prints the included document inline with the referencing
- document.
-
-literal block after ``::``
- A paragraph ending in ``::`` followed by a blank line treats
- the following indented block as literal text without interpretation.
- The command-line help processor prints the ``::`` literally and
- prints the block content with common indentation replaced by one
- space.
-
-``note`` directive
- Call out a side note. The command-line help processor prints the
- block content as if the lines were normal paragraph text with
- interpretation.
-
-``parsed-literal`` directive
- Add a literal block with markup interpretation. The command-line
- help processor prints the block content without the leading
- directive line and with common indentation replaced by one space.
-
-``productionlist`` directive
- Render context-free grammar productions. The command-line help
- processor prints the block content as if the lines were normal
- paragraph text with interpretation.
-
-``replace`` directive
- Define a ``|substitution|`` replacement.
- The command-line help processor requires a substitution replacement
- to be defined before it is referenced.
-
-``|substitution|`` reference
- Reference a substitution replacement previously defined by
- the ``replace`` directive. The command-line help processor
- performs the substitution and replaces all newlines in the
- replacement text with spaces.
-
-``toctree`` directive
- Include other document sources in the Table-of-Contents
- document tree. The command-line help processor prints
- the referenced documents inline as part of the referencing
- document.
-
-Inline markup constructs not listed above are printed literally in the
-command-line help output. We prefer to use inline markup constructs that
-look correct in source form, so avoid use of \\-escapes in favor of inline
-literals when possible.
-
-Explicit markup blocks not matching directives listed above are removed from
-command-line help output. Do not use them, except for plain ``..`` comments
-that are removed by Sphinx too.
+This manual is intended for reference by developers working with
+:manual:`cmake-language(7)` code, whether writing their own modules,
+authoring their own build systems, or working on CMake itself.
-Note that nested indentation of blocks is not recognized by the
-command-line help processor. Therefore:
-
-* Explicit markup blocks are recognized only when not indented
- inside other blocks.
-
-* Literal blocks after paragraphs ending in ``::`` but not
- at the top indentation level may consume all indented lines
- following them.
-
-Try to avoid these cases in practice.
-
-CMake Domain
-------------
-
-CMake adds a `Sphinx Domain`_ called ``cmake``, also called the
-"CMake Domain". It defines several "object" types for CMake
-documentation:
-
-``command``
- A CMake language command.
-
-``generator``
- A CMake native build system generator.
- See the :manual:`cmake(1)` command-line tool's ``-G`` option.
-
-``manual``
- A CMake manual page, like this :manual:`cmake-developer(7)` manual.
-
-``module``
- A CMake module.
- See the :manual:`cmake-modules(7)` manual
- and the :command:`include` command.
-
-``policy``
- A CMake policy.
- See the :manual:`cmake-policies(7)` manual
- and the :command:`cmake_policy` command.
-
-``prop_cache, prop_dir, prop_gbl, prop_sf, prop_inst, prop_test, prop_tgt``
- A CMake cache, directory, global, source file, installed file, test,
- or target property, respectively. See the :manual:`cmake-properties(7)`
- manual and the :command:`set_property` command.
-
-``variable``
- A CMake language variable.
- See the :manual:`cmake-variables(7)` manual
- and the :command:`set` command.
-
-Documentation objects in the CMake Domain come from two sources.
-First, the CMake extension to Sphinx transforms every document named
-with the form ``Help/<type>/<file-name>.rst`` to a domain object with
-type ``<type>``. The object name is extracted from the document title,
-which is expected to be of the form::
-
- <object-name>
- -------------
-
-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
-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.
-
-Second, the CMake Domain provides directives to define objects inside
-other documents:
-
-.. code-block:: rst
-
- .. command:: <command-name>
-
- This indented block documents <command-name>.
-
- .. variable:: <variable-name>
-
- This indented block documents <variable-name>.
-
-Object types for which no directive is available must be defined using
-the first approach above.
-
-.. _`Sphinx Domain`: http://sphinx-doc.org/domains.html
-
-Cross-References
-----------------
-
-Sphinx uses reStructuredText interpreted text roles to provide
-cross-reference syntax. The `CMake Domain`_ provides for each
-domain object type a role of the same name to cross-reference it.
-CMake Domain roles are inline markup of the forms::
-
- :type:`name`
- :type:`text <name>`
-
-where ``type`` is the domain object type and ``name`` is the
-domain object name. In the first form the link text will be
-``name`` (or ``name()`` if the type is ``command``) and in
-the second form the link text will be the explicit ``text``.
-For example, the code:
-
-.. code-block:: rst
-
- * The :command:`list` command.
- * The :command:`list(APPEND)` sub-command.
- * The :command:`list() command <list>`.
- * The :command:`list(APPEND) sub-command <list>`.
- * The :variable:`CMAKE_VERSION` variable.
- * The :prop_tgt:`OUTPUT_NAME_<CONFIG>` target property.
-
-produces:
-
-* The :command:`list` command.
-* The :command:`list(APPEND)` sub-command.
-* The :command:`list() command <list>`.
-* The :command:`list(APPEND) sub-command <list>`.
-* The :variable:`CMAKE_VERSION` variable.
-* The :prop_tgt:`OUTPUT_NAME_<CONFIG>` target property.
-
-Note that CMake Domain roles differ from Sphinx and reStructuredText
-convention in that the form ``a<b>``, without a space preceding ``<``,
-is interpreted as a name instead of link text with an explicit target.
-This is necessary because we use ``<placeholders>`` frequently in
-object names like ``OUTPUT_NAME_<CONFIG>``. The form ``a <b>``,
-with a space preceding ``<``, is still interpreted as a link text
-with an explicit target.
-
-Style
------
-
-Style: Section Headers
-^^^^^^^^^^^^^^^^^^^^^^
-
-When marking section titles, make the section decoration line as long as
-the title text. Use only a line below the title, not above. For
-example:
-
-.. code-block:: rst
-
- Title Text
- ----------
-
-Capitalize the first letter of each non-minor word in the title.
-
-The section header underline character hierarchy is
-
-* ``#``: Manual group (part) in the master document
-* ``*``: Manual (chapter) title
-* ``=``: Section within a manual
-* ``-``: Subsection or `CMake Domain`_ object document title
-* ``^``: Subsubsection or `CMake Domain`_ object document section
-* ``"``: Paragraph or `CMake Domain`_ object document subsection
-
-Style: Whitespace
-^^^^^^^^^^^^^^^^^
-
-Use two spaces for indentation. Use two spaces between sentences in
-prose.
-
-Style: Line Length
-^^^^^^^^^^^^^^^^^^
-
-Prefer to restrict the width of lines to 75-80 columns. This is not a
-hard restriction, but writing new paragraphs wrapped at 75 columns
-allows space for adding minor content without significant re-wrapping of
-content.
-
-Style: Prose
-^^^^^^^^^^^^
-
-Use American English spellings in prose.
-
-Style: Starting Literal Blocks
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-Prefer to mark the start of literal blocks with ``::`` at the end of
-the preceding paragraph. In cases where the following block gets
-a ``code-block`` marker, put a single ``:`` at the end of the preceding
-paragraph.
-
-Style: CMake Command Signatures
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-Command signatures should be marked up as plain literal blocks, not as
-cmake ``code-blocks``.
-
-Signatures are separated from preceding content by a section header.
-That is, use:
-
-.. code-block:: rst
-
- ... preceding paragraph.
-
- Normal Libraries
- ^^^^^^^^^^^^^^^^
-
- ::
-
- add_library(<lib> ...)
-
- This signature is used for ...
-
-Signatures of commands should wrap optional parts with square brackets,
-and should mark list of optional arguments with an ellipsis (``...``).
-Elements of the signature which are specified by the user should be
-specified with angle brackets, and may be referred to in prose using
-``inline-literal`` syntax.
-
-Style: Boolean Constants
-^^^^^^^^^^^^^^^^^^^^^^^^
-
-Use "``OFF``" and "``ON``" for boolean values which can be modified by
-the user, such as :prop_tgt:`POSITION_INDEPENDENT_CODE`. Such properties
-may be "enabled" and "disabled". Use "``True``" and "``False``" for
-inherent values which can't be modified after being set, such as the
-:prop_tgt:`IMPORTED` property of a build target.
-
-Style: Inline Literals
-^^^^^^^^^^^^^^^^^^^^^^
-
-Mark up references to keywords in signatures, file names, and other
-technical terms with ``inline-literal`` syntax, for example:
-
-.. code-block:: rst
-
- If ``WIN32`` is used with :command:`add_executable`, the
- :prop_tgt:`WIN32_EXECUTABLE` target property is enabled. That command
- creates the file ``<name>.exe`` on Windows.
-
-Style: Cross-References
-^^^^^^^^^^^^^^^^^^^^^^^
-
-Mark up linkable references as links, including repeats.
-An alternative, which is used by wikipedia
-(`<http://en.wikipedia.org/wiki/WP:REPEATLINK>`_),
-is to link to a reference only once per article. That style is not used
-in CMake documentation.
-
-Style: Referencing CMake Concepts
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-If referring to a concept which corresponds to a property, and that
-concept is described in a high-level manual, prefer to link to the
-manual section instead of the property. For example:
-
-.. code-block:: rst
-
- This command creates an :ref:`Imported Target <Imported Targets>`.
-
-instead of:
-
-.. code-block:: rst
-
- This command creates an :prop_tgt:`IMPORTED` target.
-
-The latter should be used only when referring specifically to the
-property.
-
-References to manual sections are not automatically created by creating
-a section, but code such as:
-
-.. code-block:: rst
-
- .. _`Imported Targets`:
-
-creates a suitable anchor. Use an anchor name which matches the name
-of the corresponding section. Refer to the anchor using a
-cross-reference with specified text.
-
-Imported Targets need the ``IMPORTED`` term marked up with care in
-particular because the term may refer to a command keyword
-(``IMPORTED``), a target property (:prop_tgt:`IMPORTED`), or a
-concept (:ref:`Imported Targets`).
-
-Where a property, command or variable is related conceptually to others,
-by for example, being related to the buildsystem description, generator
-expressions or Qt, each relevant property, command or variable should
-link to the primary manual, which provides high-level information. Only
-particular information relating to the command should be in the
-documentation of the command.
-
-Style: Referencing CMake Domain Objects
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-When referring to `CMake Domain`_ objects such as properties, variables,
-commands etc, prefer to link to the target object and follow that with
-the type of object it is. For example:
-
-.. code-block:: rst
-
- Set the :prop_tgt:`AUTOMOC` target property to ``ON``.
-
-Instead of
-
-.. code-block:: rst
-
- Set the target property :prop_tgt:`AUTOMOC` to ``ON``.
-
-The ``policy`` directive is an exception, and the type us usually
-referred to before the link:
-
-.. code-block:: rst
-
- If policy :prop_tgt:`CMP0022` is set to ``NEW`` the behavior is ...
-
-However, markup self-references with ``inline-literal`` syntax.
-For example, within the :command:`add_executable` command
-documentation, use
-
-.. code-block:: rst
-
- ``add_executable``
-
-not
-
-.. code-block:: rst
-
- :command:`add_executable`
-
-which is used elsewhere.
-
-Modules
-=======
-
-The ``Modules`` directory contains CMake-language ``.cmake`` module files.
-
-Module Documentation
---------------------
-
-To document CMake module ``Modules/<module-name>.cmake``, modify
-``Help/manual/cmake-modules.7.rst`` to reference the module in the
-``toctree`` directive, in sorted order, as::
-
- /module/<module-name>
-
-Then add the module document file ``Help/module/<module-name>.rst``
-containing just the line::
-
- .. cmake-module:: ../../Modules/<module-name>.cmake
-
-The ``cmake-module`` directive will scan the module file to extract
-reStructuredText markup from comment blocks that start in ``.rst:``.
-At the top of ``Modules/<module-name>.cmake``, begin with the following
-license notice:
-
-.. code-block:: cmake
-
- # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
- # file Copyright.txt or https://cmake.org/licensing for details.
-
-After this notice, add a *BLANK* line. Then, add documentation using
-a :ref:`Line Comment` block of the form:
-
-.. code-block:: cmake
-
- #.rst:
- # <module-name>
- # -------------
- #
- # <reStructuredText documentation of module>
-
-or a :ref:`Bracket Comment` of the form:
-
-::
-
- #[[.rst:
- <module-name>
- -------------
-
- <reStructuredText documentation of module>
- #]]
-
-Any number of ``=`` may be used in the opening and closing brackets
-as long as they match. Content on the line containing the closing
-bracket is excluded if and only if the line starts in ``#``.
-
-Additional such ``.rst:`` comments may appear anywhere in the module file.
-All such comments must start with ``#`` in the first column.
-
-For example, a ``Modules/Findxxx.cmake`` module may contain:
-
-::
-
- # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
- # file Copyright.txt or https://cmake.org/licensing for details.
-
- #.rst:
- # FindXxx
- # -------
- #
- # This is a cool module.
- # This module does really cool stuff.
- # It can do even more than you think.
- #
- # It even needs two paragraphs to tell you about it.
- # And it defines the following variables:
- #
- # * VAR_COOL: this is great isn't it?
- # * VAR_REALLY_COOL: cool right?
-
- <code>
-
- #[========================================[.rst:
- .. command:: xxx_do_something
-
- This command does something for Xxx::
-
- xxx_do_something(some arguments)
- #]========================================]
- macro(xxx_do_something)
- <code>
- endmacro()
-
-Test the documentation formatting by running
-``cmake --help-module <module-name>``, and also by enabling the
-``SPHINX_HTML`` and ``SPHINX_MAN`` options to build the documentation.
-Edit the comments until generated documentation looks satisfactory. To
-have a .cmake file in this directory NOT show up in the modules
-documentation, simply leave out the ``Help/module/<module-name>.rst``
-file and the ``Help/manual/cmake-modules.7.rst`` toctree entry.
+See https://cmake.org/get-involved/ to get involved in development of
+CMake upstream. It includes links to contribution instructions, which
+in turn link to developer guides for CMake itself.
.. _`Find Modules`:
Find Modules
-------------
+============
-A "find module" is a ``Modules/Find<PackageName>.cmake`` file to be loaded
+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
@@ -638,16 +82,11 @@ and required is up to the find module, but should be documented.
For internal implementation, it is a generally accepted convention that
variables starting with underscore are for temporary use only.
-Like all modules, find modules should be properly documented. To add a
-module to the CMake documentation, follow the steps in the `Module
-Documentation`_ section above.
-
-
.. _`CMake Developer Standard Variable Names`:
Standard Variable Names
-^^^^^^^^^^^^^^^^^^^^^^^
+-----------------------
For a ``FindXxx.cmake`` module that takes the approach of setting
variables (either instead of or in addition to creating imported
@@ -754,54 +193,81 @@ Make sure you comment them as deprecated, so that no-one starts using
them.
-
A Sample Find Module
-^^^^^^^^^^^^^^^^^^^^
+--------------------
-We will describe how to create a simple find module for a library
-``Foo``.
+We will describe how to create a simple find module for a library ``Foo``.
-The first thing that is needed is a license notice.
+The top of the module should begin with a license notice, followed by
+a blank line, and then followed by a :ref:`Bracket Comment`. The comment
+should begin with ``.rst:`` to indicate that the rest of its content is
+reStructuredText-format documentation. For example:
-.. code-block:: cmake
+::
- # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
- # file Copyright.txt or https://cmake.org/licensing for details.
+ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ # file Copyright.txt or https://cmake.org/licensing for details.
-Next we need module documentation. CMake's documentation system requires you
-to follow the license notice with a blank line and then with a documentation
-marker and the name of the module. You should follow this with a simple
-statement of what the module does.
+ #[=======================================================================[.rst:
+ FindFoo
+ -------
-.. code-block:: cmake
+ Finds the Foo library.
- #.rst:
- # FindFoo
- # -------
- #
- # Finds the Foo library
- #
+ Imported Targets
+ ^^^^^^^^^^^^^^^^
-More description may be required for some packages. If there are
-caveats or other details users of the module should be aware of, you can
-add further paragraphs below this. Then you need to document what
-variables and imported targets are set by the module, such as
+ This module provides the following imported targets, if found:
-.. code-block:: cmake
+ ``Foo::Foo``
+ The Foo library
+
+ Result Variables
+ ^^^^^^^^^^^^^^^^
+
+ This will define the following variables:
+
+ ``Foo_FOUND``
+ True if the system has the Foo library.
+ ``Foo_VERSION``
+ The version of the Foo library which was found.
+ ``Foo_INCLUDE_DIRS``
+ Include directories needed to use Foo.
+ ``Foo_LIBRARIES``
+ Libraries needed to link to Foo.
+
+ Cache Variables
+ ^^^^^^^^^^^^^^^
+
+ The following cache variables may also be set:
+
+ ``Foo_INCLUDE_DIR``
+ The directory containing ``foo.h``.
+ ``Foo_LIBRARY``
+ The path to the Foo library.
+
+ #]=======================================================================]
+
+The module documentation consists of:
+
+* An underlined heading specifying the module name.
+
+* A simple description of what the module finds.
+ More description may be required for some packages. If there are
+ caveats or other details users of the module should be aware of,
+ specify them here.
+
+* A section listing imported targets provided by the module, if any.
+
+* A section listing result variables provided by the module.
- # This will define the following variables::
- #
- # Foo_FOUND - True if the system has the Foo library
- # Foo_VERSION - The version of the Foo library which was found
- #
- # and the following imported targets::
- #
- # Foo::Foo - The Foo library
+* Optionally a section listing cache variables used by the module, if any.
-If the package provides any macros, they should be listed here, but can
-be documented where they are defined. See the `Module
-Documentation`_ section above for more details.
+If the package provides any macros or functions, they should be listed in
+an additional section, but can be documented by additional ``.rst:``
+comment blocks immediately above where those macros or functions are defined.
+The find module implementation may begin below the documentation block.
Now the actual libraries and so on have to be found. The code here will
obviously vary from module to module (dealing with that, after all, is the
point of find modules), but there tends to be a common pattern for libraries.
diff --git a/Help/manual/cmake-env-variables.7.rst b/Help/manual/cmake-env-variables.7.rst
index 31aa723fe..c43341276 100644
--- a/Help/manual/cmake-env-variables.7.rst
+++ b/Help/manual/cmake-env-variables.7.rst
@@ -7,6 +7,14 @@ cmake-env-variables(7)
.. contents::
+This page lists environment variables that have special
+meaning to CMake.
+
+For general information on environment variables, see the
+:ref:`Environment Variables <CMake Language Environment Variables>`
+section in the cmake-language manual.
+
+
Environment Variables that Control the Build
============================================
@@ -16,11 +24,13 @@ Environment Variables that Control the Build
/envvar/CMAKE_BUILD_PARALLEL_LEVEL
/envvar/CMAKE_CONFIG_TYPE
/envvar/CMAKE_MSVCIDE_RUN_PATH
+ /envvar/CMAKE_NO_VERBOSE
/envvar/CMAKE_OSX_ARCHITECTURES
/envvar/DESTDIR
/envvar/LDFLAGS
/envvar/MACOSX_DEPLOYMENT_TARGET
/envvar/PackageName_ROOT
+ /envvar/VERBOSE
Environment Variables for Languages
===================================
diff --git a/Help/manual/cmake-file-api.7.rst b/Help/manual/cmake-file-api.7.rst
new file mode 100644
index 000000000..f3e02088a
--- /dev/null
+++ b/Help/manual/cmake-file-api.7.rst
@@ -0,0 +1,1111 @@
+.. cmake-manual-description: CMake File-Based API
+
+cmake-file-api(7)
+*****************
+
+.. only:: html
+
+ .. contents::
+
+Introduction
+============
+
+CMake provides a file-based API that clients may use to get semantic
+information about the buildsystems CMake generates. Clients may use
+the API by writing query files to a specific location in a build tree
+to request zero or more `Object Kinds`_. When CMake generates the
+buildsystem in that build tree it will read the query files and write
+reply files for the client to read.
+
+The file-based API uses a ``<build>/.cmake/api/`` directory at the top
+of a build tree. The API is versioned to support changes to the layout
+of files within the API directory. API file layout versioning is
+orthogonal to the versioning of `Object Kinds`_ used in replies.
+This version of CMake supports only one API version, `API v1`_.
+
+API v1
+======
+
+API v1 is housed in the ``<build>/.cmake/api/v1/`` directory.
+It has the following subdirectories:
+
+``query/``
+ Holds query files written by clients.
+ These may be `v1 Shared Stateless Query Files`_,
+ `v1 Client Stateless Query Files`_, or `v1 Client Stateful Query Files`_.
+
+``reply/``
+ Holds reply files written by CMake whenever it runs to generate a build
+ system. These are indexed by a `v1 Reply Index File`_ file that may
+ reference additional `v1 Reply Files`_. CMake owns all reply files.
+ Clients must never remove them.
+
+ Clients may look for and read a reply index file at any time.
+ Clients may optionally create the ``reply/`` directory at any time
+ and monitor it for the appearance of a new reply index file.
+
+v1 Shared Stateless Query Files
+-------------------------------
+
+Shared stateless query files allow clients to share requests for
+major versions of the `Object Kinds`_ and get all requested versions
+recognized by the CMake that runs.
+
+Clients may create shared requests by creating empty files in the
+``v1/query/`` directory. The form is::
+
+ <build>/.cmake/api/v1/query/<kind>-v<major>
+
+where ``<kind>`` is one of the `Object Kinds`_, ``-v`` is literal,
+and ``<major>`` is the major version number.
+
+Files of this form are stateless shared queries not owned by any specific
+client. Once created they should not be removed without external client
+coordination or human intervention.
+
+v1 Client Stateless Query Files
+-------------------------------
+
+Client stateless query files allow clients to create owned requests for
+major versions of the `Object Kinds`_ and get all requested versions
+recognized by the CMake that runs.
+
+Clients may create owned requests by creating empty files in
+client-specific query subdirectories. The form is::
+
+ <build>/.cmake/api/v1/query/client-<client>/<kind>-v<major>
+
+where ``client-`` is literal, ``<client>`` is a string uniquely
+identifying the client, ``<kind>`` is one of the `Object Kinds`_,
+``-v`` is literal, and ``<major>`` is the major version number.
+Each client must choose a unique ``<client>`` identifier via its
+own means.
+
+Files of this form are stateless queries owned by the client ``<client>``.
+The owning client may remove them at any time.
+
+v1 Client Stateful Query Files
+------------------------------
+
+Stateful query files allow clients to request a list of versions of
+each of the `Object Kinds`_ and get only the most recent version
+recognized by the CMake that runs.
+
+Clients may create owned stateful queries by creating ``query.json``
+files in client-specific query subdirectories. The form is::
+
+ <build>/.cmake/api/v1/query/client-<client>/query.json
+
+where ``client-`` is literal, ``<client>`` is a string uniquely
+identifying the client, and ``query.json`` is literal. Each client
+must choose a unique ``<client>`` identifier via its own means.
+
+``query.json`` files are stateful queries owned by the client ``<client>``.
+The owning client may update or remove them at any time. When a
+given client installation is updated it may then update the stateful
+query it writes to build trees to request newer object versions.
+This can be used to avoid asking CMake to generate multiple object
+versions unnecessarily.
+
+A ``query.json`` file must contain a JSON object:
+
+.. code-block:: json
+
+ {
+ "requests": [
+ { "kind": "<kind>" , "version": 1 },
+ { "kind": "<kind>" , "version": { "major": 1, "minor": 2 } },
+ { "kind": "<kind>" , "version": [2, 1] },
+ { "kind": "<kind>" , "version": [2, { "major": 1, "minor": 2 }] },
+ { "kind": "<kind>" , "version": 1, "client": {} },
+ { "kind": "..." }
+ ],
+ "client": {}
+ }
+
+The members are:
+
+``requests``
+ A JSON array containing zero or more requests. Each request is
+ a JSON object with members:
+
+ ``kind``
+ Specifies one of the `Object Kinds`_ to be included in the reply.
+
+ ``version``
+ Indicates the version(s) of the object kind that the client
+ understands. Versions have major and minor components following
+ semantic version conventions. The value must be
+
+ * a JSON integer specifying a (non-negative) major version number, or
+ * a JSON object containing ``major`` and (optionally) ``minor``
+ members specifying non-negative integer version components, or
+ * a JSON array whose elements are each one of the above.
+
+ ``client``
+ Optional member reserved for use by the client. This value is
+ preserved in the reply written for the client in the
+ `v1 Reply Index File`_ but is otherwise ignored. Clients may use
+ this to pass custom information with a request through to its reply.
+
+ For each requested object kind CMake will choose the *first* version
+ that it recognizes for that kind among those listed in the request.
+ The response will use the selected *major* version with the highest
+ *minor* version known to the running CMake for that major version.
+ Therefore clients should list all supported major versions in
+ preferred order along with the minimal minor version required
+ for each major version.
+
+``client``
+ Optional member reserved for use by the client. This value is
+ preserved in the reply written for the client in the
+ `v1 Reply Index File`_ but is otherwise ignored. Clients may use
+ this to pass custom information with a query through to its reply.
+
+Other ``query.json`` top-level members are reserved for future use.
+If present they are ignored for forward compatibility.
+
+v1 Reply Index File
+-------------------
+
+CMake writes an ``index-*.json`` file to the ``v1/reply/`` directory
+whenever it runs to generate a build system. Clients must read the
+reply index file first and may read other `v1 Reply Files`_ only by
+following references. The form of the reply index file name is::
+
+ <build>/.cmake/api/v1/reply/index-<unspecified>.json
+
+where ``index-`` is literal and ``<unspecified>`` is an unspecified
+name selected by CMake. Whenever a new index file is generated it
+is given a new name and any old one is deleted. During the short
+time between these steps there may be multiple index files present;
+the one with the largest name in lexicographic order is the current
+index file.
+
+The reply index file contains a JSON object:
+
+.. code-block:: json
+
+ {
+ "cmake": {
+ "version": {
+ "major": 3, "minor": 14, "patch": 0, "suffix": "",
+ "string": "3.14.0", "isDirty": false
+ },
+ "paths": {
+ "cmake": "/prefix/bin/cmake",
+ "ctest": "/prefix/bin/ctest",
+ "cpack": "/prefix/bin/cpack",
+ "root": "/prefix/share/cmake-3.14"
+ },
+ "generator": {
+ "name": "Unix Makefiles"
+ }
+ },
+ "objects": [
+ { "kind": "<kind>",
+ "version": { "major": 1, "minor": 0 },
+ "jsonFile": "<file>" },
+ { "...": "..." }
+ ],
+ "reply": {
+ "<kind>-v<major>": { "kind": "<kind>",
+ "version": { "major": 1, "minor": 0 },
+ "jsonFile": "<file>" },
+ "<unknown>": { "error": "unknown query file" },
+ "...": {},
+ "client-<client>": {
+ "<kind>-v<major>": { "kind": "<kind>",
+ "version": { "major": 1, "minor": 0 },
+ "jsonFile": "<file>" },
+ "<unknown>": { "error": "unknown query file" },
+ "...": {},
+ "query.json": {
+ "requests": [ {}, {}, {} ],
+ "responses": [
+ { "kind": "<kind>",
+ "version": { "major": 1, "minor": 0 },
+ "jsonFile": "<file>" },
+ { "error": "unknown query file" },
+ { "...": {} }
+ ],
+ "client": {}
+ }
+ }
+ }
+ }
+
+The members are:
+
+``cmake``
+ A JSON object containing information about the instance of CMake that
+ generated the reply. It contains members:
+
+ ``version``
+ A JSON object specifying the version of CMake with members:
+
+ ``major``, ``minor``, ``patch``
+ Integer values specifying the major, minor, and patch version components.
+ ``suffix``
+ A string specifying the version suffix, if any, e.g. ``g0abc3``.
+ ``string``
+ A string specifying the full version in the format
+ ``<major>.<minor>.<patch>[-<suffix>]``.
+ ``isDirty``
+ A boolean indicating whether the version was built from a version
+ controlled source tree with local modifications.
+
+ ``paths``
+ A JSON object specifying paths to things that come with CMake.
+ It has members for ``cmake``, ``ctest``, and ``cpack`` whose values
+ are JSON strings specifying the absolute path to each tool,
+ represented with forward slashes. It also has a ``root`` member for
+ the absolute path to the directory containing CMake resources like the
+ ``Modules/`` directory (see :variable:`CMAKE_ROOT`).
+
+ ``generator``
+ A JSON object describing the CMake generator used for the build.
+ It has members:
+
+ ``name``
+ A string specifying the name of the generator.
+ ``platform``
+ If the generator supports :variable:`CMAKE_GENERATOR_PLATFORM`,
+ this is a string specifying the generator platform name.
+
+``objects``
+ A JSON array listing all versions of all `Object Kinds`_ generated
+ as part of the reply. Each array entry is a
+ `v1 Reply File Reference`_.
+
+``reply``
+ A JSON object mirroring the content of the ``query/`` directory
+ that CMake loaded to produce the reply. The members are of the form
+
+ ``<kind>-v<major>``
+ A member of this form appears for each of the
+ `v1 Shared Stateless Query Files`_ that CMake recognized as a
+ request for object kind ``<kind>`` with major version ``<major>``.
+ The value is a `v1 Reply File Reference`_ to the corresponding
+ reply file for that object kind and version.
+
+ ``<unknown>``
+ A member of this form appears for each of the
+ `v1 Shared Stateless Query Files`_ that CMake did not recognize.
+ The value is a JSON object with a single ``error`` member
+ containing a string with an error message indicating that the
+ query file is unknown.
+
+ ``client-<client>``
+ A member of this form appears for each client-owned directory
+ holding `v1 Client Stateless Query Files`_.
+ The value is a JSON object mirroring the content of the
+ ``query/client-<client>/`` directory. The members are of the form:
+
+ ``<kind>-v<major>``
+ A member of this form appears for each of the
+ `v1 Client Stateless Query Files`_ that CMake recognized as a
+ request for object kind ``<kind>`` with major version ``<major>``.
+ The value is a `v1 Reply File Reference`_ to the corresponding
+ reply file for that object kind and version.
+
+ ``<unknown>``
+ A member of this form appears for each of the
+ `v1 Client Stateless Query Files`_ that CMake did not recognize.
+ The value is a JSON object with a single ``error`` member
+ containing a string with an error message indicating that the
+ query file is unknown.
+
+ ``query.json``
+ This member appears for clients using
+ `v1 Client Stateful Query Files`_.
+ If the ``query.json`` file failed to read or parse as a JSON object,
+ this member is a JSON object with a single ``error`` member
+ containing a string with an error message. Otherwise, this member
+ is a JSON object mirroring the content of the ``query.json`` file.
+ The members are:
+
+ ``client``
+ A copy of the ``query.json`` file ``client`` member, if it exists.
+
+ ``requests``
+ A copy of the ``query.json`` file ``requests`` member, if it exists.
+
+ ``responses``
+ If the ``query.json`` file ``requests`` member is missing or invalid,
+ this member is a JSON object with a single ``error`` member
+ containing a string with an error message. Otherwise, this member
+ contains a JSON array with a response for each entry of the
+ ``requests`` array, in the same order. Each response is
+
+ * a JSON object with a single ``error`` member containing a string
+ with an error message, or
+ * a `v1 Reply File Reference`_ to the corresponding reply file for
+ the requested object kind and selected version.
+
+After reading the reply index file, clients may read the other
+`v1 Reply Files`_ it references.
+
+v1 Reply File Reference
+^^^^^^^^^^^^^^^^^^^^^^^
+
+The reply index file represents each reference to another reply file
+using a JSON object with members:
+
+``kind``
+ A string specifying one of the `Object Kinds`_.
+``version``
+ A JSON object with members ``major`` and ``minor`` specifying
+ integer version components of the object kind.
+``jsonFile``
+ A JSON string specifying a path relative to the reply index file
+ to another JSON file containing the object.
+
+v1 Reply Files
+--------------
+
+Reply files containing specific `Object Kinds`_ are written by CMake.
+The names of these files are unspecified and must not be interpreted
+by clients. Clients must first read the `v1 Reply Index File`_ and
+and follow references to the names of the desired response objects.
+
+Reply files (including the index file) will never be replaced by
+files of the same name but different content. This allows a client
+to read the files concurrently with a running CMake that may generate
+a new reply. However, after generating a new reply CMake will attempt
+to remove reply files from previous runs that it did not just write.
+If a client attempts to read a reply file referenced by the index but
+finds the file missing, that means a concurrent CMake has generated
+a new reply. The client may simply start again by reading the new
+reply index file.
+
+Object Kinds
+============
+
+The CMake file-based API reports semantic information about the build
+system using the following kinds of JSON objects. Each kind of object
+is versioned independently using semantic versioning with major and
+minor components. Every kind of object has the form:
+
+.. code-block:: json
+
+ {
+ "kind": "<kind>",
+ "version": { "major": 1, "minor": 0 },
+ "...": {}
+ }
+
+The ``kind`` member is a string specifying the object kind name.
+The ``version`` member is a JSON object with ``major`` and ``minor``
+members specifying integer components of the object kind's version.
+Additional top-level members are specific to each object kind.
+
+Object Kind "codemodel"
+-----------------------
+
+The ``codemodel`` object kind describes the build system structure as
+modeled by CMake.
+
+There is only one ``codemodel`` object major version, version 2.
+Version 1 does not exist to avoid confusion with that from
+:manual:`cmake-server(7)` mode.
+
+"codemodel" version 2
+^^^^^^^^^^^^^^^^^^^^^
+
+``codemodel`` object version 2 is a JSON object:
+
+.. code-block:: json
+
+ {
+ "kind": "codemodel",
+ "version": { "major": 2, "minor": 0 },
+ "paths": {
+ "source": "/path/to/top-level-source-dir",
+ "build": "/path/to/top-level-build-dir"
+ },
+ "configurations": [
+ {
+ "name": "Debug",
+ "directories": [
+ {
+ "source": ".",
+ "build": ".",
+ "childIndexes": [ 1 ],
+ "projectIndex": 0,
+ "targetIndexes": [ 0 ],
+ "hasInstallRule": true,
+ "minimumCMakeVersion": {
+ "string": "3.14"
+ }
+ },
+ {
+ "source": "sub",
+ "build": "sub",
+ "parentIndex": 0,
+ "projectIndex": 0,
+ "targetIndexes": [ 1 ],
+ "minimumCMakeVersion": {
+ "string": "3.14"
+ }
+ }
+ ],
+ "projects": [
+ {
+ "name": "MyProject",
+ "directoryIndexes": [ 0, 1 ],
+ "targetIndexes": [ 0, 1 ]
+ }
+ ],
+ "targets": [
+ {
+ "name": "MyExecutable",
+ "directoryIndex": 0,
+ "projectIndex": 0,
+ "jsonFile": "<file>"
+ },
+ {
+ "name": "MyLibrary",
+ "directoryIndex": 1,
+ "projectIndex": 0,
+ "jsonFile": "<file>"
+ }
+ ]
+ }
+ ]
+ }
+
+The members specific to ``codemodel`` objects are:
+
+``paths``
+ A JSON object containing members:
+
+ ``source``
+ A string specifying the absolute path to the top-level source directory,
+ represented with forward slashes.
+
+ ``build``
+ A string specifying the absolute path to the top-level build directory,
+ represented with forward slashes.
+
+``configurations``
+ A JSON array of entries corresponding to available build configurations.
+ On single-configuration generators there is one entry for the value
+ of the :variable:`CMAKE_BUILD_TYPE` variable. For multi-configuration
+ generators there is an entry for each configuration listed in the
+ :variable:`CMAKE_CONFIGURATION_TYPES` variable.
+ Each entry is a JSON object containing members:
+
+ ``name``
+ A string specifying the name of the configuration, e.g. ``Debug``.
+
+ ``directories``
+ A JSON array of entries each corresponding to a build system directory
+ whose source directory contains a ``CMakeLists.txt`` file. The first
+ entry corresponds to the top-level directory. Each entry is a
+ JSON object containing members:
+
+ ``source``
+ A string specifying the path to the source directory, represented
+ with forward slashes. If the directory is inside the top-level
+ source directory then the path is specified relative to that
+ directory (with ``.`` for the top-level source directory itself).
+ Otherwise the path is absolute.
+
+ ``build``
+ A string specifying the path to the build directory, represented
+ with forward slashes. If the directory is inside the top-level
+ build directory then the path is specified relative to that
+ directory (with ``.`` for the top-level build directory itself).
+ Otherwise the path is absolute.
+
+ ``parentIndex``
+ Optional member that is present when the directory is not top-level.
+ The value is an unsigned integer 0-based index of another entry in
+ the main ``directories`` array that corresponds to the parent
+ directory that added this directory as a subdirectory.
+
+ ``childIndexes``
+ Optional member that is present when the directory has subdirectories.
+ The value is a JSON array of entries corresponding to child directories
+ created by the :command:`add_subdirectory` or :command:`subdirs`
+ command. Each entry is an unsigned integer 0-based index of another
+ entry in the main ``directories`` array.
+
+ ``projectIndex``
+ An unsigned integer 0-based index into the main ``projects`` array
+ indicating the build system project to which the this directory belongs.
+
+ ``targetIndexes``
+ Optional member that is present when the directory itself has targets,
+ excluding those belonging to subdirectories. The value is a JSON
+ array of entries corresponding to the targets. Each entry is an
+ unsigned integer 0-based index into the main ``targets`` array.
+
+ ``minimumCMakeVersion``
+ Optional member present when a minimum required version of CMake is
+ known for the directory. This is the ``<min>`` version given to the
+ most local call to the :command:`cmake_minimum_required(VERSION)`
+ command in the directory itself or one of its ancestors.
+ The value is a JSON object with one member:
+
+ ``string``
+ A string specifying the minimum required version in the format::
+
+ <major>.<minor>[.<patch>[.<tweak>]][<suffix>]
+
+ Each component is an unsigned integer and the suffix may be an
+ arbitrary string.
+
+ ``hasInstallRule``
+ Optional member that is present with boolean value ``true`` when
+ the directory or one of its subdirectories contains any
+ :command:`install` rules, i.e. whether a ``make install``
+ or equivalent rule is available.
+
+ ``projects``
+ A JSON array of entries corresponding to the top-level project
+ and sub-projects defined in the build system. Each (sub-)project
+ corresponds to a source directory whose ``CMakeLists.txt`` file
+ calls the :command:`project` command with a project name different
+ from its parent directory. The first entry corresponds to the
+ top-level project.
+
+ Each entry is a JSON object containing members:
+
+ ``name``
+ A string specifying the name given to the :command:`project` command.
+
+ ``parentIndex``
+ Optional member that is present when the project is not top-level.
+ The value is an unsigned integer 0-based index of another entry in
+ the main ``projects`` array that corresponds to the parent project
+ that added this project as a sub-project.
+
+ ``childIndexes``
+ Optional member that is present when the project has sub-projects.
+ The value is a JSON array of entries corresponding to the sub-projects.
+ Each entry is an unsigned integer 0-based index of another
+ entry in the main ``projects`` array.
+
+ ``directoryIndexes``
+ A JSON array of entries corresponding to build system directories
+ that are part of the project. The first entry corresponds to the
+ top-level directory of the project. Each entry is an unsigned
+ integer 0-based index into the main ``directories`` array.
+
+ ``targetIndexes``
+ Optional member that is present when the project itself has targets,
+ excluding those belonging to sub-projects. The value is a JSON
+ array of entries corresponding to the targets. Each entry is an
+ unsigned integer 0-based index into the main ``targets`` array.
+
+ ``targets``
+ A JSON array of entries corresponding to the build system targets.
+ Such targets are created by calls to :command:`add_executable`,
+ :command:`add_library`, and :command:`add_custom_target`, excluding
+ imported targets and interface libraries (which do not generate any
+ build rules). Each entry is a JSON object containing members:
+
+ ``name``
+ A string specifying the target name.
+
+ ``id``
+ A string uniquely identifying the target. This matches the ``id``
+ field in the file referenced by ``jsonFile``.
+
+ ``directoryIndex``
+ An unsigned integer 0-based index into the main ``directories`` array
+ indicating the build system directory in which the target is defined.
+
+ ``projectIndex``
+ An unsigned integer 0-based index into the main ``projects`` array
+ indicating the build system project in which the target is defined.
+
+ ``jsonFile``
+ A JSON string specifying a path relative to the codemodel file
+ to another JSON file containing a
+ `"codemodel" version 2 "target" object`_.
+
+"codemodel" version 2 "target" object
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+A codemodel "target" object is referenced by a `"codemodel" version 2`_
+object's ``targets`` array. Each "target" object is a JSON object
+with members:
+
+``name``
+ A string specifying the logical name of the target.
+
+``id``
+ A string uniquely identifying the target. The format is unspecified
+ and should not be interpreted by clients.
+
+``type``
+ A string specifying the type of the target. The value is one of
+ ``EXECUTABLE``, ``STATIC_LIBRARY``, ``SHARED_LIBRARY``,
+ ``MODULE_LIBRARY``, ``OBJECT_LIBRARY``, or ``UTILITY``.
+
+``backtrace``
+ Optional member that is present when a CMake language backtrace to
+ the command in the source code that created the target is available.
+ The value is an unsigned integer 0-based index into the
+ ``backtraceGraph`` member's ``nodes`` array.
+
+``folder``
+ Optional member that is present when the :prop_tgt:`FOLDER` target
+ property is set. The value is a JSON object with one member:
+
+ ``name``
+ A string specifying the name of the target folder.
+
+``paths``
+ A JSON object containing members:
+
+ ``source``
+ A string specifying the path to the target's source directory,
+ represented with forward slashes. If the directory is inside the
+ top-level source directory then the path is specified relative to
+ that directory (with ``.`` for the top-level source directory itself).
+ Otherwise the path is absolute.
+
+ ``build``
+ A string specifying the path to the target's build directory,
+ represented with forward slashes. If the directory is inside the
+ top-level build directory then the path is specified relative to
+ that directory (with ``.`` for the top-level build directory itself).
+ Otherwise the path is absolute.
+
+``nameOnDisk``
+ Optional member that is present for executable and library targets
+ that are linked or archived into a single primary artifact.
+ The value is a string specifying the file name of that artifact on disk.
+
+``artifacts``
+ Optional member that is present for executable and library targets
+ that produce artifacts on disk meant for consumption by dependents.
+ The value is a JSON array of entries corresponding to the artifacts.
+ Each entry is a JSON object containing one member:
+
+ ``path``
+ A string specifying the path to the file on disk, represented with
+ forward slashes. If the file is inside the top-level build directory
+ then the path is specified relative to that directory.
+ Otherwise the path is absolute.
+
+``isGeneratorProvided``
+ Optional member that is present with boolean value ``true`` if the
+ target is provided by CMake's build system generator rather than by
+ a command in the source code.
+
+``install``
+ Optional member that is present when the target has an :command:`install`
+ rule. The value is a JSON object with members:
+
+ ``prefix``
+ A JSON object specifying the installation prefix. It has one member:
+
+ ``path``
+ A string specifying the value of :variable:`CMAKE_INSTALL_PREFIX`.
+
+ ``destinations``
+ A JSON array of entries specifying an install destination path.
+ Each entry is a JSON object with members:
+
+ ``path``
+ A string specifying the install destination path. The path may
+ be absolute or relative to the install prefix.
+
+ ``backtrace``
+ Optional member that is present when a CMake language backtrace to
+ the :command:`install` command invocation that specified this
+ destination is available. The value is an unsigned integer 0-based
+ index into the ``backtraceGraph`` member's ``nodes`` array.
+
+``link``
+ Optional member that is present for executables and shared library
+ targets that link into a runtime binary. The value is a JSON object
+ with members describing the link step:
+
+ ``language``
+ A string specifying the language (e.g. ``C``, ``CXX``, ``Fortran``)
+ of the toolchain is used to invoke the linker.
+
+ ``commandFragments``
+ Optional member that is present when fragments of the link command
+ line invocation are available. The value is a JSON array of entries
+ specifying ordered fragments. Each entry is a JSON object with members:
+
+ ``fragment``
+ A string specifying a fragment of the link command line invocation.
+ The value is encoded in the build system's native shell format.
+
+ ``role``
+ A string specifying the role of the fragment's content:
+
+ * ``flags``: link flags.
+ * ``libraries``: link library file paths or flags.
+ * ``libraryPath``: library search path flags.
+ * ``frameworkPath``: macOS framework search path flags.
+
+ ``lto``
+ Optional member that is present with boolean value ``true``
+ when link-time optimization (a.k.a. interprocedural optimization
+ or link-time code generation) is enabled.
+
+ ``sysroot``
+ Optional member that is present when the :variable:`CMAKE_SYSROOT_LINK`
+ or :variable:`CMAKE_SYSROOT` variable is defined. The value is a
+ JSON object with one member:
+
+ ``path``
+ A string specifying the absolute path to the sysroot, represented
+ with forward slashes.
+
+``archive``
+ Optional member that is present for static library targets. The value
+ is a JSON object with members describing the archive step:
+
+ ``commandFragments``
+ Optional member that is present when fragments of the archiver command
+ line invocation are available. The value is a JSON array of entries
+ specifying the fragments. Each entry is a JSON object with members:
+
+ ``fragment``
+ A string specifying a fragment of the archiver command line invocation.
+ The value is encoded in the build system's native shell format.
+
+ ``role``
+ A string specifying the role of the fragment's content:
+
+ * ``flags``: archiver flags.
+
+ ``lto``
+ Optional member that is present with boolean value ``true``
+ when link-time optimization (a.k.a. interprocedural optimization
+ or link-time code generation) is enabled.
+
+``dependencies``
+ Optional member that is present when the target depends on other targets.
+ The value is a JSON array of entries corresponding to the dependencies.
+ Each entry is a JSON object with members:
+
+ ``id``
+ A string uniquely identifying the target on which this target depends.
+ This matches the main ``id`` member of the other target.
+
+ ``backtrace``
+ Optional member that is present when a CMake language backtrace to
+ the :command:`add_dependencies`, :command:`target_link_libraries`,
+ or other command invocation that created this dependency is
+ available. The value is an unsigned integer 0-based index into
+ the ``backtraceGraph`` member's ``nodes`` array.
+
+``sources``
+ A JSON array of entries corresponding to the target's source files.
+ Each entry is a JSON object with members:
+
+ ``path``
+ A string specifying the path to the source file on disk, represented
+ with forward slashes. If the file is inside the top-level source
+ directory then the path is specified relative to that directory.
+ Otherwise the path is absolute.
+
+ ``compileGroupIndex``
+ Optional member that is present when the source is compiled.
+ The value is an unsigned integer 0-based index into the
+ ``compileGroups`` array.
+
+ ``sourceGroupIndex``
+ Optional member that is present when the source is part of a source
+ group either via the :command:`source_group` command or by default.
+ The value is an unsigned integer 0-based index into the
+ ``sourceGroups`` array.
+
+ ``isGenerated``
+ Optional member that is present with boolean value ``true`` if
+ the source is :prop_sf:`GENERATED`.
+
+ ``backtrace``
+ Optional member that is present when a CMake language backtrace to
+ the :command:`target_sources`, :command:`add_executable`,
+ :command:`add_library`, :command:`add_custom_target`, or other
+ command invocation that added this source to the target is
+ available. The value is an unsigned integer 0-based index into
+ the ``backtraceGraph`` member's ``nodes`` array.
+
+``sourceGroups``
+ Optional member that is present when sources are grouped together by
+ the :command:`source_group` command or by default. The value is a
+ JSON array of entries corresponding to the groups. Each entry is
+ a JSON object with members:
+
+ ``name``
+ A string specifying the name of the source group.
+
+ ``sourceIndexes``
+ A JSON array listing the sources belonging to the group.
+ Each entry is an unsigned integer 0-based index into the
+ main ``sources`` array for the target.
+
+``compileGroups``
+ Optional member that is present when the target has sources that compile.
+ The value is a JSON array of entries corresponding to groups of sources
+ that all compile with the same settings. Each entry is a JSON object
+ with members:
+
+ ``sourceIndexes``
+ A JSON array listing the sources belonging to the group.
+ Each entry is an unsigned integer 0-based index into the
+ main ``sources`` array for the target.
+
+ ``language``
+ A string specifying the language (e.g. ``C``, ``CXX``, ``Fortran``)
+ of the toolchain is used to compile the source file.
+
+ ``compileCommandFragments``
+ Optional member that is present when fragments of the compiler command
+ line invocation are available. The value is a JSON array of entries
+ specifying ordered fragments. Each entry is a JSON object with
+ one member:
+
+ ``fragment``
+ A string specifying a fragment of the compile command line invocation.
+ The value is encoded in the build system's native shell format.
+
+ ``includes``
+ Optional member that is present when there are include directories.
+ The value is a JSON array with an entry for each directory. Each
+ entry is a JSON object with members:
+
+ ``path``
+ A string specifying the path to the include directory,
+ represented with forward slashes.
+
+ ``isSystem``
+ Optional member that is present with boolean value ``true`` if
+ the include directory is marked as a system include directory.
+
+ ``backtrace``
+ Optional member that is present when a CMake language backtrace to
+ the :command:`target_include_directories` or other command invocation
+ that added this include directory is available. The value is
+ an unsigned integer 0-based index into the ``backtraceGraph``
+ member's ``nodes`` array.
+
+ ``defines``
+ Optional member that is present when there are preprocessor definitions.
+ The value is a JSON array with an entry for each definition. Each
+ entry is a JSON object with members:
+
+ ``define``
+ A string specifying the preprocessor definition in the format
+ ``<name>[=<value>]``, e.g. ``DEF`` or ``DEF=1``.
+
+ ``backtrace``
+ Optional member that is present when a CMake language backtrace to
+ the :command:`target_compile_definitions` or other command invocation
+ that added this preprocessor definition is available. The value is
+ an unsigned integer 0-based index into the ``backtraceGraph``
+ member's ``nodes`` array.
+
+ ``sysroot``
+ Optional member that is present when the
+ :variable:`CMAKE_SYSROOT_COMPILE` or :variable:`CMAKE_SYSROOT`
+ variable is defined. The value is a JSON object with one member:
+
+ ``path``
+ A string specifying the absolute path to the sysroot, represented
+ with forward slashes.
+
+``backtraceGraph``
+ A JSON object describing the graph of backtraces whose nodes are
+ referenced from ``backtrace`` members elsewhere. The members are:
+
+ ``nodes``
+ A JSON array listing nodes in the backtrace graph. Each entry
+ is a JSON object with members:
+
+ ``file``
+ An unsigned integer 0-based index into the backtrace ``files`` array.
+
+ ``line``
+ An optional member present when the node represents a line within
+ the file. The value is an unsigned integer 1-based line number.
+
+ ``command``
+ An optional member present when the node represents a command
+ invocation within the file. The value is an unsigned integer
+ 0-based index into the backtrace ``commands`` array.
+
+ ``parent``
+ An optional member present when the node is not the bottom of
+ the call stack. The value is an unsigned integer 0-based index
+ of another entry in the backtrace ``nodes`` array.
+
+ ``commands``
+ A JSON array listing command names referenced by backtrace nodes.
+ Each entry is a string specifying a command name.
+
+ ``files``
+ A JSON array listing CMake language files referenced by backtrace nodes.
+ Each entry is a string specifying the path to a file, represented
+ with forward slashes. If the file is inside the top-level source
+ directory then the path is specified relative to that directory.
+ Otherwise the path is absolute.
+
+Object Kind "cache"
+-------------------
+
+The ``cache`` object kind lists cache entries. These are the
+:ref:`CMake Language Variables` stored in the persistent cache
+(``CMakeCache.txt``) for the build tree.
+
+There is only one ``cache`` object major version, version 2.
+Version 1 does not exist to avoid confusion with that from
+:manual:`cmake-server(7)` mode.
+
+"cache" version 2
+^^^^^^^^^^^^^^^^^
+
+``cache`` object version 2 is a JSON object:
+
+.. code-block:: json
+
+ {
+ "kind": "cache",
+ "version": { "major": 2, "minor": 0 },
+ "entries": [
+ {
+ "name": "BUILD_SHARED_LIBS",
+ "value": "ON",
+ "type": "BOOL",
+ "properties": [
+ {
+ "name": "HELPSTRING",
+ "value": "Build shared libraries"
+ }
+ ]
+ },
+ {
+ "name": "CMAKE_GENERATOR",
+ "value": "Unix Makefiles",
+ "type": "INTERNAL",
+ "properties": [
+ {
+ "name": "HELPSTRING",
+ "value": "Name of generator."
+ }
+ ]
+ }
+ ]
+ }
+
+The members specific to ``cache`` objects are:
+
+``entries``
+ A JSON array whose entries are each a JSON object specifying a
+ cache entry. The members of each entry are:
+
+ ``name``
+ A string specifying the name of the entry.
+
+ ``value``
+ A string specifying the value of the entry.
+
+ ``type``
+ A string specifying the type of the entry used by
+ :manual:`cmake-gui(1)` to choose a widget for editing.
+
+ ``properties``
+ A JSON array of entries specifying associated
+ :ref:`cache entry properties <Cache Entry Properties>`.
+ Each entry is a JSON object containing members:
+
+ ``name``
+ A string specifying the name of the cache entry property.
+
+ ``value``
+ A string specifying the value of the cache entry property.
+
+Object Kind "cmakeFiles"
+------------------------
+
+The ``cmakeFiles`` object kind lists files used by CMake while
+configuring and generating the build system. These include the
+``CMakeLists.txt`` files as well as included ``.cmake`` files.
+
+There is only one ``cmakeFiles`` object major version, version 1.
+
+"cmakeFiles" version 1
+^^^^^^^^^^^^^^^^^^^^^^
+
+``cmakeFiles`` object version 1 is a JSON object:
+
+.. code-block:: json
+
+ {
+ "kind": "cmakeFiles",
+ "version": { "major": 1, "minor": 0 },
+ "paths": {
+ "build": "/path/to/top-level-build-dir",
+ "source": "/path/to/top-level-source-dir"
+ },
+ "inputs": [
+ {
+ "path": "CMakeLists.txt"
+ },
+ {
+ "isGenerated": true,
+ "path": "/path/to/top-level-build-dir/.../CMakeSystem.cmake"
+ },
+ {
+ "isExternal": true,
+ "path": "/path/to/external/third-party/module.cmake"
+ },
+ {
+ "isCMake": true,
+ "isExternal": true,
+ "path": "/path/to/cmake/Modules/CMakeGenericSystem.cmake"
+ }
+ ]
+ }
+
+The members specific to ``cmakeFiles`` objects are:
+
+``paths``
+ A JSON object containing members:
+
+ ``source``
+ A string specifying the absolute path to the top-level source directory,
+ represented with forward slashes.
+
+ ``build``
+ A string specifying the absolute path to the top-level build directory,
+ represented with forward slashes.
+
+``inputs``
+ A JSON array whose entries are each a JSON object specifying an input
+ file used by CMake when configuring and generating the build system.
+ The members of each entry are:
+
+ ``path``
+ A string specifying the path to an input file to CMake, represented
+ with forward slashes. If the file is inside the top-level source
+ directory then the path is specified relative to that directory.
+ Otherwise the path is absolute.
+
+ ``isGenerated``
+ Optional member that is present with boolean value ``true``
+ if the path specifies a file that is under the top-level
+ build directory and the build is out-of-source.
+ This member is not available on in-source builds.
+
+ ``isExternal``
+ Optional member that is present with boolean value ``true``
+ if the path specifies a file that is not under the top-level
+ source or build directories.
+
+ ``isCMake``
+ Optional member that is present with boolean value ``true``
+ if the path specifies a file in the CMake installation.
diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst
index 76fd3d9ed..7f484a42a 100644
--- a/Help/manual/cmake-generator-expressions.7.rst
+++ b/Help/manual/cmake-generator-expressions.7.rst
@@ -20,61 +20,74 @@ commands to populate those properties, such as :command:`target_link_libraries`,
:command:`target_include_directories`, :command:`target_compile_definitions`
and others.
-This means that they enable conditional linking, conditional
-definitions used when compiling, and conditional include directories and
-more. The conditions may be based on the build configuration, target
-properties, platform information or any other queryable information.
+They enable conditional linking, conditional definitions used when compiling,
+conditional include directories, and more. The conditions may be based on
+the build configuration, target properties, platform information or any other
+queryable information.
-Logical Expressions
-===================
+Generator expressions have the form ``$<...>``. To avoid confusion, this page
+deviates from most of the CMake documentation in that it omits angular brackets
+``<...>`` around placeholders like ``condition``, ``string``, ``target``,
+among others.
-Logical expressions are used to create conditional output. The basic
-expressions are the ``0`` and ``1`` expressions. Because other logical
-expressions evaluate to either ``0`` or ``1``, they can be composed to
-create conditional output::
+Generator expressions can be nested, as shown in most of the examples below.
- $<$<CONFIG:Debug>:DEBUG_MODE>
+.. _`Boolean Generator Expressions`:
-expands to ``DEBUG_MODE`` when the ``Debug`` configuration is used, and
-otherwise expands to nothing.
-
-Available logical expressions are:
-
-``$<BOOL:...>``
- ``1`` if the ``...`` is true, else ``0``
-``$<AND:?[,?]...>``
- ``1`` if all ``?`` are ``1``, else ``0``
-
- The ``?`` must always be either ``0`` or ``1`` in boolean expressions.
-
-``$<OR:?[,?]...>``
- ``0`` if all ``?`` are ``0``, else ``1``
-``$<NOT:?>``
- ``0`` if ``?`` is ``1``, else ``1``
-``$<IF:?,true-value...,false-value...>``
- ``true-value...`` if ``?`` is ``1``, ``false-value...`` if ``?`` is ``0``
-``$<STREQUAL:a,b>``
- ``1`` if ``a`` is STREQUAL ``b``, else ``0``
-``$<EQUAL:a,b>``
- ``1`` if ``a`` is EQUAL ``b`` in a numeric comparison, else ``0``
-``$<IN_LIST:a,b>``
- ``1`` if ``a`` is IN_LIST ``b``, else ``0``
-``$<TARGET_EXISTS:tgt>``
- ``1`` if ``tgt`` is an existed target name, else ``0``.
-``$<CONFIG:cfg>``
- ``1`` if config is ``cfg``, 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:comp>``
- ``1`` if the CMake-id of the platform matches ``comp``, otherwise ``0``.
- See also the :variable:`CMAKE_SYSTEM_NAME` variable.
-``$<C_COMPILER_ID:comp>``
- ``1`` if the CMake-id of the C compiler matches ``comp``, otherwise ``0``.
- See also the :variable:`CMAKE_<LANG>_COMPILER_ID` variable.
-``$<CXX_COMPILER_ID:comp>``
- ``1`` if the CMake-id of the CXX compiler matches ``comp``, otherwise ``0``.
- See also the :variable:`CMAKE_<LANG>_COMPILER_ID` variable.
+Boolean Generator Expressions
+=============================
+
+Boolean expressions evaluate to either ``0`` or ``1``.
+They are typically used to construct the condition in a :ref:`conditional
+generator expression<Conditional Generator Expressions>`.
+
+Available boolean expressions are:
+
+Logical Operators
+-----------------
+
+``$<BOOL:string>``
+ Converts ``string`` to ``0`` or ``1`` according to the rules of the
+ :command:`if()` command. Evaluates to ``0`` if any of the following is true:
+
+ * ``string`` is empty,
+ * ``string`` is a case-insensitive equal of
+ ``0``, ``FALSE``, ``OFF``, ``N``, ``NO``, ``IGNORE``, or ``NOTFOUND``, or
+ * ``string`` ends in the suffix ``-NOTFOUND`` (case-sensitive).
+
+ Otherwise evaluates to ``1``.
+
+``$<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>``
+ 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>``
+ ``0`` if ``condition`` is ``1``, else ``1``.
+
+String Comparisons
+------------------
+
+``$<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
+ <String Transforming Generator Expressions>`,
+
+ .. code-block:: cmake
+
+ $<STREQUAL:$<UPPER_CASE:${foo}>,"BAR"> # "1" if ${foo} is any of "BAR", "Bar", "bar", ...
+
+``$<EQUAL:value1,value2>``
+ ``1`` if ``value1`` and ``value2`` are numerically equal, else ``0``.
+``$<IN_LIST:string,list>``
+ ``1`` if ``string`` is member of the comma-separated ``list``, else ``0``.
+ Uses case-sensitive comparisons.
``$<VERSION_LESS:v1,v2>``
``1`` if ``v1`` is a version less than ``v2``, else ``0``.
``$<VERSION_GREATER:v1,v2>``
@@ -85,27 +98,62 @@ Available logical expressions are:
``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``.
-``$<C_COMPILER_VERSION:ver>``
- ``1`` if the version of the C compiler matches ``ver``, otherwise ``0``.
+
+
+Variable Queries
+----------------
+
+``$<TARGET_EXISTS:target>``
+ ``1`` if ``target`` exists, else ``0``.
+``$<CONFIG:cfg>``
+ ``1`` if config is ``cfg``, 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_id>``
+ ``1`` if the CMake-id of the platform matches ``platform_id``
+ otherwise ``0``.
+ See also the :variable:`CMAKE_SYSTEM_NAME` variable.
+``$<C_COMPILER_ID:compiler_id>``
+ ``1`` if the CMake-id of the C compiler matches ``compiler_id``,
+ otherwise ``0``.
+ See also the :variable:`CMAKE_<LANG>_COMPILER_ID` variable.
+``$<CXX_COMPILER_ID:compiler_id>``
+ ``1`` if the CMake-id of the CXX compiler matches ``compiler_id``,
+ otherwise ``0``.
+ See also the :variable:`CMAKE_<LANG>_COMPILER_ID` variable.
+``$<Fortran_COMPILER_ID:compiler_id>``
+ ``1`` if the CMake-id of the Fortran compiler matches ``compiler_id``,
+ otherwise ``0``.
+ See also the :variable:`CMAKE_<LANG>_COMPILER_ID` variable.
+``$<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>``
+ ``1`` if the version of the CXX compiler matches ``version``, otherwise ``0``.
See also the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable.
-``$<CXX_COMPILER_VERSION:ver>``
- ``1`` if the version of the CXX compiler matches ``ver``, otherwise ``0``.
+``$<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.
-``$<TARGET_POLICY:pol>``
- ``1`` if the policy ``pol`` was NEW when the 'head' target was created,
- else ``0``. If the policy was not set, the warning message for the policy
+``$<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:feature[,feature]...>``
- ``1`` if all of the ``feature`` features are available for the 'head'
+``$<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
the link implementation of a target and if any dependency transitively
increases the required :prop_tgt:`C_STANDARD` or :prop_tgt:`CXX_STANDARD`
for the 'head' target, an error is reported. See the
:manual:`cmake-compile-features(7)` manual for information on
compile features and a list of supported compilers.
-``$<COMPILE_LANGUAGE:lang>``
- ``1`` when the language used for compilation unit matches ``lang``,
+
+.. _`Boolean COMPILE_LANGUAGE Generator Expression`:
+
+``$<COMPILE_LANGUAGE:language>``
+ ``1`` when the language used for compilation unit matches ``language``,
otherwise ``0``. This expression may be used to specify compile options,
compile definitions, and include directories for source files of a
particular language in a target. For example:
@@ -147,18 +195,24 @@ Available logical expressions are:
add_executable(myapp main.cpp)
target_link_libraries(myapp myapp_c myapp_cxx)
-Informational Expressions
-=========================
+String-Valued Generator Expressions
+===================================
+
+These expressions expand to some string.
+For example,
-These expressions expand to some information. The information may be used
-directly, eg::
+.. code-block:: cmake
include_directories(/usr/include/$<CXX_COMPILER_ID>/)
expands to ``/usr/include/GNU/`` or ``/usr/include/Clang/`` etc, depending on
-the Id of the compiler.
+the compiler identifier.
-These expressions may also may be combined with logical expressions::
+String-valued expressions may also be combined with other expressions.
+Here an example for a string-valued expression within a boolean expressions
+within a conditional expression:
+
+.. code-block:: cmake
$<$<VERSION_LESS:$<CXX_COMPILER_VERSION>,4.2.0>:OLD_COMPILER>
@@ -166,12 +220,123 @@ expands to ``OLD_COMPILER`` if the
:variable:`CMAKE_CXX_COMPILER_VERSION <CMAKE_<LANG>_COMPILER_VERSION>` is less
than 4.2.0.
-Available informational expressions are:
+And here two nested string-valued expressions:
+
+.. code-block:: cmake
+
+ -I$<JOIN:$<TARGET_PROPERTY:INCLUDE_DIRECTORIES>, -I>
+
+generates a string of the entries in the :prop_tgt:`INCLUDE_DIRECTORIES` target
+property with each entry preceded by ``-I``.
+
+Expanding on the previous example, if one first wants to check if the
+``INCLUDE_DIRECTORIES`` property is non-empty, then it is advisable to
+introduce a helper variable to keep the code readable:
+
+.. code-block:: cmake
+
+ set(prop "$<TARGET_PROPERTY:INCLUDE_DIRECTORIES>") # helper variable
+ $<$<BOOL:${prop}>:-I$<JOIN:${prop}, -I>>
+
+The following string-valued generator expressions are available:
+
+Escaped Characters
+------------------
+
+String literals to escape the special meaning a character would otherwise have:
+
+``$<ANGLE-R>``
+ A literal ``>``. Used for example to compare strings that contain a ``>``.
+``$<COMMA>``
+ A literal ``,``. Used for example to compare strings which contain a ``,``.
+``$<SEMICOLON>``
+ A literal ``;``. Used to prevent list expansion on an argument with ``;``.
+
+.. _`Conditional Generator Expressions`:
+
+Conditional Expressions
+-----------------------
+
+Conditional generator expressions depend on a boolean condition
+that must be ``0`` or ``1``.
+
+``$<condition:true_string>``
+ Evaluates to ``true_string`` if ``condition`` is ``1``.
+ Otherwise evaluates to the empty string.
+
+``$<IF:condition,true_string,false_string>``
+ Evaluates to ``true_string`` if ``condition`` is ``1``.
+ Otherwise evaluates to ``false_string``.
+
+Typically, the ``condition`` is a :ref:`boolean generator expression
+<Boolean Generator Expressions>`. For instance,
+
+.. code-block:: cmake
+
+ $<$<CONFIG:Debug>:DEBUG_MODE>
+
+expands to ``DEBUG_MODE`` when the ``Debug`` configuration is used, and
+otherwise expands to the empty string.
+
+.. _`String Transforming Generator Expressions`:
+
+String Transformations
+----------------------
+
+``$<JOIN:list,string>``
+ Joins the list with the content of ``string``.
+``$<LOWER_CASE:string>``
+ Content of ``string`` converted to lower case.
+``$<UPPER_CASE:string>``
+ Content of ``string`` converted to upper case.
+
+``$<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>``
+ 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.
+
+ Having the capability to evaluate generator expressions is very useful when
+ you want to manage custom properties supporting generator expressions.
+ For example:
+
+ .. code-block:: cmake
+
+ add_library(foo ...)
+
+ set_property(TARGET foo PROPERTY
+ CUSTOM_KEYS $<$<CONFIG:DEBUG>:FOO_EXTRA_THINGS>
+ )
+
+ add_custom_target(printFooKeys
+ COMMAND ${CMAKE_COMMAND} -E echo $<TARGET_PROPERTY:foo,CUSTOM_KEYS>
+ )
+
+ This naive implementation of the ``printFooKeys`` custom command is wrong
+ because ``CUSTOM_KEYS`` target property is not evaluated and the content
+ is passed as is (i.e. ``$<$<CONFIG:DEBUG>:FOO_EXTRA_THINGS>``).
+
+ To have the expected result (i.e. ``FOO_EXTRA_THINGS`` if config is
+ ``Debug``), it is required to evaluate the output of
+ ``$<TARGET_PROPERTY:foo,CUSTOM_KEYS>``:
+
+ .. code-block:: cmake
+
+ add_custom_target(printFooKeys
+ COMMAND ${CMAKE_COMMAND} -E
+ echo $<TARGET_GENEX_EVAL:foo,$<TARGET_PROPERTY:foo,CUSTOM_KEYS>>
+ )
+
+Variable Queries
+----------------
-``$<CONFIGURATION>``
- Configuration name. Deprecated. Use ``CONFIG`` instead.
``$<CONFIG>``
- Configuration name
+ Configuration name.
+``$<CONFIGURATION>``
+ Configuration name. Deprecated since CMake 3.0. Use ``CONFIG`` instead.
``$<PLATFORM_ID>``
The CMake-id of the platform.
See also the :variable:`CMAKE_SYSTEM_NAME` variable.
@@ -181,12 +346,31 @@ Available informational expressions are:
``$<CXX_COMPILER_ID>``
The CMake-id of the CXX compiler used.
See also the :variable:`CMAKE_<LANG>_COMPILER_ID` variable.
+``$<Fortran_COMPILER_ID>``
+ The CMake-id of the Fortran compiler used.
+ See also the :variable:`CMAKE_<LANG>_COMPILER_ID` variable.
``$<C_COMPILER_VERSION>``
The version of the C compiler used.
See also the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable.
``$<CXX_COMPILER_VERSION>``
The version of the CXX compiler used.
See also the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable.
+``$<Fortran_COMPILER_VERSION>``
+ The version of the Fortran compiler used.
+ See also the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable.
+``$<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.
+
+Target-Dependent Queries
+------------------------
+
+``$<TARGET_NAME_IF_EXISTS:tgt>``
+ Expands to the ``tgt`` if the given target exists, an empty string
+ otherwise.
``$<TARGET_FILE:tgt>``
Full path to main file (.exe, .so.1.2, .a) where ``tgt`` is the name of a target.
``$<TARGET_FILE_NAME:tgt>``
@@ -232,56 +416,21 @@ Available informational expressions are:
expression is evaluated on.
``$<TARGET_PROPERTY:prop>``
Value of the property ``prop`` on the target on which the generator
- expression is evaluated.
+ expression is evaluated. Note that for generator expressions in
+ :ref:`Target Usage Requirements` this is the value of the property
+ on the consuming target rather than the target specifying the
+ requirement.
``$<INSTALL_PREFIX>``
Content of the install prefix when the target is exported via
:command:`install(EXPORT)` and empty otherwise.
-``$<COMPILE_LANGUAGE>``
- The compile language of source files when evaluating compile options. See
- the unary version for notes about portability of this generator
- expression.
-
-Output Expressions
-==================
-These expressions generate output, in some cases depending on an input. These
-expressions may be combined with other expressions for information or logical
-comparison::
+Output-Related Expressions
+--------------------------
- -I$<JOIN:$<TARGET_PROPERTY:INCLUDE_DIRECTORIES>, -I>
-
-generates a string of the entries in the :prop_tgt:`INCLUDE_DIRECTORIES` target
-property with each entry preceded by ``-I``. Note that a more-complete use
-in this situation would require first checking if the INCLUDE_DIRECTORIES
-property is non-empty::
-
- $<$<BOOL:${prop}>:-I$<JOIN:${prop}, -I>>
-
-where ``${prop}`` refers to a helper variable::
-
- set(prop "$<TARGET_PROPERTY:INCLUDE_DIRECTORIES>")
-
-Available output expressions are:
-
-``$<0:...>``
- Empty string (ignores ``...``)
-``$<1:...>``
- Content of ``...``
-``$<JOIN:list,...>``
- Joins the list with the content of ``...``
-``$<ANGLE-R>``
- A literal ``>``. Used to compare strings which contain a ``>`` for example.
-``$<COMMA>``
- A literal ``,``. Used to compare strings which contain a ``,`` for example.
-``$<SEMICOLON>``
- A literal ``;``. Used to prevent list expansion on an argument with ``;``.
``$<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.
-``$<TARGET_NAME_IF_EXISTS:...>``
- Expands to the ``...`` if the given target exists, an empty string
- otherwise.
``$<LINK_ONLY:...>``
Content of ``...`` except when evaluated in a link interface while
propagating :ref:`Target Usage Requirements`, in which case it is the
@@ -296,10 +445,6 @@ Available output expressions are:
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.
-``$<LOWER_CASE:...>``
- Content of ``...`` converted to lower case.
-``$<UPPER_CASE:...>``
- Content of ``...`` converted to upper case.
``$<MAKE_C_IDENTIFIER:...>``
Content of ``...`` converted to a C identifier. The conversion follows the
same behavior as :command:`string(MAKE_C_IDENTIFIER)`.
@@ -310,42 +455,25 @@ Available output expressions are:
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.
-``$<GENEX_EVAL:...>``
- Content of ``...`` 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,...>``
- Content of ``...`` evaluated as a generator expression in the context of
- ``tgt`` target. This enables consumption of custom target properties that
- themselves contain generator expressions.
- Having the capability to evaluate generator expressions is very useful when
- you want to manage custom properties supporting generator expressions.
- For example:
+Debugging
+=========
- .. code-block:: cmake
+Since generator expressions are evaluated during generation of the buildsystem,
+and not during processing of ``CMakeLists.txt`` files, it is not possible to
+inspect their result with the :command:`message()` command.
- add_library(foo ...)
+One possible way to generate debug messages is to add a custom target,
- set_property(TARGET foo PROPERTY
- CUSTOM_KEYS $<$<CONFIG:DEBUG>:FOO_EXTRA_THINGS>
- )
+.. code-block:: cmake
- add_custom_target(printFooKeys
- COMMAND ${CMAKE_COMMAND} -E echo $<TARGET_PROPERTY:foo,CUSTOM_KEYS>
- )
+ add_custom_target(genexdebug COMMAND ${CMAKE_COMMAND} -E echo "$<...>")
- This naive implementation of the ``printFooKeys`` custom command is wrong
- because ``CUSTOM_KEYS`` target property is not evaluated and the content
- is passed as is (i.e. ``$<$<CONFIG:DEBUG>:FOO_EXTRA_THINGS>``).
+The shell command ``make genexdebug`` (invoked after execution of ``cmake``)
+would then print the result of ``$<...>``.
- To have the expected result (i.e. ``FOO_EXTRA_THINGS`` if config is
- ``Debug``), it is required to evaluate the output of
- ``$<TARGET_PROPERTY:foo,CUSTOM_KEYS>``:
+Another way is to write debug messages to a file:
- .. code-block:: cmake
+.. code-block:: cmake
- add_custom_target(printFooKeys
- COMMAND ${CMAKE_COMMAND} -E
- echo $<TARGET_GENEX_EVAL:foo,$<TARGET_PROPERTY:foo,CUSTOM_KEYS>>
- )
+ file(GENERATE OUTPUT filename CONTENT "$<...>")
diff --git a/Help/manual/cmake-generators.7.rst b/Help/manual/cmake-generators.7.rst
index 028776750..41f765220 100644
--- a/Help/manual/cmake-generators.7.rst
+++ b/Help/manual/cmake-generators.7.rst
@@ -27,6 +27,8 @@ when creating a new build tree.
CMake Generators
================
+.. _`Command-Line Build Tool Generators`:
+
Command-Line Build Tool Generators
----------------------------------
@@ -58,6 +60,8 @@ Ninja Generator
/generator/Ninja
+.. _`IDE Build Tool Generators`:
+
IDE Build Tool Generators
-------------------------
@@ -83,6 +87,7 @@ Visual Studio Generators
/generator/Visual Studio 12 2013
/generator/Visual Studio 14 2015
/generator/Visual Studio 15 2017
+ /generator/Visual Studio 16 2019
Other Generators
^^^^^^^^^^^^^^^^
diff --git a/Help/manual/cmake-gui.1.rst b/Help/manual/cmake-gui.1.rst
index 57a98503b..856aa2fba 100644
--- a/Help/manual/cmake-gui.1.rst
+++ b/Help/manual/cmake-gui.1.rst
@@ -10,11 +10,12 @@ Synopsis
cmake-gui [<options>]
cmake-gui [<options>] {<path-to-source> | <path-to-existing-build>}
+ cmake-gui [<options>] -S <path-to-source> -B <path-to-build>
Description
===========
-The "cmake-gui" executable is the CMake GUI. Project configuration
+The **cmake-gui** executable is the CMake GUI. Project configuration
settings may be specified interactively. Brief instructions are
provided at the bottom of the window when the program is running.
@@ -27,6 +28,14 @@ native tool on their platform.
Options
=======
+``-S <path-to-source>``
+ Path to root directory of the CMake project to build.
+
+``-B <path-to-build>``
+ Path to directory which CMake will use as the root of build directory.
+
+ If the directory doesn't already exist CMake will make it.
+
.. include:: OPTIONS_HELP.txt
See Also
diff --git a/Help/manual/cmake-language.7.rst b/Help/manual/cmake-language.7.rst
index 71649ba3e..5e5cffffd 100644
--- a/Help/manual/cmake-language.7.rst
+++ b/Help/manual/cmake-language.7.rst
@@ -206,9 +206,10 @@ enclosed content, such as `Escape Sequences`_ or `Variable References`_,
is performed. A bracket argument is always given to the command
invocation as exactly one argument.
-For example:
+.. No code-block syntax highlighting in the following example
+ (long string literal not supported by our cmake.py)
-.. code-block:: cmake
+For example::
message([=[
This is the first line in a bracket argument with bracket length 1.
@@ -253,16 +254,22 @@ closing quotes. Both `Escape Sequences`_ and `Variable References`_
are evaluated. A quoted argument is always given to the command
invocation as exactly one argument.
+.. No code-block syntax highlighting in the following example
+ (escape \" not supported by our cmake.py)
+
For example:
-::
+.. code-block:: cmake
- message("This is a quoted argument containing multiple lines.
- This is always one argument even though it contains a ; character.
- Both \\-escape sequences and ${variable} references are evaluated.
- The text does not end on an escaped double-quote like \".
- It does end in an unescaped double quote.
- ")
+ message("This is a quoted argument containing multiple lines.
+ This is always one argument even though it contains a ; character.
+ Both \\-escape sequences and ${variable} references are evaluated.
+ The text does not end on an escaped double-quote like \".
+ It does end in an unescaped double quote.
+ ")
+
+.. No code-block syntax highlighting in the following example
+ (for conformity with the two above examples)
The final ``\`` on any line ending in an odd number of backslashes
is treated as a line continuation and ignored along with the
@@ -270,11 +277,11 @@ immediately following newline character. For example:
.. code-block:: cmake
- message("\
- This is the first line of a quoted argument. \
- In fact it is the only line but since it is long \
- the source code uses line continuation.\
- ")
+ message("\
+ This is the first line of a quoted argument. \
+ In fact it is the only line but since it is long \
+ the source code uses line continuation.\
+ ")
.. note::
CMake versions prior to 3.0 do not support continuation with ``\``.
@@ -382,7 +389,7 @@ historical considerations.)
Variable References
-------------------
-A *variable reference* has the form ``${variable_name}`` and is
+A *variable reference* has the form ``${<variable>}`` and is
evaluated inside a `Quoted Argument`_ or an `Unquoted Argument`_.
A variable reference is replaced by the value of the variable,
or by the empty string if the variable is not set.
@@ -398,14 +405,18 @@ the ``$`` is also technically permitted but is discouraged.
The `Variables`_ section documents the scope of variable names
and how their values are set.
-An *environment variable reference* has the form ``$ENV{VAR}`` and
-is evaluated in the same contexts as a normal variable reference.
-See :variable:`ENV` for more information.
+An *environment variable reference* has the form ``$ENV{<variable>}``.
+See the `Environment Variables`_ section for more information.
-A *cache variable reference* has the form ``$CACHE{VAR}`` and
-is evaluated in the same contexts as a normal variable reference.
+A *cache variable reference* has the form ``$CACHE{<variable>}``.
See :variable:`CACHE` for more information.
+The :command:`if` command has a special condition syntax that
+allows for variable references in the short form ``<variable>``
+instead of ``${<variable>}``.
+However, environment and cache variables always need to be
+referenced as ``$ENV{<variable>}`` or ``$CACHE{<variable>}``.
+
Comments
--------
@@ -552,10 +563,38 @@ Otherwise, the variable reference evaluates to an empty string.
The ``$CACHE{VAR}`` syntax can be used to do direct cache entry
lookups.
-The :manual:`cmake-variables(7)` manual documents many variables
+The :manual:`cmake-variables(7)` manual documents the many variables
that are provided by CMake or have meaning to CMake when set
by project code.
+.. _`CMake Language Environment Variables`:
+
+Environment Variables
+=====================
+
+Environment Variables are like ordinary `Variables`_, with the
+following differences:
+
+Scope
+ Environment variables have global scope in a CMake process.
+ They are never cached.
+
+References
+ `Variable References`_ have the form ``$ENV{<variable>}``.
+
+Initialization
+ Initial values of the CMake environment variables are those of
+ the calling process.
+ Values can be changed using the :command:`set` and :command:`unset`
+ commands.
+ These commands only affect the running CMake process,
+ not the system environment at large.
+ Changed values are not written back to the calling process,
+ and they are not seen by subsequent build or test processes.
+
+The :manual:`cmake-env-variables(7)` manual documents environment
+variables that have special meaning to CMake.
+
.. _`CMake Language Lists`:
Lists
diff --git a/Help/manual/cmake-modules.7.rst b/Help/manual/cmake-modules.7.rst
index b7276b657..d9b939f3b 100644
--- a/Help/manual/cmake-modules.7.rst
+++ b/Help/manual/cmake-modules.7.rst
@@ -3,12 +3,14 @@
cmake-modules(7)
****************
-.. only:: html
+The modules listed here are part of the CMake distribution.
+Projects may provide further modules; their location(s)
+can be specified in the :variable:`CMAKE_MODULE_PATH` variable.
- .. contents::
+Utility Modules
+^^^^^^^^^^^^^^^
-All Modules
-===========
+These modules are loaded using the :command:`include` command.
.. toctree::
:maxdepth: 1
@@ -26,6 +28,7 @@ All Modules
/module/CheckFortranCompilerFlag
/module/CheckFortranFunctionExists
/module/CheckFortranSourceCompiles
+ /module/CheckFortranSourceRuns
/module/CheckFunctionExists
/module/CheckIPOSupported
/module/CheckIncludeFileCXX
@@ -33,6 +36,7 @@ All Modules
/module/CheckIncludeFiles
/module/CheckLanguage
/module/CheckLibraryExists
+ /module/CheckPIESupported
/module/CheckPrototypeDefinition
/module/CheckStructHasMember
/module/CheckSymbolExists
@@ -41,15 +45,11 @@ All Modules
/module/CMakeAddFortranSubdirectory
/module/CMakeBackwardCompatibilityCXX
/module/CMakeDependentOption
- /module/CMakeDetermineVSServicePack
- /module/CMakeExpandImportedTargets
/module/CMakeFindDependencyMacro
/module/CMakeFindFrameworks
/module/CMakeFindPackageMode
- /module/CMakeForceCompiler
/module/CMakeGraphVizOptions
/module/CMakePackageConfigHelpers
- /module/CMakeParseArguments
/module/CMakePrintHelpers
/module/CMakePrintSystemInformation
/module/CMakePushCheckState
@@ -70,6 +70,39 @@ All Modules
/module/ExternalProject
/module/FeatureSummary
/module/FetchContent
+ /module/FindPackageHandleStandardArgs
+ /module/FindPackageMessage
+ /module/FortranCInterface
+ /module/GenerateExportHeader
+ /module/GetPrerequisites
+ /module/GNUInstallDirs
+ /module/GoogleTest
+ /module/InstallRequiredSystemLibraries
+ /module/ProcessorCount
+ /module/SelectLibraryConfigurations
+ /module/SquishTestScript
+ /module/TestBigEndian
+ /module/TestForANSIForScope
+ /module/TestForANSIStreamHeaders
+ /module/TestForSSTREAM
+ /module/TestForSTDNamespace
+ /module/UseEcos
+ /module/UseJavaClassFilelist
+ /module/UseJava
+ /module/UseJavaSymlinks
+ /module/UseSWIG
+ /module/UsewxWidgets
+ /module/WriteCompilerDetectionHeader
+
+Find Modules
+^^^^^^^^^^^^
+
+These modules search for third-party software.
+They are normally called through the :command:`find_package` command.
+
+.. toctree::
+ :maxdepth: 1
+
/module/FindALSA
/module/FindArmadillo
/module/FindASPELL
@@ -82,7 +115,6 @@ All Modules
/module/FindBZip2
/module/FindCABLE
/module/FindCoin3D
- /module/FindCUDA
/module/FindCups
/module/FindCURL
/module/FindCurses
@@ -97,6 +129,7 @@ All Modules
/module/FindFLEX
/module/FindFLTK2
/module/FindFLTK
+ /module/FindFontconfig
/module/FindFreetype
/module/FindGCCXML
/module/FindGDAL
@@ -131,6 +164,7 @@ All Modules
/module/FindLAPACK
/module/FindLATEX
/module/FindLibArchive
+ /module/FindLibinput
/module/FindLibLZMA
/module/FindLibXml2
/module/FindLibXslt
@@ -173,8 +207,6 @@ All Modules
/module/FindosgViewer
/module/FindosgVolume
/module/FindosgWidget
- /module/FindPackageHandleStandardArgs
- /module/FindPackageMessage
/module/FindPatch
/module/FindPerlLibs
/module/FindPerl
@@ -189,11 +221,8 @@ All Modules
/module/FindPython
/module/FindPython2
/module/FindPython3
- /module/FindPythonInterp
- /module/FindPythonLibs
/module/FindQt3
/module/FindQt4
- /module/FindQt
/module/FindQuickTime
/module/FindRTI
/module/FindRuby
@@ -205,6 +234,7 @@ All Modules
/module/FindSDL_ttf
/module/FindSelfPackers
/module/FindSquish
+ /module/FindSQLite3
/module/FindSubversion
/module/FindSWIG
/module/FindTCL
@@ -218,39 +248,43 @@ All Modules
/module/FindWget
/module/FindWish
/module/FindwxWidgets
- /module/FindwxWindows
/module/FindXCTest
/module/FindXalanC
/module/FindXercesC
/module/FindX11
/module/FindXMLRPC
/module/FindZLIB
- /module/FortranCInterface
- /module/GenerateExportHeader
- /module/GetPrerequisites
- /module/GNUInstallDirs
- /module/GoogleTest
- /module/InstallRequiredSystemLibraries
+
+Deprecated Modules
+^^^^^^^^^^^^^^^^^^^
+
+Deprecated Utility Modules
+==========================
+
+.. toctree::
+ :maxdepth: 1
+
+ /module/CMakeDetermineVSServicePack
+ /module/CMakeExpandImportedTargets
+ /module/CMakeForceCompiler
+ /module/CMakeParseArguments
/module/MacroAddFileDependencies
- /module/ProcessorCount
- /module/SelectLibraryConfigurations
- /module/SquishTestScript
- /module/TestBigEndian
/module/TestCXXAcceptsFlag
- /module/TestForANSIForScope
- /module/TestForANSIStreamHeaders
- /module/TestForSSTREAM
- /module/TestForSTDNamespace
- /module/UseEcos
- /module/UseJavaClassFilelist
- /module/UseJava
- /module/UseJavaSymlinks
/module/UsePkgConfig
- /module/UseSWIG
- /module/UsewxWidgets
/module/Use_wxWindows
/module/WriteBasicConfigVersionFile
- /module/WriteCompilerDetectionHeader
+
+Deprecated Find Modules
+=======================
+
+.. toctree::
+ :maxdepth: 1
+
+ /module/FindCUDA
+ /module/FindPythonInterp
+ /module/FindPythonLibs
+ /module/FindQt
+ /module/FindwxWindows
Legacy CPack Modules
====================
diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst
index 2cc52fe1a..409b5b1c7 100644
--- a/Help/manual/cmake-policies.7.rst
+++ b/Help/manual/cmake-policies.7.rst
@@ -51,6 +51,20 @@ 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.14
+=================================
+
+.. toctree::
+ :maxdepth: 1
+
+ CMP0088: FindBISON runs bison in CMAKE_CURRENT_BINARY_DIR when executing. </policy/CMP0088>
+ CMP0087: install(SCRIPT | CODE) supports generator expressions. </policy/CMP0087>
+ CMP0086: UseSWIG honors SWIG_MODULE_NAME via -module flag. </policy/CMP0086>
+ CMP0085: IN_LIST generator expression handles empty list items. </policy/CMP0085>
+ CMP0084: The FindQt module does not exist for find_package(). </policy/CMP0084>
+ CMP0083: Add PIE options when linking executable. </policy/CMP0083>
+ CMP0082: Install rules from add_subdirectory() are interleaved with those in caller. </policy/CMP0082>
+
Policies Introduced by CMake 3.13
=================================
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index 5c3eb81fc..ef864129b 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -23,6 +23,7 @@ Properties of Global Scope
/prop_gbl/AUTORCC_SOURCE_GROUP
/prop_gbl/CMAKE_C_KNOWN_FEATURES
/prop_gbl/CMAKE_CXX_KNOWN_FEATURES
+ /prop_gbl/CMAKE_ROLE
/prop_gbl/DEBUG_CONFIGURATIONS
/prop_gbl/DISABLED_FEATURES
/prop_gbl/ENABLED_FEATURES
@@ -124,20 +125,25 @@ Properties on Targets
/prop_tgt/ARCHIVE_OUTPUT_NAME_CONFIG
/prop_tgt/ARCHIVE_OUTPUT_NAME
/prop_tgt/AUTOGEN_BUILD_DIR
+ /prop_tgt/AUTOGEN_ORIGIN_DEPENDS
/prop_tgt/AUTOGEN_PARALLEL
/prop_tgt/AUTOGEN_TARGET_DEPENDS
/prop_tgt/AUTOMOC_COMPILER_PREDEFINES
/prop_tgt/AUTOMOC_DEPEND_FILTERS
+ /prop_tgt/AUTOMOC_EXECUTABLE
/prop_tgt/AUTOMOC_MACRO_NAMES
/prop_tgt/AUTOMOC_MOC_OPTIONS
/prop_tgt/AUTOMOC
/prop_tgt/AUTOUIC
+ /prop_tgt/AUTOUIC_EXECUTABLE
/prop_tgt/AUTOUIC_OPTIONS
/prop_tgt/AUTOUIC_SEARCH_PATHS
/prop_tgt/AUTORCC
+ /prop_tgt/AUTORCC_EXECUTABLE
/prop_tgt/AUTORCC_OPTIONS
/prop_tgt/BINARY_DIR
/prop_tgt/BUILD_RPATH
+ /prop_tgt/BUILD_RPATH_USE_ORIGIN
/prop_tgt/BUILD_WITH_INSTALL_NAME_DIR
/prop_tgt/BUILD_WITH_INSTALL_RPATH
/prop_tgt/BUNDLE_EXTENSION
@@ -188,6 +194,8 @@ Properties on Targets
/prop_tgt/FRAMEWORK
/prop_tgt/FRAMEWORK_VERSION
/prop_tgt/GENERATOR_FILE_NAME
+ /prop_tgt/GHS_INTEGRITY_APP
+ /prop_tgt/GHS_NO_SOURCE_GROUP_FILE
/prop_tgt/GNUtoMS
/prop_tgt/HAS_CXX
/prop_tgt/IMPLICIT_DEPENDS_INCLUDE_TRANSFORM
@@ -199,7 +207,6 @@ Properties on Targets
/prop_tgt/IMPORTED_LIBNAME_CONFIG
/prop_tgt/IMPORTED_LIBNAME
/prop_tgt/IMPORTED_LINK_DEPENDENT_LIBRARIES_CONFIG
- /prop_tgt/IMPORTED_LINK_DEPENDENT_LIBRARIES_CONFIG
/prop_tgt/IMPORTED_LINK_DEPENDENT_LIBRARIES
/prop_tgt/IMPORTED_LINK_INTERFACE_LANGUAGES_CONFIG
/prop_tgt/IMPORTED_LINK_INTERFACE_LANGUAGES
@@ -344,22 +351,22 @@ Properties on Targets
/prop_tgt/XCODE_PRODUCT_TYPE
/prop_tgt/XCODE_SCHEME_ADDRESS_SANITIZER
/prop_tgt/XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN
+ /prop_tgt/XCODE_SCHEME_ARGUMENTS
+ /prop_tgt/XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER
+ /prop_tgt/XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS
+ /prop_tgt/XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE
+ /prop_tgt/XCODE_SCHEME_ENVIRONMENT
+ /prop_tgt/XCODE_SCHEME_EXECUTABLE
+ /prop_tgt/XCODE_SCHEME_GUARD_MALLOC
+ /prop_tgt/XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP
+ /prop_tgt/XCODE_SCHEME_MALLOC_GUARD_EDGES
+ /prop_tgt/XCODE_SCHEME_MALLOC_SCRIBBLE
+ /prop_tgt/XCODE_SCHEME_MALLOC_STACK
/prop_tgt/XCODE_SCHEME_THREAD_SANITIZER
/prop_tgt/XCODE_SCHEME_THREAD_SANITIZER_STOP
/prop_tgt/XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER
/prop_tgt/XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP
- /prop_tgt/XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER
- /prop_tgt/XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP
- /prop_tgt/XCODE_SCHEME_MALLOC_SCRIBBLE
- /prop_tgt/XCODE_SCHEME_MALLOC_GUARD_EDGES
- /prop_tgt/XCODE_SCHEME_GUARD_MALLOC
/prop_tgt/XCODE_SCHEME_ZOMBIE_OBJECTS
- /prop_tgt/XCODE_SCHEME_MALLOC_STACK
- /prop_tgt/XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE
- /prop_tgt/XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS
- /prop_tgt/XCODE_SCHEME_EXECUTABLE
- /prop_tgt/XCODE_SCHEME_ARGUMENTS
- /prop_tgt/XCODE_SCHEME_ENVIRONMENT
/prop_tgt/XCTEST
.. _`Test Properties`:
diff --git a/Help/manual/cmake-qt.7.rst b/Help/manual/cmake-qt.7.rst
index 724d8ec2a..d8d61729e 100644
--- a/Help/manual/cmake-qt.7.rst
+++ b/Help/manual/cmake-qt.7.rst
@@ -44,14 +44,10 @@ Qt Build Tools
Qt relies on some bundled tools for code generation, such as ``moc`` for
meta-object code generation, ``uic`` for widget layout and population,
-and ``rcc`` for virtual filesystem content generation. These tools may be
+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.
-The tools are executed as part of a synthesized custom target generated by
-CMake. Target dependencies may be added to that custom target by adding them
-to the :prop_tgt:`AUTOGEN_TARGET_DEPENDS` target property.
-
AUTOMOC
^^^^^^^
@@ -214,20 +210,33 @@ overrides options from the :prop_tgt:`AUTORCC_OPTIONS` target property.
Source files can be excluded from :prop_tgt:`AUTORCC` processing by
enabling :prop_sf:`SKIP_AUTORCC` or the broader :prop_sf:`SKIP_AUTOGEN`.
+The ``<ORIGIN>_autogen`` target
+===============================
+
+The ``moc`` and ``uic`` tools are executed as part of a synthesized
+``<ORIGIN>_autogen`` :command:`custom target <add_custom_target>` generated by
+CMake. By default that ``<ORIGIN>_autogen`` target inherits the dependencies
+of the ``<ORIGIN>`` target (see :prop_tgt:`AUTOGEN_ORIGIN_DEPENDS`).
+Target dependencies may be added to the ``<ORIGIN>_autogen`` target by adding
+them to the :prop_tgt:`AUTOGEN_TARGET_DEPENDS` target property.
+
Visual Studio Generators
========================
-When using the :manual:`Visual Studio generators <cmake-generators(7)>`,
-CMake uses a ``PRE_BUILD`` :command:`custom command <add_custom_command>` for
-:prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC`.
-If the :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC` processing depends on files,
-a :command:`custom target <add_custom_target>` is used instead.
-This happens when
-
-- The origin target depends on :prop_sf:`GENERATED` files which aren't excluded
- from :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC` by :prop_sf:`SKIP_AUTOMOC`,
- :prop_sf:`SKIP_AUTOUIC`, :prop_sf:`SKIP_AUTOGEN` or :policy:`CMP0071`
+When using the :manual:`Visual Studio generators <cmake-generators(7)>`, CMake
+generates a ``PRE_BUILD`` :command:`custom command <add_custom_command>`
+instead of the ``<ORIGIN>_autogen`` :command:`custom target <add_custom_target>`
+(for :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC`).
+This isn't always possible though and
+an ``<ORIGIN>_autogen`` :command:`custom target <add_custom_target>` is used,
+when either
+
+- the ``<ORIGIN>`` target depends on :prop_sf:`GENERATED` files which aren't
+ excluded from :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC` by
+ :prop_sf:`SKIP_AUTOMOC`, :prop_sf:`SKIP_AUTOUIC`, :prop_sf:`SKIP_AUTOGEN`
+ or :policy:`CMP0071`
- :prop_tgt:`AUTOGEN_TARGET_DEPENDS` lists a source file
+- :variable:`CMAKE_GLOBAL_AUTOGEN_TARGET` is enabled
qtmain.lib on Windows
=====================
diff --git a/Help/manual/cmake-toolchains.7.rst b/Help/manual/cmake-toolchains.7.rst
index 8554e87f9..ba44b7f21 100644
--- a/Help/manual/cmake-toolchains.7.rst
+++ b/Help/manual/cmake-toolchains.7.rst
@@ -522,3 +522,132 @@ See also target properties:
* :prop_tgt:`ANDROID_SECURE_PROPS_PATH`
* :prop_tgt:`ANDROID_SKIP_ANT_STEP`
* :prop_tgt:`ANDROID_STL_TYPE`
+
+.. _`Cross Compiling for iOS, tvOS, or watchOS`:
+
+Cross Compiling for iOS, tvOS, or watchOS
+-----------------------------------------
+
+For cross-compiling to iOS, tvOS, or watchOS, the :generator:`Xcode`
+generator is recommended. The :generator:`Unix Makefiles` or
+:generator:`Ninja` generators can also be used, but they require the
+project to handle more areas like target CPU selection and code signing.
+
+Any of the three systems can be targetted by setting the
+:variable:`CMAKE_SYSTEM_NAME` variable to a value from the table below.
+By default, the latest Device SDK is chosen. As for all Apple platforms,
+a different SDK (e.g. a simulator) can be selected by setting the
+:variable:`CMAKE_OSX_SYSROOT` variable, although this should rarely be
+necessary (see :ref:`Switching Between Device and Simulator` below).
+A list of available SDKs can be obtained by running ``xcodebuild -showsdks``.
+
+======= ================= ==================== ================
+OS CMAKE_SYSTEM_NAME Device SDK (default) Simulator SDK
+======= ================= ==================== ================
+iOS iOS iphoneos iphonesimulator
+tvOS tvOS appletvos appletvsimulator
+watchOS watchOS watchos watchsimulator
+======= ================= ==================== ================
+
+For example, to create a CMake configuration for iOS, the following
+command is sufficient:
+
+.. code-block:: console
+
+ cmake .. -GXcode -DCMAKE_SYSTEM_NAME=iOS
+
+Variable :variable:`CMAKE_OSX_ARCHITECTURES` can be used to set architectures
+for both device and simulator. Variable :variable:`CMAKE_OSX_DEPLOYMENT_TARGET`
+can be used to set an iOS/tvOS/watchOS deployment target.
+
+Next configuration will install fat 5 architectures iOS library
+and add the ``-miphoneos-version-min=9.3``/``-mios-simulator-version-min=9.3``
+flags to the compiler:
+
+.. code-block:: console
+
+ $ cmake -S. -B_builds -GXcode \
+ -DCMAKE_SYSTEM_NAME=iOS \
+ "-DCMAKE_OSX_ARCHITECTURES=armv7;armv7s;arm64;i386;x86_64" \
+ -DCMAKE_OSX_DEPLOYMENT_TARGET=9.3 \
+ -DCMAKE_INSTALL_PREFIX=`pwd`/_install \
+ -DCMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH=NO \
+ -DCMAKE_IOS_INSTALL_COMBINED=YES
+
+Example:
+
+.. code-block:: cmake
+
+ # CMakeLists.txt
+ cmake_minimum_required(VERSION 3.14)
+ project(foo)
+ add_library(foo foo.cpp)
+ install(TARGETS foo DESTINATION lib)
+
+Install:
+
+.. code-block:: console
+
+ $ cmake --build _builds --config Release --target install
+
+Check library:
+
+.. code-block:: console
+
+ $ lipo -info _install/lib/libfoo.a
+ Architectures in the fat file: _install/lib/libfoo.a are: i386 armv7 armv7s x86_64 arm64
+
+.. code-block:: console
+
+ $ otool -l _install/lib/libfoo.a | grep -A2 LC_VERSION_MIN_IPHONEOS
+ cmd LC_VERSION_MIN_IPHONEOS
+ cmdsize 16
+ version 9.3
+
+Code Signing
+^^^^^^^^^^^^
+
+Some build artifacts for the embedded Apple platforms require mandatory
+code signing. If the :generator:`Xcode` generator is being used and
+code signing is required or desired, the developmemt team ID can be
+specified via the ``CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM`` CMake variable.
+This team ID will then be included in the generated Xcode project.
+By default, CMake avoids the need for code signing during the internal
+configuration phase (i.e compiler ID and feature detection).
+
+.. _`Switching Between Device and Simulator`:
+
+Switching Between Device and Simulator
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+When configuring for any of the embedded platforms, one can target either
+real devices or the simulator. Both have their own separate SDK, but CMake
+only supports specifying a single SDK for the configuration phase. This
+means the developer must select one or the other at configuration time.
+When using the :generator:`Xcode` generator, this is less of a limitation
+because Xcode still allows you to build for either a device or a simulator,
+even though configuration was only performed for one of the two. From
+within the Xcode IDE, builds are performed for the selected "destination"
+platform. When building from the command line, the desired sdk can be
+specified directly by passing a ``-sdk`` option to the underlying build
+tool (``xcodebuild``). For example:
+
+.. code-block:: console
+
+ $ cmake --build ... -- -sdk iphonesimulator
+
+Please note that checks made during configuration were performed against
+the configure-time SDK and might not hold true for other SDKs. Commands
+like :command:`find_package`, :command:`find_library`, etc. store and use
+details only for the configured SDK/platform, so they can be problematic
+if wanting to switch between device and simulator builds. You can follow
+the next rules to make device + simulator configuration work:
+
+- Use explicit ``-l`` linker flag,
+ e.g. ``target_link_libraries(foo PUBLIC "-lz")``
+
+- Use explicit ``-framework`` linker flag,
+ e.g. ``target_link_libraries(foo PUBLIC "-framework CoreFoundation")``
+
+- Use :command:`find_package` only for libraries installed with
+ :variable:`CMAKE_IOS_INSTALL_COMBINED` feature
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index 9dd36ede4..6bb30cba3 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -7,6 +7,14 @@ cmake-variables(7)
.. contents::
+This page documents variables that are provided by CMake
+or have meaning to CMake when set by project code.
+
+For general information on variables, see the
+:ref:`Variables <CMake Language Variables>`
+section in the cmake-language manual.
+
+
Variables that Provide Information
==================================
@@ -47,7 +55,6 @@ Variables that Provide Information
/variable/CMAKE_GENERATOR_INSTANCE
/variable/CMAKE_GENERATOR_PLATFORM
/variable/CMAKE_GENERATOR_TOOLSET
- /variable/CMAKE_HOME_DIRECTORY
/variable/CMAKE_IMPORT_LIBRARY_PREFIX
/variable/CMAKE_IMPORT_LIBRARY_SUFFIX
/variable/CMAKE_JOB_POOL_COMPILE
@@ -95,7 +102,6 @@ Variables that Provide Information
/variable/CMAKE_VERBOSE_MAKEFILE
/variable/CMAKE_VERSION
/variable/CMAKE_VS_DEVENV_COMMAND
- /variable/CMAKE_VS_INTEL_Fortran_PROJECT_VERSION
/variable/CMAKE_VS_MSBUILD_COMMAND
/variable/CMAKE_VS_NsightTegra_VERSION
/variable/CMAKE_VS_PLATFORM_NAME
@@ -162,6 +168,7 @@ Variables that Change Behavior
/variable/CMAKE_FIND_NO_INSTALL_PREFIX
/variable/CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY
/variable/CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY
+ /variable/CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS
/variable/CMAKE_FIND_PACKAGE_WARN_NO_MODULE
/variable/CMAKE_FIND_ROOT_PATH
/variable/CMAKE_FIND_ROOT_PATH_MODE_INCLUDE
@@ -181,8 +188,8 @@ Variables that Change Behavior
/variable/CMAKE_LIBRARY_PATH
/variable/CMAKE_LINK_DIRECTORIES_BEFORE
/variable/CMAKE_MFC_FLAG
+ /variable/CMAKE_MAXIMUM_RECURSION_DEPTH
/variable/CMAKE_MODULE_PATH
- /variable/CMAKE_NOT_USING_CONFIG_FLAGS
/variable/CMAKE_POLICY_DEFAULT_CMPNNNN
/variable/CMAKE_POLICY_WARNING_CMPNNNN
/variable/CMAKE_PREFIX_PATH
@@ -209,19 +216,19 @@ Variables that Change Behavior
/variable/CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY
/variable/CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER
/variable/CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN
+ /variable/CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER
+ /variable/CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS
+ /variable/CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE
+ /variable/CMAKE_XCODE_SCHEME_GUARD_MALLOC
+ /variable/CMAKE_XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP
+ /variable/CMAKE_XCODE_SCHEME_MALLOC_GUARD_EDGES
+ /variable/CMAKE_XCODE_SCHEME_MALLOC_SCRIBBLE
+ /variable/CMAKE_XCODE_SCHEME_MALLOC_STACK
/variable/CMAKE_XCODE_SCHEME_THREAD_SANITIZER
/variable/CMAKE_XCODE_SCHEME_THREAD_SANITIZER_STOP
/variable/CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER
/variable/CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP
- /variable/CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER
- /variable/CMAKE_XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP
- /variable/CMAKE_XCODE_SCHEME_MALLOC_SCRIBBLE
- /variable/CMAKE_XCODE_SCHEME_MALLOC_GUARD_EDGES
- /variable/CMAKE_XCODE_SCHEME_GUARD_MALLOC
/variable/CMAKE_XCODE_SCHEME_ZOMBIE_OBJECTS
- /variable/CMAKE_XCODE_SCHEME_MALLOC_STACK
- /variable/CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE
- /variable/CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS
/variable/PackageName_ROOT
Variables that Describe the System
@@ -233,7 +240,6 @@ Variables that Describe the System
/variable/ANDROID
/variable/APPLE
/variable/BORLAND
- /variable/CACHE
/variable/CMAKE_CL_64
/variable/CMAKE_COMPILER_2005
/variable/CMAKE_HOST_APPLE
@@ -252,8 +258,8 @@ Variables that Describe the System
/variable/CMAKE_SYSTEM_PROCESSOR
/variable/CMAKE_SYSTEM_VERSION
/variable/CYGWIN
- /variable/ENV
/variable/GHS-MULTI
+ /variable/IOS
/variable/MINGW
/variable/MSVC
/variable/MSVC10
@@ -268,6 +274,7 @@ Variables that Describe the System
/variable/MSVC_IDE
/variable/MSVC_TOOLSET_VERSION
/variable/MSVC_VERSION
+ /variable/MSYS
/variable/UNIX
/variable/WIN32
/variable/WINCE
@@ -309,6 +316,7 @@ Variables that Control the Build
/variable/CMAKE_ANDROID_STL_TYPE
/variable/CMAKE_ARCHIVE_OUTPUT_DIRECTORY
/variable/CMAKE_ARCHIVE_OUTPUT_DIRECTORY_CONFIG
+ /variable/CMAKE_AUTOGEN_ORIGIN_DEPENDS
/variable/CMAKE_AUTOGEN_PARALLEL
/variable/CMAKE_AUTOGEN_VERBOSE
/variable/CMAKE_AUTOMOC
@@ -322,6 +330,7 @@ Variables that Control the Build
/variable/CMAKE_AUTOUIC_OPTIONS
/variable/CMAKE_AUTOUIC_SEARCH_PATHS
/variable/CMAKE_BUILD_RPATH
+ /variable/CMAKE_BUILD_RPATH_USE_ORIGIN
/variable/CMAKE_BUILD_WITH_INSTALL_NAME_DIR
/variable/CMAKE_BUILD_WITH_INSTALL_RPATH
/variable/CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY
@@ -337,6 +346,11 @@ Variables that Control the Build
/variable/CMAKE_FOLDER
/variable/CMAKE_Fortran_FORMAT
/variable/CMAKE_Fortran_MODULE_DIRECTORY
+ /variable/CMAKE_GHS_NO_SOURCE_GROUP_FILE
+ /variable/CMAKE_GLOBAL_AUTOGEN_TARGET
+ /variable/CMAKE_GLOBAL_AUTOGEN_TARGET_NAME
+ /variable/CMAKE_GLOBAL_AUTORCC_TARGET
+ /variable/CMAKE_GLOBAL_AUTORCC_TARGET_NAME
/variable/CMAKE_GNUtoMS
/variable/CMAKE_INCLUDE_CURRENT_DIR
/variable/CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE
@@ -437,7 +451,6 @@ Variables for Languages
/variable/CMAKE_Fortran_MODDIR_DEFAULT
/variable/CMAKE_Fortran_MODDIR_FLAG
/variable/CMAKE_Fortran_MODOUT_FLAG
- /variable/CMAKE_INTERNAL_PLATFORM_ABI
/variable/CMAKE_LANG_ANDROID_TOOLCHAIN_MACHINE
/variable/CMAKE_LANG_ANDROID_TOOLCHAIN_PREFIX
/variable/CMAKE_LANG_ANDROID_TOOLCHAIN_SUFFIX
@@ -445,15 +458,12 @@ Variables for Languages
/variable/CMAKE_LANG_ARCHIVE_CREATE
/variable/CMAKE_LANG_ARCHIVE_FINISH
/variable/CMAKE_LANG_COMPILER
- /variable/CMAKE_LANG_COMPILER_ABI
- /variable/CMAKE_LANG_COMPILER_ARCHITECTURE_ID
/variable/CMAKE_LANG_COMPILER_EXTERNAL_TOOLCHAIN
/variable/CMAKE_LANG_COMPILER_ID
/variable/CMAKE_LANG_COMPILER_LOADED
/variable/CMAKE_LANG_COMPILER_PREDEFINES_COMMAND
/variable/CMAKE_LANG_COMPILER_TARGET
/variable/CMAKE_LANG_COMPILER_VERSION
- /variable/CMAKE_LANG_COMPILER_VERSION_INTERNAL
/variable/CMAKE_LANG_COMPILE_OBJECT
/variable/CMAKE_LANG_CREATE_SHARED_LIBRARY
/variable/CMAKE_LANG_CREATE_SHARED_MODULE
@@ -470,11 +480,6 @@ Variables for Languages
/variable/CMAKE_LANG_FLAGS_RELEASE_INIT
/variable/CMAKE_LANG_FLAGS_RELWITHDEBINFO
/variable/CMAKE_LANG_FLAGS_RELWITHDEBINFO_INIT
- /variable/CMAKE_LANG_GHS_KERNEL_FLAGS_CONFIG
- /variable/CMAKE_LANG_GHS_KERNEL_FLAGS_DEBUG
- /variable/CMAKE_LANG_GHS_KERNEL_FLAGS_MINSIZEREL
- /variable/CMAKE_LANG_GHS_KERNEL_FLAGS_RELEASE
- /variable/CMAKE_LANG_GHS_KERNEL_FLAGS_RELWITHDEBINFO
/variable/CMAKE_LANG_IGNORE_EXTENSIONS
/variable/CMAKE_LANG_IMPLICIT_INCLUDE_DIRECTORIES
/variable/CMAKE_LANG_IMPLICIT_LINK_DIRECTORIES
@@ -487,7 +492,6 @@ Variables for Languages
/variable/CMAKE_LANG_LINKER_WRAPPER_FLAG_SEP
/variable/CMAKE_LANG_LINK_EXECUTABLE
/variable/CMAKE_LANG_OUTPUT_EXTENSION
- /variable/CMAKE_LANG_PLATFORM_ID
/variable/CMAKE_LANG_SIMULATE_ID
/variable/CMAKE_LANG_SIMULATE_VERSION
/variable/CMAKE_LANG_SIZEOF_DATA_PTR
@@ -529,7 +533,7 @@ Variables for CTest
/variable/CTEST_CUSTOM_POST_TEST
/variable/CTEST_CUSTOM_PRE_MEMCHECK
/variable/CTEST_CUSTOM_PRE_TEST
- /variable/CTEST_CUSTOM_TEST_IGNORE
+ /variable/CTEST_CUSTOM_TESTS_IGNORE
/variable/CTEST_CUSTOM_WARNING_EXCEPTION
/variable/CTEST_CUSTOM_WARNING_MATCH
/variable/CTEST_CVS_CHECKOUT
@@ -562,6 +566,7 @@ Variables for CTest
/variable/CTEST_RUN_CURRENT_SCRIPT
/variable/CTEST_SCP_COMMAND
/variable/CTEST_SITE
+ /variable/CTEST_SUBMIT_URL
/variable/CTEST_SOURCE_DIRECTORY
/variable/CTEST_SVN_COMMAND
/variable/CTEST_SVN_OPTIONS
@@ -589,3 +594,32 @@ Variables for CPack
/variable/CPACK_PACKAGING_INSTALL_PREFIX
/variable/CPACK_SET_DESTDIR
/variable/CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION
+
+Variable Expansion Operators
+============================
+
+.. toctree::
+ :maxdepth: 1
+
+ /variable/CACHE
+ /variable/ENV
+
+Internal Variables
+==================
+
+CMake has many internal variables. Most of them are undocumented.
+Some of them, however, were at some point described as normal
+variables, and therefore may be encountered in legacy code. They
+are subject to change, and not recommended for use in project code.
+
+.. toctree::
+ :maxdepth: 1
+
+ /variable/CMAKE_HOME_DIRECTORY
+ /variable/CMAKE_INTERNAL_PLATFORM_ABI
+ /variable/CMAKE_LANG_COMPILER_ABI
+ /variable/CMAKE_LANG_COMPILER_ARCHITECTURE_ID
+ /variable/CMAKE_LANG_COMPILER_VERSION_INTERNAL
+ /variable/CMAKE_LANG_PLATFORM_ID
+ /variable/CMAKE_NOT_USING_CONFIG_FLAGS
+ /variable/CMAKE_VS_INTEL_Fortran_PROJECT_VERSION
diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst
index b11526c43..f3b81ecb6 100644
--- a/Help/manual/cmake.1.rst
+++ b/Help/manual/cmake.1.rst
@@ -8,37 +8,164 @@ Synopsis
.. parsed-literal::
- cmake [<options>] {<path-to-source> | <path-to-existing-build>}
- cmake [<options>] -S <path-to-source> -B <path-to-build>
- cmake [{-D <var>=<value>}...] -P <cmake-script-file>
- cmake --build <dir> [<options>...] [-- <build-tool-options>...]
- cmake --open <dir>
- cmake -E <command> [<options>...]
- cmake --find-package <options>...
+ `Generate a Project Buildsystem`_
+ cmake [<options>] <path-to-source>
+ cmake [<options>] <path-to-existing-build>
+ cmake [<options>] -S <path-to-source> -B <path-to-build>
+
+ `Build a Project`_
+ cmake --build <dir> [<options>] [-- <build-tool-options>]
+
+ `Open a Project`_
+ cmake --open <dir>
+
+ `Run a Script`_
+ cmake [{-D <var>=<value>}...] -P <cmake-script-file>
+
+ `Run a Command-Line Tool`_
+ cmake -E <command> [<options>]
+
+ `Run the Find-Package Tool`_
+ cmake --find-package [<options>]
+
+ `View Help`_
+ cmake --help[-<topic>]
Description
===========
-The "cmake" executable is the CMake command-line interface. It may be
-used to configure projects in scripts. Project configuration settings
-may be specified on the command line with the -D option.
+The **cmake** executable is the command-line interface of the cross-platform
+buildsystem generator CMake. The above `Synopsis`_ lists various actions
+the tool can perform as described in sections below.
+
+To build a software project with CMake, `Generate a Project Buildsystem`_.
+Optionally use **cmake** to `Build a Project`_ or just run the
+corresponding build tool (e.g. ``make``) directly. **cmake** can also
+be used to `View Help`_.
+
+The other actions are meant for use by software developers writing
+scripts in the :manual:`CMake language <cmake-language(7)>` to support
+their builds.
+
+For graphical user interfaces that may be used in place of **cmake**,
+see :manual:`ccmake <ccmake(1)>` and :manual:`cmake-gui <cmake-gui(1)>`.
+For command-line interfaces to the CMake testing and packaging facilities,
+see :manual:`ctest <ctest(1)>` and :manual:`cpack <cpack(1)>`.
+
+For more information on CMake at large, `see also`_ the links at the end
+of this manual.
+
+
+Introduction to CMake Buildsystems
+==================================
+
+A *buildsystem* describes how to build a project's executables and libraries
+from its source code using a *build tool* to automate the process. For
+example, a buildsystem may be a ``Makefile`` for use with a command-line
+``make`` tool or a project file for an Integrated Development Environment
+(IDE). In order to avoid maintaining multiple such buildsystems, a project
+may specify its buildsystem abstractly using files written in the
+:manual:`CMake language <cmake-language(7)>`. From these files CMake
+generates a preferred buildsystem locally for each user through a backend
+called a *generator*.
+
+To generate a buildsystem with CMake, the following must be selected:
+
+Source Tree
+ The top-level directory containing source files provided by the project.
+ The project specifies its buildsystem using files as described in the
+ :manual:`cmake-language(7)` manual, starting with a top-level file named
+ ``CMakeLists.txt``. These files specify build targets and their
+ dependencies as described in the :manual:`cmake-buildsystem(7)` manual.
+
+Build Tree
+ The top-level directory in which buildsystem files and build output
+ artifacts (e.g. executables and libraries) are to be stored.
+ CMake will write a ``CMakeCache.txt`` file to identify the directory
+ as a build tree and store persistent information such as buildsystem
+ configuration options.
+
+ To maintain a pristine source tree, perform an *out-of-source* build
+ by using a separate dedicated build tree. An *in-source* build in
+ which the build tree is placed in the same directory as the source
+ tree is also supported, but discouraged.
+
+Generator
+ This chooses the kind of buildsystem to generate. See the
+ :manual:`cmake-generators(7)` manual for documentation of all generators.
+ Run ``cmake --help`` to see a list of generators available locally.
+ Optionally use the ``-G`` option below to specify a generator, or simply
+ accept the default CMake chooses for the current platform.
+
+ When using one of the :ref:`Command-Line Build Tool Generators`
+ CMake expects that the environment needed by the compiler toolchain
+ is already configured in the shell. When using one of the
+ :ref:`IDE Build Tool Generators`, no particular environment is needed.
+
-CMake is a cross-platform build system generator. Projects specify
-their build process with platform-independent CMake listfiles included
-in each directory of a source tree with the name CMakeLists.txt.
-Users build a project by using CMake to generate a build system for a
-native tool on their platform.
+Generate a Project Buildsystem
+==============================
+
+Run CMake with one of the following command signatures to specify the
+source and build trees and generate a buildsystem:
+
+``cmake [<options>] <path-to-source>``
+ Uses the current working directory as the build tree, and
+ ``<path-to-source>`` as the source tree. The specified path may
+ be absolute or relative to the current working directory.
+ The source tree must contain a ``CMakeLists.txt`` file and must
+ *not* contain a ``CMakeCache.txt`` file because the latter
+ identifies an existing build tree. For example:
+
+ .. code-block:: console
+
+ $ mkdir build ; cd build
+ $ cmake ../src
+
+``cmake [<options>] <path-to-existing-build>``
+ Uses ``<path-to-existing-build>`` as the build tree, and loads the
+ path to the source tree from its ``CMakeCache.txt`` file, which must
+ have already been generated by a previous run of CMake. The specified
+ path may be absolute or relative to the current working directory.
+ For example:
+
+ .. code-block:: console
+
+ $ cd build
+ $ cmake .
+
+``cmake [<options>] -S <path-to-source> -B <path-to-build>``
+ Uses ``<path-to-build>`` as the build tree and ``<path-to-source>``
+ as the source tree. The specified paths may be absolute or relative
+ to the current working directory. The source tree must contain a
+ ``CMakeLists.txt`` file. The build tree will be created automatically
+ if it does not already exist. For example:
+
+ .. code-block:: console
+
+ $ cmake -S src -B build
+
+In all cases the ``<options>`` may be zero or more of the `Options`_ below.
+
+After generating a buildsystem one may use the corresponding native
+build tool to build the project. For example, after using the
+:generator:`Unix Makefiles` generator one may run ``make`` directly:
+
+ .. code-block:: console
+
+ $ make
+ $ make install
+
+Alternatively, one may use **cmake** to `Build a Project`_ by
+automatically choosing and invoking the appropriate native build tool.
.. _`CMake Options`:
Options
-=======
+-------
.. include:: OPTIONS_BUILD.txt
-``-E <command> [<options>...]``
- See `Command-Line Tool Mode`_.
-
``-L[A][H]``
List non-advanced cached variables.
@@ -50,30 +177,12 @@ Options
display also advanced variables. If H is specified, it will also
display help for each variable.
-``--build <dir>``
- See `Build Tool Mode`_.
-
-``--open <dir>``
- Open the generated project in the associated application. This is
- only supported by some generators.
-
``-N``
View mode only.
Only load the cache. Do not actually run configure and generate
steps.
-``-P <file>``
- Process script mode.
-
- Process the given cmake file as a script written in the CMake
- language. No configure or generate step is performed and the cache
- is not modified. If variables are defined using -D, this must be
- done before the -P argument.
-
-``--find-package``
- See `Find-Package Tool Mode`_.
-
``--graphviz=[file]``
Generate graphviz of dependencies, see :module:`CMakeGraphVizOptions` for more.
@@ -142,17 +251,17 @@ Options
in CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR. This flag tells CMake to
warn about other files as well.
-.. include:: OPTIONS_HELP.txt
-
.. _`Build Tool Mode`:
-Build Tool Mode
+Build a Project
===============
CMake provides a command-line signature to build an already-generated
-project binary tree::
+project binary tree:
- cmake --build <dir> [<options>...] [-- <build-tool-options>...]
+.. code-block:: shell
+
+ cmake --build <dir> [<options>] [-- <build-tool-options>]
This abstracts a native build tool's command-line interface with the
following options:
@@ -180,17 +289,54 @@ following options:
``--use-stderr``
Ignored. Behavior is default in CMake >= 3.0.
+``-v, --verbose``
+ Enable verbose output - if supported - including the build commands to be
+ executed.
+
+ This option can be omitted if :envvar:`VERBOSE` environment variable or
+ :variable:`CMAKE_VERBOSE_MAKEFILE` cached variable is set.
+
+
``--``
Pass remaining options to the native tool.
Run ``cmake --build`` with no options for quick help.
-Command-Line Tool Mode
-======================
-CMake provides builtin command-line tools through the signature::
+Open a Project
+==============
+
+.. code-block:: shell
+
+ cmake --open <dir>
+
+Open the generated project in the associated application. This is only
+supported by some generators.
+
+
+.. _`Script Processing Mode`:
+
+Run a Script
+============
- cmake -E <command> [<options>...]
+.. code-block:: shell
+
+ cmake [{-D <var>=<value>}...] -P <cmake-script-file>
+
+Process the given cmake file as a script written in the CMake
+language. No configure or generate step is performed and the cache
+is not modified. If variables are defined using -D, this must be
+done before the -P argument.
+
+
+Run a Command-Line Tool
+=======================
+
+CMake provides builtin command-line tools through the signature
+
+.. code-block:: shell
+
+ cmake -E <command> [<options>]
Run ``cmake -E`` or ``cmake -E help`` for a summary of commands.
Available commands are:
@@ -235,9 +381,10 @@ Available commands are:
``chdir <dir> <cmd> [<arg>...]``
Change the current working directory and run a command.
-``compare_files <file1> <file2>``
+``compare_files [--ignore-eol] <file1> <file2>``
Check if ``<file1>`` is same as ``<file2>``. If files are the same,
- then returns 0, if not it returns 1.
+ then returns 0, if not it returns 1. The ``--ignore-eol`` option
+ implies line-wise comparison and ignores LF/CRLF differences.
``copy <file>... <destination>``
Copy files to ``<destination>`` (either file or directory).
@@ -326,7 +473,7 @@ Available commands are:
``sleep <number>...``
Sleep for given number of seconds.
-``tar [cxt][vf][zjJ] file.tar [<options>...] [--] [<file>...]``
+``tar [cxt][vf][zjJ] file.tar [<options>] [--] [<file>...]``
Create or extract a tar or zip archive. Options are:
``--``
@@ -379,24 +526,40 @@ The following ``cmake -E`` commands are available only on Windows:
``write_regv <key> <value>``
Write Windows registry value.
-Find-Package Tool Mode
-======================
-CMake provides a helper for Makefile-based projects with the signature::
+Run the Find-Package Tool
+=========================
- cmake --find-package <options>...
+CMake provides a pkg-config like helper for Makefile-based projects:
-This runs in a pkg-config like mode.
+.. code-block:: shell
-Search a package using :command:`find_package()` and print the resulting flags
-to stdout. This can be used to use cmake instead of pkg-config to find
-installed libraries in plain Makefile-based projects or in autoconf-based
-projects (via ``share/aclocal/cmake.m4``).
+ cmake --find-package [<options>]
+
+It searches a package using :command:`find_package()` and prints the
+resulting flags to stdout. This can be used instead of pkg-config
+to find installed libraries in plain Makefile-based projects or in
+autoconf-based projects (via ``share/aclocal/cmake.m4``).
.. note::
This mode is not well-supported due to some technical limitations.
It is kept for compatibility but should not be used in new projects.
+
+View Help
+=========
+
+To print selected pages from the CMake documentation, use
+
+.. code-block:: shell
+
+ cmake --help[-<topic>]
+
+with one of the following options:
+
+.. include:: OPTIONS_HELP.txt
+
+
See Also
========
diff --git a/Help/manual/cpack.1.rst b/Help/manual/cpack.1.rst
index 6159d7bee..679c5478e 100644
--- a/Help/manual/cpack.1.rst
+++ b/Help/manual/cpack.1.rst
@@ -13,12 +13,29 @@ Synopsis
Description
===========
-The ``cpack`` executable is the CMake packaging program.
-CMake projects use :command:`install` commands to define the contents of
-packages which can be generated in various formats by this tool.
-The :module:`CPack` module greatly simplifies the creation of the input file
-used by ``cpack``, allowing most aspects of the packaging configuration to be
-controlled directly from the CMake project's own ``CMakeLists.txt`` files.
+The **cpack** executable is the CMake packaging program. It generates
+installers and source packages in a variety of formats.
+
+For each installer or package format, **cpack** has a specific backend,
+called "generator". A generator is responsible for generating the required
+inputs and invoking the specific package creation tools. These installer
+or package generators are not to be confused with the makefile generators
+of the :manual:`cmake <cmake(1)>` command.
+
+All supported generators are specified in the :manual:`cpack-generators
+<cpack-generators(7)>` manual. The command ``cpack --help`` prints a
+list of generators supported for the target platform. Which of them are
+to be used can be selected through the :variable:`CPACK_GENERATOR` variable
+or through the command-line option ``-G``.
+
+The **cpack** program is steered by a configuration file written in the
+:manual:`CMake language <cmake-language(7)>`. Unless chosen differently
+through the command-line option ``--config``, the file ``CPackConfig.cmake``
+in the current directory is used.
+
+In the standard CMake workflow, the file ``CPackConfig.cmake`` is generated
+by the :manual:`cmake <cmake(1)>` executable, provided the :module:`CPack`
+module is included by the project's ``CMakeLists.txt`` file.
Options
=======
@@ -27,14 +44,9 @@ Options
``<generators>`` is a :ref:`semicolon-separated list <CMake Language Lists>`
of generator names. ``cpack`` will iterate through this list and produce
package(s) in that generator's format according to the details provided in
- the ``CPackConfig.cmake`` configuration file. A generator is responsible for
- generating the required inputs for a particular package system and invoking
- that system's package creation tools. All supported generators are specified
- in the :manual:`Generators <cpack-generators(7)>` section of the manual and
- the ``--help`` option lists the generators supported for the target platform.
-
- If this option is not given, the :variable:`CPACK_GENERATOR` variable
- determines the default set of generators that will be used.
+ the ``CPackConfig.cmake`` configuration file. If this option is not given,
+ the :variable:`CPACK_GENERATOR` variable determines the default set of
+ generators that will be used.
``-C <Configuration>``
Specify the project configuration to be packaged (e.g. ``Debug``,
diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst
index e24b10daf..d1bd69b66 100644
--- a/Help/manual/ctest.1.rst
+++ b/Help/manual/ctest.1.rst
@@ -11,15 +11,16 @@ Synopsis
.. parsed-literal::
ctest [<options>]
- ctest <path-to-source> <path-to-build> --build-generator <generator>
- [<options>...] [-- <build-options>...] [--test-command <test>]
+ ctest --build-and-test <path-to-source> <path-to-build>
+ --build-generator <generator> [<options>...]
+ [--build-options <opts>...] [--test-command <command> [<args>...]]
ctest {-D <dashboard> | -M <model> -T <action> | -S <script> | -SP <script>}
[-- <dashboard-options>...]
Description
===========
-The "ctest" executable is the CMake test driver program.
+The **ctest** executable is the CMake test driver program.
CMake-generated build trees created for projects that use the
ENABLE_TESTING and ADD_TEST commands have testing support. This
program will run the tests and report results.
@@ -38,7 +39,7 @@ Options
``--progress``
Enable short progress output from tests.
- When the output of ``ctest`` is being sent directly to a terminal, the
+ When the output of **ctest** is being sent directly to a terminal, the
progress through the set of tests is reported by updating the same line
rather than printing start and end messages for each test on new lines.
This can significantly reduce the verbosity of the test output.
@@ -109,13 +110,23 @@ Options
This option tells CTest to write all its output to a log file.
-``-N,--show-only``
+``-N,--show-only[=<format>]``
Disable actual execution of tests.
This option tells CTest to list the tests that would be run but not
actually run them. Useful in conjunction with the ``-R`` and ``-E``
options.
+ ``<format>`` can be one of the following values.
+
+ ``human``
+ Human-friendly output. This is not guaranteed to be stable.
+ This is the default.
+
+ ``json-v1``
+ Dump the test information in JSON format.
+ See `Show as JSON Object Model`_.
+
``-L <regex>, --label-regex <regex>``
Run tests with labels matching regular expression.
@@ -313,10 +324,11 @@ See `Build and Test Mode`_.
Do not use.
``--timeout <seconds>``
- Set a global timeout on all tests.
+ Set the default test timeout.
- This option will set a global timeout on all tests that do not
- already have a timeout set on them.
+ This option effectively sets a timeout on all tests that do not
+ already have a timeout set on them via the :prop_test:`TIMEOUT`
+ property.
``--stop-time <time>``
Set a time at which all tests should stop running.
@@ -1069,7 +1081,7 @@ Configuration settings include:
* :module:`CTest` module variable: ``BUILDNAME``
``CDashVersion``
- Specify the version of `CDash`_ on the server.
+ Legacy option. Not used.
* `CTest Script`_ variable: none, detected from server
* :module:`CTest` module variable: ``CTEST_CDASH_VERSION``
@@ -1098,55 +1110,58 @@ Configuration settings include:
* :module:`CTest` module variable: ``CTEST_CURL_OPTIONS``
``DropLocation``
- The path on the dashboard server to send the submission.
+ Legacy option. When ``SubmitURL`` is not set, it is constructed from
+ ``DropMethod``, ``DropSiteUser``, ``DropSitePassword``, ``DropSite``, and
+ ``DropLocation``.
* `CTest Script`_ variable: :variable:`CTEST_DROP_LOCATION`
* :module:`CTest` module variable: ``DROP_LOCATION`` if set,
else ``CTEST_DROP_LOCATION``
``DropMethod``
- Specify the method by which results should be submitted to the
- dashboard server. The value may be ``cp``, ``ftp``, ``http``,
- ``https``, ``scp``, or ``xmlrpc`` (if CMake was built with
- support for it).
+ Legacy option. When ``SubmitURL`` is not set, it is constructed from
+ ``DropMethod``, ``DropSiteUser``, ``DropSitePassword``, ``DropSite``, and
+ ``DropLocation``.
* `CTest Script`_ variable: :variable:`CTEST_DROP_METHOD`
* :module:`CTest` module variable: ``DROP_METHOD`` if set,
else ``CTEST_DROP_METHOD``
``DropSite``
- The dashboard server name
- (for ``ftp``, ``http``, and ``https``, ``scp``, and ``xmlrpc``).
+ Legacy option. When ``SubmitURL`` is not set, it is constructed from
+ ``DropMethod``, ``DropSiteUser``, ``DropSitePassword``, ``DropSite``, and
+ ``DropLocation``.
* `CTest Script`_ variable: :variable:`CTEST_DROP_SITE`
* :module:`CTest` module variable: ``DROP_SITE`` if set,
else ``CTEST_DROP_SITE``
``DropSitePassword``
- The dashboard server login password, if any
- (for ``ftp``, ``http``, and ``https``).
+ Legacy option. When ``SubmitURL`` is not set, it is constructed from
+ ``DropMethod``, ``DropSiteUser``, ``DropSitePassword``, ``DropSite``, and
+ ``DropLocation``.
* `CTest Script`_ variable: :variable:`CTEST_DROP_SITE_PASSWORD`
* :module:`CTest` module variable: ``DROP_SITE_PASSWORD`` if set,
else ``CTEST_DROP_SITE_PASWORD``
``DropSiteUser``
- The dashboard server login user name, if any
- (for ``ftp``, ``http``, and ``https``).
+ Legacy option. When ``SubmitURL`` is not set, it is constructed from
+ ``DropMethod``, ``DropSiteUser``, ``DropSitePassword``, ``DropSite``, and
+ ``DropLocation``.
* `CTest Script`_ variable: :variable:`CTEST_DROP_SITE_USER`
* :module:`CTest` module variable: ``DROP_SITE_USER`` if set,
else ``CTEST_DROP_SITE_USER``
``IsCDash``
- Specify whether the dashboard server is `CDash`_ or an older
- dashboard server implementation requiring ``TriggerSite``.
+ Legacy option. Not used.
* `CTest Script`_ variable: :variable:`CTEST_DROP_SITE_CDASH`
* :module:`CTest` module variable: ``CTEST_DROP_SITE_CDASH``
``ScpCommand``
- ``scp`` command-line tool to use when ``DropMethod`` is ``scp``.
+ Legacy option. Not used.
* `CTest Script`_ variable: :variable:`CTEST_SCP_COMMAND`
* :module:`CTest` module variable: ``SCPCOMMAND``
@@ -1159,14 +1174,80 @@ Configuration settings include:
* :module:`CTest` module variable: ``SITE``,
initialized by the :command:`site_name` command
+``SubmitURL``
+ The ``http`` or ``https`` URL of the dashboard server to send the submission
+ to.
+
+ * `CTest Script`_ variable: :variable:`CTEST_SUBMIT_URL`
+ * :module:`CTest` module variable: ``SUBMIT_URL`` if set,
+ else ``CTEST_SUBMIT_URL``
+
``TriggerSite``
- Legacy option to support older dashboard server implementations.
- Not used when ``IsCDash`` is true.
+ Legacy option. Not used.
* `CTest Script`_ variable: :variable:`CTEST_TRIGGER_SITE`
* :module:`CTest` module variable: ``TRIGGER_SITE`` if set,
else ``CTEST_TRIGGER_SITE``
+.. _`Show as JSON Object Model`:
+
+Show as JSON Object Model
+=========================
+
+When the ``--show-only=json-v1`` command line option is given, the test
+information is output in JSON format. Version 1.0 of the JSON object
+model is defined as follows:
+
+``kind``
+ The string "ctestInfo".
+
+``version``
+ A JSON object specifying the version components. Its members are
+
+ ``major``
+ A non-negative integer specifying the major version component.
+ ``minor``
+ A non-negative integer specifying the minor version component.
+
+``backtraceGraph``
+ JSON object representing backtrace information with the
+ following members:
+
+ ``commands``
+ List of command names.
+ ``files``
+ List of file names.
+ ``nodes``
+ List of node JSON objects with members:
+
+ ``command``
+ Index into the ``commands`` member of the ``backtraceGraph``.
+ ``file``
+ Index into the ``files`` member of the ``backtraceGraph``.
+ ``line``
+ Line number in the file where the backtrace was added.
+ ``parent``
+ Index into the ``nodes`` member of the ``backtraceGraph``
+ representing the parent in the graph.
+
+``tests``
+ A JSON array listing information about each test. Each entry
+ is a JSON object with members:
+
+ ``name``
+ Test name.
+ ``config``
+ Configuration that the test can run on.
+ Empty string means any config.
+ ``command``
+ List where the first element is the test command and the
+ remaining elements are the command arguments.
+ ``backtrace``
+ Index into the ``nodes`` member of the ``backtraceGraph``.
+ ``properties``
+ Test properties.
+ Can contain keys for each of the supported test properties.
+
See Also
========
diff --git a/Help/module/CheckFortranSourceRuns.rst b/Help/module/CheckFortranSourceRuns.rst
new file mode 100644
index 000000000..a1bff7063
--- /dev/null
+++ b/Help/module/CheckFortranSourceRuns.rst
@@ -0,0 +1 @@
+.. cmake-module:: ../../Modules/CheckFortranSourceRuns.cmake
diff --git a/Help/module/CheckPIESupported.rst b/Help/module/CheckPIESupported.rst
new file mode 100644
index 000000000..02e7b4316
--- /dev/null
+++ b/Help/module/CheckPIESupported.rst
@@ -0,0 +1 @@
+.. cmake-module:: ../../Modules/CheckPIESupported.cmake
diff --git a/Help/module/FindFontconfig.rst b/Help/module/FindFontconfig.rst
new file mode 100644
index 000000000..449fe09d0
--- /dev/null
+++ b/Help/module/FindFontconfig.rst
@@ -0,0 +1 @@
+.. cmake-module:: ../../Modules/FindFontconfig.cmake
diff --git a/Help/module/FindLibinput.rst b/Help/module/FindLibinput.rst
new file mode 100644
index 000000000..a8ca0b024
--- /dev/null
+++ b/Help/module/FindLibinput.rst
@@ -0,0 +1 @@
+.. cmake-module:: ../../Modules/FindLibinput.cmake
diff --git a/Help/module/FindSQLite3.rst b/Help/module/FindSQLite3.rst
new file mode 100644
index 000000000..d1910e5a6
--- /dev/null
+++ b/Help/module/FindSQLite3.rst
@@ -0,0 +1 @@
+.. cmake-module:: ../../Modules/FindSQLite3.cmake
diff --git a/Help/policy/CMP0049.rst b/Help/policy/CMP0049.rst
index a3ce4b1fa..291bf5752 100644
--- a/Help/policy/CMP0049.rst
+++ b/Help/policy/CMP0049.rst
@@ -3,14 +3,14 @@ CMP0049
Do not expand variables in target source entries.
-CMake 2.8.12 and lower performed and extra layer of variable expansion
-when evaluating source file names:
-
-.. code-block:: cmake
+CMake 2.8.12 and lower performed an extra layer of variable expansion
+when evaluating source file names::
set(a_source foo.c)
add_executable(foo \${a_source})
+.. note: no cmake highlighting since this syntax is deprecated
+
This was undocumented behavior.
The OLD behavior for this policy is to expand such variables when processing
diff --git a/Help/policy/CMP0078.rst b/Help/policy/CMP0078.rst
index 54cdc9cc7..2e97934f4 100644
--- a/Help/policy/CMP0078.rst
+++ b/Help/policy/CMP0078.rst
@@ -1,6 +1,8 @@
CMP0078
-------
+:module:`UseSWIG` generates standard target names.
+
Starting with CMake 3.13, :module:`UseSWIG` generates now standard target
names. This policy provides compatibility with projects that expect the legacy
behavior.
diff --git a/Help/policy/CMP0082.rst b/Help/policy/CMP0082.rst
new file mode 100644
index 000000000..8256444c8
--- /dev/null
+++ b/Help/policy/CMP0082.rst
@@ -0,0 +1,26 @@
+CMP0082
+-------
+
+Install rules from :command:`add_subdirectory` calls are interleaved with
+those in caller.
+
+CMake 3.13 and lower ran the install rules from :command:`add_subdirectory`
+after all other install rules, even if :command:`add_subdirectory` was called
+before the other install rules. CMake 3.14 and above prefer to interleave
+these :command:`add_subdirectory` install rules with the others so that
+they are run in the order they are declared. This policy provides
+compatibility for projects that have not been updated to expect the
+new behavior.
+
+The ``OLD`` behavior for this policy is to run the install rules from
+:command:`add_subdirectory` after the other install rules. The ``NEW``
+behavior for this policy is to run all install rules in the order they are
+declared.
+
+This policy was introduced in CMake version 3.14. Unlike most policies,
+CMake version |release| does *not* warn by default when this policy
+is not set and simply uses OLD behavior. See documentation of the
+:variable:`CMAKE_POLICY_WARNING_CMP0082 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
+variable to control the warning.
+
+.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0083.rst b/Help/policy/CMP0083.rst
new file mode 100644
index 000000000..32acf1f12
--- /dev/null
+++ b/Help/policy/CMP0083.rst
@@ -0,0 +1,63 @@
+CMP0083
+-------
+
+To control generation of Position Independent Executable (``PIE``) or not, some
+flags are required at link time.
+
+CMake 3.13 and lower did not add these link flags when
+:prop_tgt:`POSITION_INDEPENDENT_CODE` is set.
+
+The ``OLD`` behavior for this policy is to not manage ``PIE`` link flags. The
+``NEW`` behavior is to add link flags if :prop_tgt:`POSITION_INDEPENDENT_CODE`
+is set:
+
+* Set to ``TRUE``: flags to produce a position independent executable are
+ passed to the linker step. For example ``-pie`` for ``GCC``.
+* Set to ``FALSE``: flags not to produce a position independent executable are
+ passed to the linker step. For example ``-no-pie`` for ``GCC``.
+* Not set: no flags are passed to the linker step.
+
+Since a given linker may not support ``PIE`` flags in all environments in
+which it is used, it is the project's responsibility to use the
+:module:`CheckPIESupported` module to check for support to ensure that the
+:prop_tgt:`POSITION_INDEPENDENT_CODE` target property for executables will be
+honored at link time.
+
+This policy was introduced in CMake version 3.14. Use the
+:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+Unlike most policies, CMake version |release| does not warn when this policy is
+not set and simply uses ``OLD`` behavior.
+
+.. include:: DEPRECATED.txt
+
+Examples
+^^^^^^^^
+
+Behave like CMake 3.13 and do not apply any ``PIE`` flags at link stage.
+
+.. code-block:: cmake
+
+ cmake_minimum_required(VERSION 3.13)
+ project(foo)
+
+ # ...
+
+ add_executable(foo ...)
+ set_property(TARGET foo PROPERTY POSITION_INDEPENDENT_CODE TRUE)
+
+Use the :module:`CheckPIESupported` module to detect whether ``PIE`` is
+supported by the current linker and environment. Apply ``PIE`` flags only
+if the linker supports them.
+
+.. code-block:: cmake
+
+ cmake_minimum_required(VERSION 3.14) # CMP0083 NEW
+ project(foo)
+
+ include(CheckPIESupported)
+ check_pie_supported()
+
+ # ...
+
+ add_executable(foo ...)
+ set_property(TARGET foo PROPERTY POSITION_INDEPENDENT_CODE TRUE)
diff --git a/Help/policy/CMP0084.rst b/Help/policy/CMP0084.rst
new file mode 100644
index 000000000..713d295f8
--- /dev/null
+++ b/Help/policy/CMP0084.rst
@@ -0,0 +1,26 @@
+CMP0084
+-------
+
+The :module:`FindQt` module does not exist for :command:`find_package`.
+
+The existence of :module:`FindQt` means that for Qt upstream to provide
+package config files that can be found by ``find_package(Qt)``, the consuming
+project has to explicitly specify ``find_package(Qt CONFIG)``. Removing this
+module gives Qt a path forward for exporting its own config files which can
+easily be found by consuming projects.
+
+This policy pretends that CMake's internal :module:`FindQt` module does not
+exist for :command:`find_package`. If a project really wants to use Qt 3 or 4,
+it can call ``find_package(Qt[34])``, ``include(FindQt)``, or add
+:module:`FindQt` to their :variable:`CMAKE_MODULE_PATH`.
+
+The ``OLD`` behavior of this policy is for :module:`FindQt` to exist for
+:command:`find_package`. The ``NEW`` behavior is to pretend that it doesn't
+exist for :command:`find_package`.
+
+This policy was introduced in CMake version 3.14. 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/CMP0085.rst b/Help/policy/CMP0085.rst
new file mode 100644
index 000000000..d9ec9a207
--- /dev/null
+++ b/Help/policy/CMP0085.rst
@@ -0,0 +1,21 @@
+CMP0085
+-------
+
+``$<IN_LIST:...>`` handles empty list items.
+
+In CMake 3.13 and lower, the ``$<IN_LIST:...>`` generator expression always
+returned ``0`` if the first argument was empty, even if the list contained an
+empty item. This behavior is inconsistent with the ``IN_LIST`` behavior of
+:command:`if`, which this generator expression is meant to emulate. CMake 3.14
+and later handles this case correctly.
+
+The ``OLD`` behavior of this policy is for ``$<IN_LIST:...>`` to always return
+``0`` if the first argument is empty. The ``NEW`` behavior is to return ``1``
+if the first argument is empty and the list contains an empty item.
+
+This policy was introduced in CMake version 3.14. 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/CMP0086.rst b/Help/policy/CMP0086.rst
new file mode 100644
index 000000000..4a9e8b80a
--- /dev/null
+++ b/Help/policy/CMP0086.rst
@@ -0,0 +1,20 @@
+CMP0086
+-------
+
+:module:`UseSWIG` honors ``SWIG_MODULE_NAME`` via ``-module`` flag.
+
+Starting with CMake 3.14, :module:`UseSWIG` passes option
+``-module <module_name>`` to ``SWIG`` compiler if the file property
+``SWIG_MODULE_NAME`` is specified. This policy provides compatibility with
+projects that expect the legacy behavior.
+
+The ``OLD`` behavior for this policy is to never pass ``-module`` option.
+The ``NEW`` behavior is to pass ``-module`` option to ``SWIG`` compiler if
+``SWIG_MODULE_NAME`` is specified.
+
+This policy was introduced in CMake version 3.14. 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/CMP0087.rst b/Help/policy/CMP0087.rst
new file mode 100644
index 000000000..4c45b99e4
--- /dev/null
+++ b/Help/policy/CMP0087.rst
@@ -0,0 +1,29 @@
+CMP0087
+-------
+
+:command:`install(CODE)` and :command:`install(SCRIPT)` support generator
+expressions.
+
+In CMake 3.13 and earlier, :command:`install(CODE)` and
+:command:`install(SCRIPT)` did not evaluate generator expressions. CMake 3.14
+and later will evaluate generator expressions for :command:`install(CODE)` and
+:command:`install(SCRIPT)`.
+
+The ``OLD`` behavior of this policy is for :command:`install(CODE)` and
+:command:`install(SCRIPT)` to not evaluate generator expressions. The ``NEW``
+behavior is to evaluate generator expressions for :command:`install(CODE)` and
+:command:`install(SCRIPT)`.
+
+Note that it is the value of this policy setting at the end of the directory
+scope that is important, not its setting at the time of the call to
+:command:`install(CODE)` or :command:`install(SCRIPT)`. This has implications
+for calling these commands from places that have their own policy scope but not
+their own directory scope (e.g. from files brought in via :command:`include()`
+rather than :command:`add_subdirectory()`).
+
+This policy was introduced in CMake version 3.14. 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/CMP0088.rst b/Help/policy/CMP0088.rst
new file mode 100644
index 000000000..82c04ef7b
--- /dev/null
+++ b/Help/policy/CMP0088.rst
@@ -0,0 +1,29 @@
+CMP0088
+-------
+
+:module:`FindBISON` runs bison in :variable:`CMAKE_CURRENT_BINARY_DIR`
+when executing.
+
+The module provides a ``BISON_TARGET`` macro which generates BISON output.
+In CMake 3.13 and below the macro would generate a custom command that runs
+``bison`` in the source directory. CMake 3.14 and later prefer to run it
+in the build directory and use :variable:`CMAKE_CURRENT_BINARY_DIR` as the
+``WORKING_DIRECTORY`` of its :command:`add_custom_command` invocation.
+This ensures that any implicitly generated file is written to the build
+tree rather than the source.
+
+This policy provides compatibility for projects that have not been updated
+to expect the new behavior.
+
+The ``OLD`` behavior for this policy is for ``BISON_TARGET`` to use
+the current source directory for the ``WORKING_DIRECTORY`` and where
+to generate implicit files. The ``NEW`` behavior of this policy is to
+use the current binary directory for the ``WORKING_DIRECTORY`` and where
+to generate implicit files.
+
+This policy was introduced in CMake version 3.14. Use the
+:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+Unlike most policies, CMake version |release| does *not* warn
+when this policy is not set and simply uses ``OLD`` behavior.
+
+.. include:: DEPRECATED.txt
diff --git a/Help/prop_dir/BUILDSYSTEM_TARGETS.rst b/Help/prop_dir/BUILDSYSTEM_TARGETS.rst
index da907cb93..04bb56ec1 100644
--- a/Help/prop_dir/BUILDSYSTEM_TARGETS.rst
+++ b/Help/prop_dir/BUILDSYSTEM_TARGETS.rst
@@ -2,7 +2,7 @@ BUILDSYSTEM_TARGETS
-------------------
This read-only directory property contains a
-:ref:`;-list <CMake Language Lists>` of buildsystem targets added in the
+:ref:`semicolon-separated list <CMake Language Lists>` of buildsystem targets added in the
directory by calls to the :command:`add_library`, :command:`add_executable`,
and :command:`add_custom_target` commands. The list does not include any
:ref:`Imported Targets` or :ref:`Alias Targets`, but does include
diff --git a/Help/prop_dir/COMPILE_OPTIONS.rst b/Help/prop_dir/COMPILE_OPTIONS.rst
index 877deb000..48e8b9b8d 100644
--- a/Help/prop_dir/COMPILE_OPTIONS.rst
+++ b/Help/prop_dir/COMPILE_OPTIONS.rst
@@ -3,7 +3,7 @@ COMPILE_OPTIONS
List of options to pass to the compiler.
-This property holds a :ref:`;-list <CMake Language Lists>` of options
+This property holds a :ref:`semicolon-separated list <CMake Language Lists>` of options
given so far to the :command:`add_compile_options` command.
This property is used to initialize the :prop_tgt:`COMPILE_OPTIONS` target
diff --git a/Help/prop_dir/EXCLUDE_FROM_ALL.rst b/Help/prop_dir/EXCLUDE_FROM_ALL.rst
index 1aa24e44b..9d3192c1b 100644
--- a/Help/prop_dir/EXCLUDE_FROM_ALL.rst
+++ b/Help/prop_dir/EXCLUDE_FROM_ALL.rst
@@ -7,3 +7,9 @@ A property on a directory that indicates if its targets are excluded
from the default build target. If it is not, then with a Makefile for
example typing make will cause the targets to be built. The same
concept applies to the default build of other generators.
+
+Targets inherit the :prop_tgt:`EXCLUDE_FROM_ALL` property from the directory
+that they are created in. When a directory is excluded, all of its targets will
+have :prop_tgt:`EXCLUDE_FROM_ALL` set to ``TRUE``. After creating such a target
+you can change its :prop_tgt:`EXCLUDE_FROM_ALL` property to ``FALSE``. This
+will cause the target to be included in the default build target.
diff --git a/Help/prop_dir/LINK_DIRECTORIES.rst b/Help/prop_dir/LINK_DIRECTORIES.rst
index f9fb81535..44dc2304e 100644
--- a/Help/prop_dir/LINK_DIRECTORIES.rst
+++ b/Help/prop_dir/LINK_DIRECTORIES.rst
@@ -3,7 +3,7 @@ LINK_DIRECTORIES
List of linker search directories.
-This property holds a :ref:`;-list <CMake Language Lists>` of directories
+This property holds a :ref:`semicolon-separated list <CMake Language Lists>` of directories
and is typically populated using the :command:`link_directories` command.
It gets its initial value from its parent directory, if it has one.
diff --git a/Help/prop_dir/LINK_OPTIONS.rst b/Help/prop_dir/LINK_OPTIONS.rst
index 15c555fda..54ac6ddaa 100644
--- a/Help/prop_dir/LINK_OPTIONS.rst
+++ b/Help/prop_dir/LINK_OPTIONS.rst
@@ -4,7 +4,7 @@ LINK_OPTIONS
List of options to use for the link step of shared library, module
and executable targets.
-This property holds a :ref:`;-list <CMake Language Lists>` of options
+This property holds a :ref:`semicolon-separated list <CMake Language Lists>` of options
given so far to the :command:`add_link_options` command.
This property is used to initialize the :prop_tgt:`LINK_OPTIONS` target
diff --git a/Help/prop_dir/SUBDIRECTORIES.rst b/Help/prop_dir/SUBDIRECTORIES.rst
index 2c2ea773e..6a0ac80d8 100644
--- a/Help/prop_dir/SUBDIRECTORIES.rst
+++ b/Help/prop_dir/SUBDIRECTORIES.rst
@@ -2,7 +2,7 @@ SUBDIRECTORIES
--------------
This read-only directory property contains a
-:ref:`;-list <CMake Language Lists>` of subdirectories processed so far by
+:ref:`semicolon-separated list <CMake Language Lists>` of subdirectories processed so far by
the :command:`add_subdirectory` or :command:`subdirs` commands. Each entry is
the absolute path to the source directory (containing the ``CMakeLists.txt``
file). This is suitable to pass to the :command:`get_property` command
diff --git a/Help/prop_dir/TESTS.rst b/Help/prop_dir/TESTS.rst
index 91acd3e7e..56e230eb7 100644
--- a/Help/prop_dir/TESTS.rst
+++ b/Help/prop_dir/TESTS.rst
@@ -3,5 +3,5 @@ TESTS
List of tests.
-This read-only property holds a :ref:`;-list <CMake Language Lists>` of tests
+This read-only property holds a :ref:`semicolon-separated list <CMake Language Lists>` of tests
defined so far, in the current directory, by the :command:`add_test` command.
diff --git a/Help/prop_gbl/CMAKE_ROLE.rst b/Help/prop_gbl/CMAKE_ROLE.rst
new file mode 100644
index 000000000..27512fada
--- /dev/null
+++ b/Help/prop_gbl/CMAKE_ROLE.rst
@@ -0,0 +1,20 @@
+CMAKE_ROLE
+----------
+
+Tells what mode the current running script is in. Could be one of several
+values:
+
+``PROJECT``
+ Running in project mode (processing a ``CMakeLists.txt`` file).
+
+``SCRIPT``
+ Running in ``-P`` script mode.
+
+``FIND_PACKAGE``
+ Running in ``--find-package`` mode.
+
+``CTEST``
+ Running in CTest script mode.
+
+``CPACK``
+ Running in CPack.
diff --git a/Help/prop_sf/COMPILE_OPTIONS.rst b/Help/prop_sf/COMPILE_OPTIONS.rst
index 3b2bc8da2..7e48271d0 100644
--- a/Help/prop_sf/COMPILE_OPTIONS.rst
+++ b/Help/prop_sf/COMPILE_OPTIONS.rst
@@ -3,7 +3,7 @@ COMPILE_OPTIONS
List of additional options to pass to the compiler.
-This property holds a :ref:`;-list <CMake Language Lists>` of options
+This property holds a :ref:`semicolon-separated list <CMake Language Lists>` of options
and will be added to the list of compile flags when this
source file builds. Use :prop_sf:`COMPILE_DEFINITIONS` to pass
additional preprocessor definitions and :prop_sf:`INCLUDE_DIRECTORIES` to pass
diff --git a/Help/prop_sf/INCLUDE_DIRECTORIES.rst b/Help/prop_sf/INCLUDE_DIRECTORIES.rst
index 55780e560..23de70e16 100644
--- a/Help/prop_sf/INCLUDE_DIRECTORIES.rst
+++ b/Help/prop_sf/INCLUDE_DIRECTORIES.rst
@@ -3,7 +3,7 @@ INCLUDE_DIRECTORIES
List of preprocessor include file search directories.
-This property holds a :ref:`;-list <CMake Language Lists>` of paths
+This property holds a :ref:`semicolon-separated list <CMake Language Lists>` of paths
and will be added to the list of include directories when this
source file builds. These directories will take precedence over directories
defined at target level except for :generator:`Xcode` generator due to technical
diff --git a/Help/prop_sf/OBJECT_DEPENDS.rst b/Help/prop_sf/OBJECT_DEPENDS.rst
index 1d24960b5..aaff95659 100644
--- a/Help/prop_sf/OBJECT_DEPENDS.rst
+++ b/Help/prop_sf/OBJECT_DEPENDS.rst
@@ -3,7 +3,7 @@ OBJECT_DEPENDS
Additional files on which a compiled object file depends.
-Specifies a :ref:`;-list <CMake Language Lists>` of full-paths to
+Specifies a :ref:`semicolon-separated list <CMake Language Lists>` of full-paths to
files on which any object files compiled from this source file depend.
On :ref:`Makefile Generators` and the :generator:`Ninja` generator an
object file will be recompiled if any of the named files is newer than it.
diff --git a/Help/prop_tgt/ANDROID_NATIVE_LIB_DIRECTORIES.rst b/Help/prop_tgt/ANDROID_NATIVE_LIB_DIRECTORIES.rst
index bc673804d..d0cd29de8 100644
--- a/Help/prop_tgt/ANDROID_NATIVE_LIB_DIRECTORIES.rst
+++ b/Help/prop_tgt/ANDROID_NATIVE_LIB_DIRECTORIES.rst
@@ -1,8 +1,8 @@
ANDROID_NATIVE_LIB_DIRECTORIES
------------------------------
-Set the Android property that specifies directories to search for the
-.so libraries.
+Set the Android property that specifies directories to search for the ``.so``
+libraries.
This a string property that contains the directory paths separated
by semicolons.
diff --git a/Help/prop_tgt/AUTOGEN_ORIGIN_DEPENDS.rst b/Help/prop_tgt/AUTOGEN_ORIGIN_DEPENDS.rst
new file mode 100644
index 000000000..022bab502
--- /dev/null
+++ b/Help/prop_tgt/AUTOGEN_ORIGIN_DEPENDS.rst
@@ -0,0 +1,38 @@
+AUTOGEN_ORIGIN_DEPENDS
+----------------------
+
+Switch for forwarding origin target dependencies to the corresponding
+``_autogen`` target.
+
+Targets which have their :prop_tgt:`AUTOMOC` or :prop_tgt:`AUTOUIC` property
+``ON`` have a corresponding ``_autogen`` target which generates
+``moc`` and ``uic`` files. As this ``_autogen`` target is created at
+generate-time, it is not possible to define dependencies of it using
+e.g. :command:`add_dependencies`. Instead the
+:prop_tgt:`AUTOGEN_ORIGIN_DEPENDS` target property decides whether the origin
+target dependencies should be forwarded to the ``_autogen`` target or not.
+
+By default :prop_tgt:`AUTOGEN_ORIGIN_DEPENDS` is initialized from
+:variable:`CMAKE_AUTOGEN_ORIGIN_DEPENDS` which is ``ON`` by default.
+
+In total the dependencies of the ``_autogen`` target are composed from
+
+- forwarded origin target dependencies
+ (enabled by default via :prop_tgt:`AUTOGEN_ORIGIN_DEPENDS`)
+- additional user defined dependencies from :prop_tgt:`AUTOGEN_TARGET_DEPENDS`
+
+See the :manual:`cmake-qt(7)` manual for more information on using CMake
+with Qt.
+
+Note
+^^^^
+
+Disabling :prop_tgt:`AUTOGEN_ORIGIN_DEPENDS` is useful to avoid building of
+origin target dependencies when building the ``_autogen`` target only.
+This is especially interesting when a
+:variable:`global autogen target <CMAKE_GLOBAL_AUTOGEN_TARGET>` is enabled.
+
+When the ``_autogen`` target doesn't require all the origin target's
+dependencies, and :prop_tgt:`AUTOGEN_ORIGIN_DEPENDS` is disabled, it might be
+necessary to extend :prop_tgt:`AUTOGEN_TARGET_DEPENDS` to add missing
+dependencies.
diff --git a/Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst b/Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst
index 7d3dfd1b7..d5c5e147d 100644
--- a/Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst
+++ b/Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst
@@ -1,17 +1,22 @@
AUTOGEN_TARGET_DEPENDS
----------------------
-Target dependencies of the corresponding ``_autogen`` target.
+Additional target dependencies of the corresponding ``_autogen`` target.
Targets which have their :prop_tgt:`AUTOMOC` or :prop_tgt:`AUTOUIC` property
-``ON`` have a corresponding ``_autogen`` target which is used to auto generate
+``ON`` have a corresponding ``_autogen`` target which generates
``moc`` and ``uic`` files. As this ``_autogen`` target is created at
-generate-time, it is not possible to define dependencies of it,
-such as to create inputs for the ``moc`` or ``uic`` executable.
+generate-time, it is not possible to define dependencies of it using
+e.g. :command:`add_dependencies`. Instead the
+:prop_tgt:`AUTOGEN_TARGET_DEPENDS` target property can be set to a
+:ref:`;-list <CMake Language Lists>` of additional dependencies for the
+``_autogen`` target. Dependencies can be target names or file names.
-The :prop_tgt:`AUTOGEN_TARGET_DEPENDS` target property can be set instead to a
-list of dependencies of the ``_autogen`` target. Dependencies can be target
-names or file names.
+In total the dependencies of the ``_autogen`` target are composed from
+
+- forwarded origin target dependencies
+ (enabled by default via :prop_tgt:`AUTOGEN_ORIGIN_DEPENDS`)
+- additional user defined dependencies from :prop_tgt:`AUTOGEN_TARGET_DEPENDS`
See the :manual:`cmake-qt(7)` manual for more information on using CMake
with Qt.
@@ -26,6 +31,6 @@ If :prop_tgt:`AUTOMOC` or :prop_tgt:`AUTOUIC` depends on a file that is either
- a :prop_sf:`GENERATED` C++ file that isn't recognized by :prop_tgt:`AUTOMOC`
and :prop_tgt:`AUTOUIC` because it's skipped by :prop_sf:`SKIP_AUTOMOC`,
:prop_sf:`SKIP_AUTOUIC`, :prop_sf:`SKIP_AUTOGEN` or :policy:`CMP0071` or
-- a file that isn't in the target's sources
+- a file that isn't in the origin target's sources
it must added to :prop_tgt:`AUTOGEN_TARGET_DEPENDS`.
diff --git a/Help/prop_tgt/AUTOMOC.rst b/Help/prop_tgt/AUTOMOC.rst
index 3bd693a19..3e6d5602d 100644
--- a/Help/prop_tgt/AUTOMOC.rst
+++ b/Help/prop_tgt/AUTOMOC.rst
@@ -3,8 +3,8 @@ AUTOMOC
Should the target be processed with automoc (for Qt projects).
-AUTOMOC is a boolean specifying whether CMake will handle the Qt ``moc``
-preprocessor automatically, i.e. without having to use the
+:prop_tgt:`AUTOMOC` is a boolean specifying whether CMake will handle the Qt
+``moc`` preprocessor automatically, i.e. without having to use the
:module:`QT4_WRAP_CPP() <FindQt4>` or QT5_WRAP_CPP() macro.
Currently Qt4 and Qt5 are supported.
@@ -58,6 +58,9 @@ source files at build time and invoke moc accordingly.
This property is initialized by the value of the :variable:`CMAKE_AUTOMOC`
variable if it is set when a target is created.
+The ``moc`` executable will be detected automatically, but can be forced to
+a certain binary using the :prop_tgt:`AUTOMOC_EXECUTABLE` property.
+
Additional command line options for ``moc`` can be set via the
:prop_tgt:`AUTOMOC_MOC_OPTIONS` property.
@@ -86,5 +89,9 @@ enabling :prop_sf:`SKIP_AUTOMOC` or the broader :prop_sf:`SKIP_AUTOGEN`.
The number of parallel ``moc`` processes to start can be modified by
setting :prop_tgt:`AUTOGEN_PARALLEL`.
+A global ``autogen`` target that depends on all :prop_tgt:`AUTOMOC` generated
+``<ORIGIN>_autogen`` targets in the project can be generated by enabling
+:variable:`CMAKE_GLOBAL_AUTOGEN_TARGET`.
+
See the :manual:`cmake-qt(7)` manual for more information on using CMake
with Qt.
diff --git a/Help/prop_tgt/AUTOMOC_EXECUTABLE.rst b/Help/prop_tgt/AUTOMOC_EXECUTABLE.rst
new file mode 100644
index 000000000..6b66ce81f
--- /dev/null
+++ b/Help/prop_tgt/AUTOMOC_EXECUTABLE.rst
@@ -0,0 +1,15 @@
+AUTOMOC_EXECUTABLE
+------------------
+
+:prop_tgt:`AUTOMOC_EXECUTABLE` is file path pointing to the ``moc``
+executable to use for :prop_tgt:`AUTOMOC` enabled files. Setting
+this property will make CMake skip the automatic detection of the
+``moc`` binary as well as the sanity-tests normally run to ensure
+that the binary is available and working as expected.
+
+Usually this property does not need to be set. Only consider this
+property if auto-detection of ``moc`` can not work -- e.g. because
+you are building the ``moc`` binary as part of your project.
+
+See the :manual:`cmake-qt(7)` manual for more information on using CMake
+with Qt.
diff --git a/Help/prop_tgt/AUTOMOC_MACRO_NAMES.rst b/Help/prop_tgt/AUTOMOC_MACRO_NAMES.rst
index a9a0ecf1e..5329bbac9 100644
--- a/Help/prop_tgt/AUTOMOC_MACRO_NAMES.rst
+++ b/Help/prop_tgt/AUTOMOC_MACRO_NAMES.rst
@@ -1,7 +1,7 @@
AUTOMOC_MACRO_NAMES
-------------------
-A :ref:`;-list <CMake Language Lists>` list of macro names used by
+A :ref:`semicolon-separated list <CMake Language Lists>` list of macro names used by
:prop_tgt:`AUTOMOC` to determine if a C++ file needs to be processed by ``moc``.
This property is only used if the :prop_tgt:`AUTOMOC` property is ``ON``
diff --git a/Help/prop_tgt/AUTORCC.rst b/Help/prop_tgt/AUTORCC.rst
index 3cc5990ac..5db6ed02e 100644
--- a/Help/prop_tgt/AUTORCC.rst
+++ b/Help/prop_tgt/AUTORCC.rst
@@ -3,7 +3,7 @@ AUTORCC
Should the target be processed with autorcc (for Qt projects).
-``AUTORCC`` is a boolean specifying whether CMake will handle
+:prop_tgt:`AUTORCC` is a boolean specifying whether CMake will handle
the Qt ``rcc`` code generator automatically, i.e. without having to use
the :module:`QT4_ADD_RESOURCES() <FindQt4>` or ``QT5_ADD_RESOURCES()``
macro. Currently Qt4 and Qt5 are supported.
@@ -21,6 +21,9 @@ If the ``.qrc`` file is :prop_sf:`GENERATED` though, a
Additional command line options for rcc can be set via the
:prop_sf:`AUTORCC_OPTIONS` source file property on the ``.qrc`` file.
+The ``rcc`` executable will be detected automatically, but can be forced to
+a certain binary using the :prop_tgt:`AUTORCC_EXECUTABLE` property.
+
The global property :prop_gbl:`AUTOGEN_TARGETS_FOLDER` can be used to group
the autorcc targets together in an IDE, e.g. in MSVS.
@@ -35,5 +38,9 @@ generate unspecified unique names for ``rcc``. Therefore if
Source files can be excluded from :prop_tgt:`AUTORCC` processing by
enabling :prop_sf:`SKIP_AUTORCC` or the broader :prop_sf:`SKIP_AUTOGEN`.
+A global ``autorcc`` target that depends on all :prop_tgt:`AUTORCC` targets
+in the project can be generated by enabling
+:variable:`CMAKE_GLOBAL_AUTORCC_TARGET`.
+
See the :manual:`cmake-qt(7)` manual for more information on using CMake
with Qt.
diff --git a/Help/prop_tgt/AUTORCC_EXECUTABLE.rst b/Help/prop_tgt/AUTORCC_EXECUTABLE.rst
new file mode 100644
index 000000000..ca0fbd75b
--- /dev/null
+++ b/Help/prop_tgt/AUTORCC_EXECUTABLE.rst
@@ -0,0 +1,15 @@
+AUTORCC_EXECUTABLE
+------------------
+
+:prop_tgt:`AUTORCC_EXECUTABLE` is file path pointing to the ``rcc``
+executable to use for :prop_tgt:`AUTORCC` enabled files. Setting
+this property will make CMake skip the automatic detection of the
+``rcc`` binary as well as the sanity-tests normally run to ensure
+that the binary is available and working as expected.
+
+Usually this property does not need to be set. Only consider this
+property if auto-detection of ``rcc`` can not work -- e.g. because
+you are building the ``rcc`` binary as part of your project.
+
+See the :manual:`cmake-qt(7)` manual for more information on using CMake
+with Qt.
diff --git a/Help/prop_tgt/AUTOUIC.rst b/Help/prop_tgt/AUTOUIC.rst
index 4fc603fa6..85226c15f 100644
--- a/Help/prop_tgt/AUTOUIC.rst
+++ b/Help/prop_tgt/AUTOUIC.rst
@@ -3,7 +3,7 @@ AUTOUIC
Should the target be processed with autouic (for Qt projects).
-``AUTOUIC`` is a boolean specifying whether CMake will handle
+:prop_tgt:`AUTOUIC` is a boolean specifying whether CMake will handle
the Qt ``uic`` code generator automatically, i.e. without having to use
the :module:`QT4_WRAP_UI() <FindQt4>` or ``QT5_WRAP_UI()`` macro. Currently
Qt4 and Qt5 are supported.
@@ -30,11 +30,18 @@ Additional command line options for ``uic`` can be set via the
The global property :prop_gbl:`AUTOGEN_TARGETS_FOLDER` can be used to group the
autouic targets together in an IDE, e.g. in MSVS.
+The ``uic`` executable will be detected automatically, but can be forced to
+a certain binary using the :prop_tgt:`AUTOUIC_EXECUTABLE` property.
+
Source files can be excluded from :prop_tgt:`AUTOUIC` processing by
enabling :prop_sf:`SKIP_AUTOUIC` or the broader :prop_sf:`SKIP_AUTOGEN`.
The number of parallel ``uic`` processes to start can be modified by
setting :prop_tgt:`AUTOGEN_PARALLEL`.
+A global ``autogen`` target that depends on all :prop_tgt:`AUTOUIC` generated
+``<ORIGIN>_autogen`` targets in the project can be generated by enabling
+:variable:`CMAKE_GLOBAL_AUTOGEN_TARGET`.
+
See the :manual:`cmake-qt(7)` manual for more information on using CMake
with Qt.
diff --git a/Help/prop_tgt/AUTOUIC_EXECUTABLE.rst b/Help/prop_tgt/AUTOUIC_EXECUTABLE.rst
new file mode 100644
index 000000000..03bd55499
--- /dev/null
+++ b/Help/prop_tgt/AUTOUIC_EXECUTABLE.rst
@@ -0,0 +1,15 @@
+AUTOUIC_EXECUTABLE
+------------------
+
+:prop_tgt:`AUTOUIC_EXECUTABLE` is file path pointing to the ``uic``
+executable to use for :prop_tgt:`AUTOUIC` enabled files. Setting
+this property will make CMake skip the automatic detection of the
+``uic`` binary as well as the sanity-tests normally run to ensure
+that the binary is available and working as expected.
+
+Usually this property does not need to be set. Only consider this
+property if auto-detection of ``uic`` can not work -- e.g. because
+you are building the ``uic`` binary as part of your project.
+
+See the :manual:`cmake-qt(7)` manual for more information on using CMake
+with Qt.
diff --git a/Help/prop_tgt/BUILD_RPATH.rst b/Help/prop_tgt/BUILD_RPATH.rst
index 27393f5d7..13c9c1de8 100644
--- a/Help/prop_tgt/BUILD_RPATH.rst
+++ b/Help/prop_tgt/BUILD_RPATH.rst
@@ -1,7 +1,7 @@
BUILD_RPATH
-----------
-A :ref:`;-list <CMake Language Lists>` specifying runtime path (``RPATH``)
+A :ref:`semicolon-separated list <CMake Language Lists>` specifying runtime path (``RPATH``)
entries to add to binaries linked in the build tree (for platforms that
support it). The entries will *not* be used for binaries in the install
tree. See also the :prop_tgt:`INSTALL_RPATH` target property.
diff --git a/Help/prop_tgt/BUILD_RPATH_USE_ORIGIN.rst b/Help/prop_tgt/BUILD_RPATH_USE_ORIGIN.rst
new file mode 100644
index 000000000..337879780
--- /dev/null
+++ b/Help/prop_tgt/BUILD_RPATH_USE_ORIGIN.rst
@@ -0,0 +1,24 @@
+BUILD_RPATH_USE_ORIGIN
+----------------------
+
+Whether to use relative paths for the build ``RPATH``.
+
+This property is initialized by the value of the variable
+:variable:`CMAKE_BUILD_RPATH_USE_ORIGIN`.
+
+On platforms that support runtime paths (``RPATH``) with the
+``$ORIGIN`` token, setting this property to ``TRUE`` enables relative
+paths in the build ``RPATH`` for executables and shared libraries that
+point to shared libraries in the same build tree.
+
+Normally the build ``RPATH`` of a binary contains absolute paths
+to the directory of each shared library it links to. The ``RPATH``
+entries for directories contained within the build tree can be made
+relative to enable relocatable builds and to help achieve reproducible
+builds by omitting the build directory from the build environment.
+
+This property has no effect on platforms that do not support the
+``$ORIGIN`` token in ``RPATH``, or when the :variable:`CMAKE_SKIP_RPATH`
+variable is set. The runtime path set through the
+:prop_tgt:`BUILD_RPATH` target property is also unaffected by this
+property.
diff --git a/Help/prop_tgt/COMPILE_OPTIONS.rst b/Help/prop_tgt/COMPILE_OPTIONS.rst
index 892ac23e1..0cd683610 100644
--- a/Help/prop_tgt/COMPILE_OPTIONS.rst
+++ b/Help/prop_tgt/COMPILE_OPTIONS.rst
@@ -3,7 +3,7 @@ COMPILE_OPTIONS
List of options to pass to the compiler.
-This property holds a :ref:`;-list <CMake Language Lists>` of options
+This property holds a :ref:`semicolon-separated list <CMake Language Lists>` of options
specified so far for its target. Use the :command:`target_compile_options`
command to append more options.
diff --git a/Help/prop_tgt/CUDA_RESOLVE_DEVICE_SYMBOLS.rst b/Help/prop_tgt/CUDA_RESOLVE_DEVICE_SYMBOLS.rst
index 127d79fb3..ef74ae26f 100644
--- a/Help/prop_tgt/CUDA_RESOLVE_DEVICE_SYMBOLS.rst
+++ b/Help/prop_tgt/CUDA_RESOLVE_DEVICE_SYMBOLS.rst
@@ -1,12 +1,18 @@
CUDA_RESOLVE_DEVICE_SYMBOLS
---------------------------
-CUDA only: Enables device linking for the specific static library target
+CUDA only: Enables device linking for the specific library target
-If set this will enable device linking on this static library target. Normally
+If set this will enable device linking on the library target. Normally
device linking is deferred until a shared library or executable is generated,
allowing for multiple static libraries to resolve device symbols at the same
-time.
+time when they are used by a shared library or executable.
+
+By default static library targets have this property is disabled,
+while shared, module, and executable targets have this property enabled.
+
+Note that device linking is not supported for :ref:`Object Libraries`.
+
For instance:
diff --git a/Help/prop_tgt/EXCLUDE_FROM_ALL.rst b/Help/prop_tgt/EXCLUDE_FROM_ALL.rst
index caa5741f8..0eee29792 100644
--- a/Help/prop_tgt/EXCLUDE_FROM_ALL.rst
+++ b/Help/prop_tgt/EXCLUDE_FROM_ALL.rst
@@ -6,5 +6,16 @@ Exclude the target from the all target.
A property on a target that indicates if the target is excluded from
the default build target. If it is not, then with a Makefile for
example typing make will cause this target to be built. The same
-concept applies to the default build of other generators. Installing
-a target with EXCLUDE_FROM_ALL set to true has undefined behavior.
+concept applies to the default build of other generators.
+
+With ``EXCLUDE_FROM_ALL`` set to false or not set at all, the target
+will be brought up to date as part of doing a ``make install`` or its
+equivalent for the CMake generator being used. If a target has
+``EXCLUDE_FROM_ALL`` set to true, then any attempt to install that
+target has undefined behavior. Note that such a target can still safely
+be listed in an :command:`install(TARGETS)` command as long as the install
+components the target belongs to are not part of the set of components
+that anything tries to install.
+
+This property is enabled by default for targets that are created in
+directories that have :prop_dir:`EXCLUDE_FROM_ALL` set to ``TRUE``.
diff --git a/Help/prop_tgt/GHS_INTEGRITY_APP.rst b/Help/prop_tgt/GHS_INTEGRITY_APP.rst
new file mode 100644
index 000000000..764303850
--- /dev/null
+++ b/Help/prop_tgt/GHS_INTEGRITY_APP.rst
@@ -0,0 +1,10 @@
+GHS_INTEGRITY_APP
+-----------------
+
+``ON`` / ``OFF`` boolean to determine if an executable target should
+be treated as an `Integrity Application`.
+
+If no value is set and if a `.int` file is added as a source file to the
+executable target it will be treated as an `Integrity Application`.
+
+Supported on :generator:`Green Hills MULTI`.
diff --git a/Help/prop_tgt/GHS_NO_SOURCE_GROUP_FILE.rst b/Help/prop_tgt/GHS_NO_SOURCE_GROUP_FILE.rst
new file mode 100644
index 000000000..11ce0b223
--- /dev/null
+++ b/Help/prop_tgt/GHS_NO_SOURCE_GROUP_FILE.rst
@@ -0,0 +1,13 @@
+GHS_NO_SOURCE_GROUP_FILE
+------------------------
+
+``ON`` / ``OFF`` boolean to control if the project file for a target should
+be one single file or multiple files.
+
+The default behavior or when the property is ``OFF`` is to generate a project
+file for the target and then a sub-project file for each source group.
+
+When this property is ``ON`` or if :variable:`CMAKE_GHS_NO_SOURCE_GROUP_FILE`
+is ``ON`` then only a single project file is generated for the target.
+
+Supported on :generator:`Green Hills MULTI`.
diff --git a/Help/prop_tgt/IMPORTED_OBJECTS.rst b/Help/prop_tgt/IMPORTED_OBJECTS.rst
index 222e6cc02..50a329fb3 100644
--- a/Help/prop_tgt/IMPORTED_OBJECTS.rst
+++ b/Help/prop_tgt/IMPORTED_OBJECTS.rst
@@ -1,7 +1,7 @@
IMPORTED_OBJECTS
----------------
-:ref:`;-list <CMake Language Lists>` of absolute paths to the object
+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>`.
diff --git a/Help/prop_tgt/INTERFACE_POSITION_INDEPENDENT_CODE.rst b/Help/prop_tgt/INTERFACE_POSITION_INDEPENDENT_CODE.rst
index ea700dfe9..4336d7182 100644
--- a/Help/prop_tgt/INTERFACE_POSITION_INDEPENDENT_CODE.rst
+++ b/Help/prop_tgt/INTERFACE_POSITION_INDEPENDENT_CODE.rst
@@ -14,3 +14,9 @@ undefined, then consumers will determine their
:prop_tgt:`POSITION_INDEPENDENT_CODE` property by other means. Consumers
must ensure that the targets that they link to have a consistent
requirement for their ``INTERFACE_POSITION_INDEPENDENT_CODE`` property.
+
+Contents of ``INTERFACE_POSITION_INDEPENDENT_CODE`` 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.
diff --git a/Help/prop_tgt/LANG_CLANG_TIDY.rst b/Help/prop_tgt/LANG_CLANG_TIDY.rst
index 2887e235d..2bfef6673 100644
--- a/Help/prop_tgt/LANG_CLANG_TIDY.rst
+++ b/Help/prop_tgt/LANG_CLANG_TIDY.rst
@@ -3,7 +3,7 @@
This property is implemented only when ``<LANG>`` is ``C`` or ``CXX``.
-Specify a :ref:`;-list <CMake Language Lists>` containing a command
+Specify a :ref:`semicolon-separated list <CMake Language Lists>` containing a command
line for the ``clang-tidy`` tool. The :ref:`Makefile Generators`
and the :generator:`Ninja` generator will run this tool along with the
compiler and report a warning if the tool reports any problems.
diff --git a/Help/prop_tgt/LANG_COMPILER_LAUNCHER.rst b/Help/prop_tgt/LANG_COMPILER_LAUNCHER.rst
index b63d6d78a..23af503af 100644
--- a/Help/prop_tgt/LANG_COMPILER_LAUNCHER.rst
+++ b/Help/prop_tgt/LANG_COMPILER_LAUNCHER.rst
@@ -4,7 +4,7 @@
This property is implemented only when ``<LANG>`` is ``C``, ``CXX``,
``Fortran``, or ``CUDA``.
-Specify a :ref:`;-list <CMake Language Lists>` containing a command line
+Specify a :ref:`semicolon-separated list <CMake Language Lists>` containing a command line
for a compiler launching tool. The :ref:`Makefile Generators` and the
:generator:`Ninja` generator will run this tool and pass the compiler and
its arguments to the tool. Some example tools are distcc and ccache.
diff --git a/Help/prop_tgt/LANG_CPPCHECK.rst b/Help/prop_tgt/LANG_CPPCHECK.rst
index 5f8be00f1..60785d062 100644
--- a/Help/prop_tgt/LANG_CPPCHECK.rst
+++ b/Help/prop_tgt/LANG_CPPCHECK.rst
@@ -3,10 +3,12 @@
This property is supported only when ``<LANG>`` is ``C`` or ``CXX``.
-Specify a :ref:`;-list <CMake Language Lists>` containing a command line
+Specify a :ref:`semicolon-separated list <CMake Language Lists>` containing a command line
for the ``cppcheck`` static analysis tool. The :ref:`Makefile Generators`
and the :generator:`Ninja` generator will run ``cppcheck`` along with the
-compiler and report any problems.
+compiler and report any problems. If the command-line specifies the
+exit code options to ``cppcheck`` then the build will fail if the
+tool returns non-zero.
This property is initialized by the value of the
:variable:`CMAKE_<LANG>_CPPCHECK` variable if it is set when a target is
diff --git a/Help/prop_tgt/LANG_CPPLINT.rst b/Help/prop_tgt/LANG_CPPLINT.rst
index 14f47d465..9944c88ba 100644
--- a/Help/prop_tgt/LANG_CPPLINT.rst
+++ b/Help/prop_tgt/LANG_CPPLINT.rst
@@ -3,7 +3,7 @@
This property is supported only when ``<LANG>`` is ``C`` or ``CXX``.
-Specify a :ref:`;-list <CMake Language Lists>` containing a command line
+Specify a :ref:`semicolon-separated list <CMake Language Lists>` containing a command line
for the ``cpplint`` style checker. The :ref:`Makefile Generators` and the
:generator:`Ninja` generator will run ``cpplint`` along with the compiler
and report any problems.
diff --git a/Help/prop_tgt/LANG_INCLUDE_WHAT_YOU_USE.rst b/Help/prop_tgt/LANG_INCLUDE_WHAT_YOU_USE.rst
index 26f6d1671..35220e414 100644
--- a/Help/prop_tgt/LANG_INCLUDE_WHAT_YOU_USE.rst
+++ b/Help/prop_tgt/LANG_INCLUDE_WHAT_YOU_USE.rst
@@ -3,7 +3,7 @@
This property is implemented only when ``<LANG>`` is ``C`` or ``CXX``.
-Specify a :ref:`;-list <CMake Language Lists>` containing a command
+Specify a :ref:`semicolon-separated list <CMake Language Lists>` containing a command
line for the ``include-what-you-use`` tool. The :ref:`Makefile Generators`
and the :generator:`Ninja` generator will run this tool along with the
compiler and report a warning if the tool reports any problems.
diff --git a/Help/prop_tgt/LINK_DIRECTORIES.rst b/Help/prop_tgt/LINK_DIRECTORIES.rst
index 085a70119..c2905b37d 100644
--- a/Help/prop_tgt/LINK_DIRECTORIES.rst
+++ b/Help/prop_tgt/LINK_DIRECTORIES.rst
@@ -4,7 +4,7 @@ LINK_DIRECTORIES
List of directories to use for the link step of shared library, module
and executable targets.
-This property holds a :ref:`;-list <CMake Language Lists>` of directories
+This property holds a :ref:`semicolon-separated list <CMake Language Lists>` of directories
specified so far for its target. Use the :command:`target_link_directories`
command to append more search directories.
diff --git a/Help/prop_tgt/LINK_OPTIONS.rst b/Help/prop_tgt/LINK_OPTIONS.rst
index bd5e9370b..2a05ea75a 100644
--- a/Help/prop_tgt/LINK_OPTIONS.rst
+++ b/Help/prop_tgt/LINK_OPTIONS.rst
@@ -6,7 +6,7 @@ and executable targets. Targets that are static libraries need to use
the :prop_tgt:`STATIC_LIBRARY_OPTIONS` target property.
-This property holds a :ref:`;-list <CMake Language Lists>` of options
+This property holds a :ref:`semicolon-separated list <CMake Language Lists>` of options
specified so far for its target. Use the :command:`target_link_options`
command to append more options.
diff --git a/Help/prop_tgt/POSITION_INDEPENDENT_CODE.rst b/Help/prop_tgt/POSITION_INDEPENDENT_CODE.rst
index 54af8c6de..0aaf66bd0 100644
--- a/Help/prop_tgt/POSITION_INDEPENDENT_CODE.rst
+++ b/Help/prop_tgt/POSITION_INDEPENDENT_CODE.rst
@@ -9,3 +9,8 @@ property is ``True`` by default for ``SHARED`` and ``MODULE`` library
targets and ``False`` otherwise. This property is initialized by the value
of the :variable:`CMAKE_POSITION_INDEPENDENT_CODE` variable if it is set
when a target is created.
+
+.. note::
+
+ For executable targets, the link step is controlled by the :policy:`CMP0083`
+ policy and the :module:`CheckPIESupported` module.
diff --git a/Help/prop_tgt/STATIC_LIBRARY_OPTIONS.rst b/Help/prop_tgt/STATIC_LIBRARY_OPTIONS.rst
index 6e0318594..d05fda4aa 100644
--- a/Help/prop_tgt/STATIC_LIBRARY_OPTIONS.rst
+++ b/Help/prop_tgt/STATIC_LIBRARY_OPTIONS.rst
@@ -5,7 +5,7 @@ Archiver (or MSVC librarian) flags for a static library target.
Targets that are shared libraries, modules, or executables need to use
the :prop_tgt:`LINK_OPTIONS` target property.
-This property holds a :ref:`;-list <CMake Language Lists>` of options
+This property holds a :ref:`semicolon-separated list <CMake Language Lists>` of options
specified so far for its target. Use :command:`set_target_properties` or
:command:`set_property` commands to set its content.
diff --git a/Help/prop_tgt/VS_SDK_REFERENCES.rst b/Help/prop_tgt/VS_SDK_REFERENCES.rst
index 769a0d1d5..99987f561 100644
--- a/Help/prop_tgt/VS_SDK_REFERENCES.rst
+++ b/Help/prop_tgt/VS_SDK_REFERENCES.rst
@@ -2,6 +2,6 @@ VS_SDK_REFERENCES
-----------------
Visual Studio project SDK references.
-Specify a :ref:`;-list <CMake Language Lists>` of SDK references
+Specify a :ref:`semicolon-separated list <CMake Language Lists>` of SDK references
to be added to a generated Visual Studio project, e.g.
``Microsoft.AdMediatorWindows81, Version=1.0``.
diff --git a/Help/prop_tgt/WIN32_EXECUTABLE.rst b/Help/prop_tgt/WIN32_EXECUTABLE.rst
index 336d5f7f3..060d16671 100644
--- a/Help/prop_tgt/WIN32_EXECUTABLE.rst
+++ b/Help/prop_tgt/WIN32_EXECUTABLE.rst
@@ -5,8 +5,9 @@ Build an executable with a WinMain entry point on windows.
When this property is set to true the executable when linked on
Windows will be created with a WinMain() entry point instead of just
-main(). This makes it a GUI executable instead of a console
-application. See the CMAKE_MFC_FLAG variable documentation to
-configure use of MFC for WinMain executables. This property is
-initialized by the value of the variable CMAKE_WIN32_EXECUTABLE if it
-is set when a target is created.
+main(). This makes it a GUI executable instead of a console application.
+See the :variable:`CMAKE_MFC_FLAG` variable documentation to
+configure use of the Microsoft Foundation Classes (MFC) for WinMain
+executables. This property is initialized by the value of the
+:variable:`CMAKE_WIN32_EXECUTABLE` variable if it is set when
+a target is created.
diff --git a/Help/release/3.13.rst b/Help/release/3.13.rst
index a8dd0baf7..1c58550ff 100644
--- a/Help/release/3.13.rst
+++ b/Help/release/3.13.rst
@@ -278,12 +278,3 @@ Changes made since CMake 3.13.0 include the following.
relying on the old behavior can be trivially fixed by specifying
the path to the source tree (even if just ``.``) explicitly and
continue to work with all versions of CMake.
-
-3.13.5
-------
-
-* In CMake 3.13.0 through 3.13.4, calling :command:`target_link_libraries`
- to add ``PRIVATE`` dependencies to a static library created in another
- directory (under policy :policy:`CMP0079` ``NEW`` behavior) would
- incorrectly propagate usage requirements of those dependencies to
- dependents that link the static library. This has been fixed.
diff --git a/Help/release/3.14.rst b/Help/release/3.14.rst
new file mode 100644
index 000000000..f2a91c614
--- /dev/null
+++ b/Help/release/3.14.rst
@@ -0,0 +1,393 @@
+CMake 3.14 Release Notes
+************************
+
+.. only:: html
+
+ .. contents::
+
+Changes made since CMake 3.13 include the following.
+
+New Features
+============
+
+Generators
+----------
+
+* The :generator:`Visual Studio 16 2019` generator was added. This is
+ experimental and based on "Visual Studio 2019 Preview 4" because this
+ version of VS has not been released.
+
+ The VS 2019 generator differs from generators for earlier versions
+ in that it does not provide variants that specify the target platform
+ in the generator name. Instead :variable:`CMAKE_GENERATOR_PLATFORM`
+ must be used, e.g. through the ``-A`` command-line option. Furthermore,
+ the default target platform (architecture) is now based on the *host*
+ platform. The VS host toolset selection is now based on the host
+ architecture as well.
+
+* The :generator:`Green Hills MULTI` generator has been updated:
+
+ * Now supports :ref:`Object Libraries`.
+
+ * Now warns on unsupported project types such as shared libraries.
+
+ * Now generates a top-level ``<PROJECT-NAME>.top.gpj`` for each directory
+ calling the :command:`project` command. The top-level project file
+ ``default.gpj`` is no longer created.
+
+ * Now honors target renaming and destination output control properties
+ such as :prop_tgt:`RUNTIME_OUTPUT_DIRECTORY` and :prop_tgt:`OUTPUT_NAME`.
+ This also fixes support for installation rules generated by
+ :command:`install`.
+
+ * Now honors source file properties :prop_sf:`INCLUDE_DIRECTORIES`,
+ :prop_sf:`COMPILE_DEFINITIONS`, and :prop_sf:`COMPILE_OPTIONS`.
+
+ * Now supports Dynamic Download Integrity Applications which did not include
+ Integrate Files via :prop_tgt:`GHS_INTEGRITY_APP` and setting a target
+ link flag of ``-dynamic``.
+
+ * The contents of project files now sorts sources groups and files by name.
+ Set the :prop_tgt:`GHS_NO_SOURCE_GROUP_FILE` target property to ``ON`` to
+ generate a single project file for the target instead of a project file for
+ each source group. Set the :variable:`CMAKE_GHS_NO_SOURCE_GROUP_FILE`
+ variable to enable this for all targets.
+
+File-Based API
+--------------
+
+* A file-based api for clients to get semantic buildsystem information
+ has been added. See the :manual:`cmake-file-api(7)` manual.
+ This is intended to replace the :manual:`cmake-server(7)` mode for IDEs.
+
+Platforms
+---------
+
+* CMake now supports :ref:`Cross Compiling for iOS, tvOS, or watchOS`
+ using simple toolchain files.
+
+Command-Line
+------------
+
+* The :manual:`cmake(1)` :ref:`Build Tool Mode <Build Tool Mode>`
+ (``cmake --build``) gained ``--verbose`` and ``-v`` options to
+ specify verbose build output. Some generators such as Xcode don't
+ support this option currently.
+
+* The :manual:`cmake(1)` ``-E compare_files`` command learned a new
+ ``--ignore-eol`` option to specify that end-of-line differences
+ (e.g. LF vs CRLF) should be ignored when comparing files.
+
+* The :manual:`cmake-gui(1)` dialog gained new ``-S`` and ``-B`` arguments to
+ explicitly specify source and build directories.
+
+Commands
+--------
+
+* The :command:`file` command learned a new sub-command, ``CREATE_LINK``,
+ which can be used to create hard or symbolic links.
+
+* The :command:`file` command learned a new sub-command, ``READ_SYMLINK``,
+ which can be used to determine the path that a symlink points to.
+
+* The :command:`file` command gained a ``SIZE`` mode to get the size
+ of a file on disk.
+
+* The :command:`find_package` command learned to optionally resolve
+ symbolic links in the paths to package configuration files.
+ See the :variable:`CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS` variable.
+
+* The :command:`get_filename_component` command gained new
+ ``LAST_EXT`` and ``NAME_WLE`` variants to work with the
+ extension after the last ``.`` in the name.
+
+* The :command:`if` command gained support for checking if cache variables
+ are defined with the ``DEFINED CACHE{VAR}`` syntax.
+
+* The :command:`install(CODE)` and :command:`install(SCRIPT)` commands
+ learned to support generator expressions. See policy :policy:`CMP0087`.
+
+* The :command:`install(TARGETS)` command learned how to install to an
+ appropriate default directory for a given target type, based on
+ variables from the :module:`GNUInstallDirs` module and built-in defaults,
+ in lieu of a ``DESTINATION`` argument.
+
+* The :command:`install(FILES)` and :command:`install(DIRECTORY)` commands
+ learned a new set of parameters for installing files as a file type,
+ setting the destination based on the appropriate variables from
+ :module:`GNUInstallDirs` and built-in defaults, in lieu of a
+ ``DESTINATION`` argument.
+
+* The :command:`list` operations ``REMOVE_ITEM``, ``REMOVE_DUPLICATES``,
+ ``SORT``, ``REVERSE``, and ``FILTER`` all now accept a non-existent variable
+ as the list since these operations on empty lists is also the empty list.
+
+* The :command:`list` operation ``REMOVE_AT`` now indicates that the given
+ indices are invalid for a non-existent variable or empty list.
+
+* The :command:`try_compile` and :command:`try_run` commands gained a new
+ ``LINK_OPTIONS`` option.
+
+Variables
+---------
+
+* A :variable:`CMAKE_BUILD_RPATH_USE_ORIGIN` variable and corresponding
+ :prop_tgt:`BUILD_RPATH_USE_ORIGIN` target property were added to
+ enable use of relative runtime paths (RPATHs). This helps achieving
+ relocatable and reproducible builds that are invariant of the build
+ directory.
+
+Properties
+----------
+
+* A :prop_gbl:`CMAKE_ROLE` global property was added to allow scripts to
+ determine whether they're running in project mode, script mode,
+ find-package mode, CTest, or CPack.
+
+* The :prop_tgt:`CUDA_RESOLVE_DEVICE_SYMBOLS` target property is now supported
+ on shared library, module library, and executable targets. Previously it was
+ only honored on static libraries.
+
+* The :prop_tgt:`EXCLUDE_FROM_ALL` target property was created to override
+ the setting of its directory. A target will now be built as part of "all"
+ if its :prop_tgt:`EXCLUDE_FROM_ALL` property is set to ``OFF``, even if its
+ containing directory is marked as :prop_dir:`EXCLUDE_FROM_ALL`.
+
+* :prop_tgt:`INTERFACE_POSITION_INDEPENDENT_CODE` target property gains the
+ support of :manual:`generator expressions <cmake-generator-expressions(7)>`.
+
+Modules
+-------
+
+* The family of modules to check capabilities (like
+ :module:`CheckCSourceCompiles`) gain capability to manage ``LINK_OPTIONS``.
+
+* A :module:`CheckFortranSourceRuns` module was added to provide a
+ :command:`check_fortran_source_runs` command to check if a Fortran
+ source snippet compiles and runs.
+
+* The :module:`CMakePackageConfigHelpers` module's
+ :command:`write_basic_package_version_file` command gained a new
+ ``ARCH_INDEPENDENT`` option for supporting architecture-independent
+ packages.
+
+* The :module:`ExternalProject` module :command:`ExternalProject_Add` command
+ gained ``LOG_DIR`` and ``LOG_MERGED_STDOUTERR`` options to control logging.
+
+* The :module:`ExternalProject` module :command:`ExternalProject_Add` command
+ gained ``LOG_PATCH`` to optionally log the patch step.
+
+* The :module:`ExternalProject` module :command:`ExternalProject_Add` command
+ learned to apply ``SOURCE_SUBDIR`` when ``BUILD_IN_SOURCE`` is also used.
+ The ``BUILD_COMMAND`` is run in the given ``SOURCE_SUBDIR`` of the
+ ``SOURCE_DIR``.
+
+* The :module:`FetchContent` module gained a new
+ :command:`FetchContent_MakeAvailable` command. It accepts a list of
+ dependency names, which it then iterates over, populating and adding
+ each one to the main build using the canonical pattern. This
+ significantly reduces the amount of boilerplate needed in a project.
+
+* The :module:`FindBISON` module's ``BISON_TARGET`` command now runs ``bison``
+ with :variable:`CMAKE_CURRENT_BINARY_DIR` as the working directory.
+ See policy :policy:`CMP0088`.
+
+* The :module:`FindCURL` module gained support for requesting
+ protocols as package components.
+
+* The :module:`FindFontconfig` module was added to find `fontconfig`_.
+
+* The :module:`FindGDAL` module now provides imported targets.
+
+* The :module:`FindGIF` module now provides imported targets.
+
+* The :module:`FindGit` module now provides an imported target for the
+ Git executable.
+
+* The :module:`FindIce` module learned to find ``slice2confluence``
+ and ``slice2matlab``.
+
+* The :module:`FindLibinput` module was added to find `libinput`_.
+
+* The :module:`FindLibLZMA` module now provides imported targets.
+
+* The :module:`FindMatlab` module gained new options ``R2017b`` and
+ ``R2018a`` to specify the MEX API version to use; these options
+ mirror the new options to the ``mex`` command in MATLAB R2018a.
+ The option ``MX_LIBRARY`` is no longer needed.
+
+* The :module:`FindPostgreSQL` module now provides imported targets.
+
+* The :module:`FindPython`, :module:`FindPython2`, and :module:`FindPython3`
+ modules gained support for ``NumPy`` component.
+
+* The :module:`FindPython2`, :module:`FindPython3`, and :module:`FindPython`
+ modules now support running in script mode by skipping the creation of
+ imported targets and helper functions.
+
+* The :module:`FindSQLite3` module was added to find the SQLite v3.x library.
+
+* The :module:`FindX11` had the following variables renamed in order to match
+ their library names rather than header names. The old variables are provided
+ for compatibility:
+
+ - ``X11_Xxf86misc_INCLUDE_PATH`` instead of ``X11_xf86misc_INCLUDE_PATH``
+ - ``X11_Xxf86misc_LIB`` instead of ``X11_xf86misc_LIB``
+ - ``X11_Xxf86misc_FOUND`` instead of ``X11_xf86misc_FOUND``
+ - ``X11_Xxf86vm_INCLUDE_PATH`` instead of ``X11_xf86vmode_INCLUDE_PATH``
+ - ``X11_Xxf86vm_LIB`` instead of ``X11_xf86vmode_LIB``
+ - ``X11_Xxf86vm_FOUND`` instead of ``X11_xf86vmode_FOUND``
+ - ``X11_xkbfile_INCLUDE_PATH`` instead of ``X11_Xkbfile_INCLUDE_PATH``
+ - ``X11_xkbfile_LIB`` instead of ``X11_Xkbfile_LIB``
+ - ``X11_xkbfile_FOUND`` instead of ``X11_Xkbfile_FOUND``
+ - ``X11_Xtst_INCLUDE_PATH`` instead of ``X11_XTest_INCLUDE_PATH``
+ - ``X11_Xtst_LIB`` instead of ``X11_XTest_LIB``
+ - ``X11_Xtst_FOUND`` instead of ``X11_XTest_FOUND``
+ - ``X11_Xss_INCLUDE_PATH`` instead of ``X11_Xscreensaver_INCLUDE_PATH``
+ - ``X11_Xss_LIB`` instead of ``X11_Xscreensaver_LIB``
+ - ``X11_Xss_FOUND`` instead of ``X11_Xscreensaver_FOUND``
+
+ The following variables are deprecated completely since they were
+ essentially duplicates:
+
+ - ``X11_Xinput_INCLUDE_PATH`` (use ``X11_Xi_INCLUDE_PATH``)
+ - ``X11_Xinput_LIB`` (use ``X11_Xi_LIB``)
+ - ``X11_Xinput_FOUND`` (use ``X11_Xi_FOUND``)
+
+* The :module:`FindX11` now provides ``X11_Xext_INCLUDE_PATH``.
+
+* The :module:`FindX11` now provides imported targets.
+
+* The :module:`UseSWIG` module learned to pass ``-module <module_name>`` to
+ the ``SWIG`` compiler if the file property ``SWIG_MODULE_NAME`` is defined.
+ See policy :policy:`CMP0086`.
+
+* The :module:`UseSWIG` module gained an option to specify
+ ``SWIG`` source file extensions.
+
+.. _`fontconfig`: https://www.freedesktop.org/wiki/Software/fontconfig/
+.. _`libinput`: https://www.freedesktop.org/wiki/Software/libinput/
+
+Generator Expressions
+---------------------
+
+* The ``$<Fortran_COMPILER_ID:...>`` and ``$<Fortran_COMPILER_VERSION:...>``
+ :manual:`generator expressions <cmake-generator-expressions(7)>` were added.
+
+* The ``$<IN_LIST:...>`` generator expression now correctly handles an
+ empty argument. See :policy:`CMP0085` for details.
+
+Autogen
+-------
+
+* The :prop_tgt:`AUTOMOC_EXECUTABLE`, :prop_tgt:`AUTORCC_EXECUTABLE`, and
+ :prop_tgt:`AUTOUIC_EXECUTABLE` target properties were added. They all
+ take a path to an executable and force automoc/autorcc/autouic to use
+ this executable.
+
+ Setting these will also prevent the configure time testing for these
+ executables. This is mainly useful when you build these tools yourself.
+
+* The new variables :variable:`CMAKE_GLOBAL_AUTOGEN_TARGET`,
+ :variable:`CMAKE_GLOBAL_AUTOGEN_TARGET_NAME`,
+ :variable:`CMAKE_GLOBAL_AUTORCC_TARGET` and
+ :variable:`CMAKE_GLOBAL_AUTORCC_TARGET_NAME` control the generation
+ of global ``autogen`` and ``autorcc`` targets.
+
+* A new :variable:`CMAKE_AUTOGEN_ORIGIN_DEPENDS` variable and
+ :prop_tgt:`AUTOGEN_ORIGIN_DEPENDS` target property may be set to enable or
+ disable forwarding of the origin target dependencies to the corresponding
+ ``_autogen`` target.
+
+CTest
+-----
+
+* :manual:`ctest(1)` gained a ``--show-only=json-v1`` option to show the
+ list of tests in a machine-readable JSON format.
+ See the :ref:`Show as JSON Object Model` section of the manual.
+
+* The :command:`ctest_submit` command learned a new ``Done`` part that can be used
+ to inform CDash that a build is complete and that no more parts will be uploaded.
+
+* CTest learned to accept the dashboard server submission URL from a single
+ variable. See the ``SubmitURL`` setting in :manual:`ctest(1)`,
+ the :variable:`CTEST_SUBMIT_URL` variable, and the ``SUBMIT_URL``
+ argument of the :command:`ctest_submit` command.
+
+Deprecated and Removed Features
+===============================
+
+* An explicit deprecation diagnostic was added for policies ``CMP0064``
+ and ``CMP0065`` (``CMP0063`` and below were already deprecated).
+ The :manual:`cmake-policies(7)` manual explains that the OLD behaviors
+ of all policies are deprecated and that projects should port to the
+ NEW behaviors.
+
+* The :generator:`Xcode` generator deprecated support for Xcode
+ versions prior to Xcode 5. Support for those will be dropped in a
+ future version of CMake.
+
+* The :module:`FindQt` module is no longer used by the :command:`find_package`
+ command as a find module. This allows the Qt Project upstream to optionally
+ provide its own ``QtConfig.cmake`` package configuration file and have
+ applications use it via ``find_package(Qt)`` rather than
+ ``find_package(Qt CONFIG)``. See policy :policy:`CMP0084`.
+
+* Support for running CMake on Windows XP and Windows Vista has been dropped.
+ The precompiled Windows binaries provided on ``cmake.org`` now require
+ Windows 7 or higher.
+
+* CTest no longer supports submissions via ``ftp``, ``scp``, ``cp``, and
+ ``xmlrpc``. CDash is the only maintained testing dashboard for CTest,
+ and it only supports submissions over ``http`` and ``https``.
+
+Other Changes
+=============
+
+* Object library linking has been fixed to propagate private link libraries
+ of object libraries to consuming targets.
+
+* Install rules under :command:`add_subdirectory` now interleave with those in
+ the calling directory. See policy :policy:`CMP0082` for details.
+
+* CMake now imposes a maximum recursion limit to prevent a stack overflow on
+ scripts that recurse infinitely. The limit can be adjusted at runtime with
+ :variable:`CMAKE_MAXIMUM_RECURSION_DEPTH`.
+
+* When using cppcheck via the :variable:`CMAKE_<LANG>_CPPCHECK` variable
+ or :prop_tgt:`<LANG>_CPPCHECK` property, the build will now fail if
+ ``cppcheck`` returns non-zero as configured by its command-line options.
+
+* Required link options to manage Position Independent Executable are now
+ added when :prop_tgt:`POSITION_INDEPENDENT_CODE` is set. The project is
+ responsible for using the :module:`CheckPIESupported` module to check for
+ ``PIE`` support to ensure that the :prop_tgt:`POSITION_INDEPENDENT_CODE`
+ target property will be honored at link time for executables. This behavior
+ is controlled by policy :policy:`CMP0083`.
+
+* :ref:`Visual Studio Generators` for VS 2010 and above learned
+ to support the ``VS_DEBUGGER_*`` properties on targets created
+ via :command:`add_custom_target`.
+
+* The :module:`CPack` module no longer defaults to the ``paxr`` value in the
+ :variable:`CPACK_DEBIAN_ARCHIVE_TYPE` variable, because ``dpkg`` has
+ never supported the PAX tar format. The ``paxr`` value will be mapped
+ to ``gnutar`` and a deprecation message emitted.
+
+* CMake no longer issues a warning if a target listed in an
+ :command:`install(TARGETS)` command has its :prop_tgt:`EXCLUDE_FROM_ALL`
+ property set to true.
+
+Updates
+=======
+
+Changes made since CMake 3.14.0 include the following.
+
+3.14.1
+------
+
+* The :module:`FindFontconfig` module added by 3.14.0 accidentally
+ used uppercase ``FONTCONFIG_*`` variable names that do not match
+ our conventions. 3.14.1 revises the module to use ``Fontconfig_*``
+ variable names. This is incompatible with 3.14.0 but since the
+ module is new in the 3.14 series usage should not yet be widespread.
diff --git a/Help/release/3.6.rst b/Help/release/3.6.rst
index 74dac1c20..f0add07ff 100644
--- a/Help/release/3.6.rst
+++ b/Help/release/3.6.rst
@@ -251,7 +251,7 @@ Deprecated and Removed Features
Users that keep some ``<prefix>/bin`` directories in the ``PATH`` just for
their tools do not necessarily want any supporting ``<prefix>/lib``
directories searched. One may set the ``CMAKE_PREFIX_PATH`` environment
- variable with a :ref:`;-list <CMake Language Lists>` of prefixes that are
+ variable with a :ref:`semicolon-separated list <CMake Language Lists>` of prefixes that are
to be searched.
* The :generator:`Visual Studio 7 .NET 2003` generator is now
diff --git a/Help/release/index.rst b/Help/release/index.rst
index fbe4cf625..4fcd4ca4f 100644
--- a/Help/release/index.rst
+++ b/Help/release/index.rst
@@ -13,6 +13,7 @@ Releases
.. toctree::
:maxdepth: 1
+ 3.14 <3.14>
3.13 <3.13>
3.12 <3.12>
3.11 <3.11>
diff --git a/Help/variable/CACHE.rst b/Help/variable/CACHE.rst
index 230739acc..2cef27efa 100644
--- a/Help/variable/CACHE.rst
+++ b/Help/variable/CACHE.rst
@@ -1,7 +1,7 @@
CACHE
-----
-Read cache variables.
+Operator to read cache variables.
Use the syntax ``$CACHE{VAR}`` to read cache entry ``VAR``.
See the :ref:`cmake-language(7) variables <CMake Language Variables>`
@@ -14,4 +14,5 @@ found CMake will search for a cache entry with that name.
The ``$CACHE{VAR}`` syntax can be used to do direct cache lookup and
ignore any existing normal variable.
-See the :command:`set` command to see how to write cache variables.
+See the :command:`set` and :command:`unset` commands to see how to
+write or remove cache variables.
diff --git a/Help/variable/CMAKE_APPBUNDLE_PATH.rst b/Help/variable/CMAKE_APPBUNDLE_PATH.rst
index c1f0951cc..1c7ca51c2 100644
--- a/Help/variable/CMAKE_APPBUNDLE_PATH.rst
+++ b/Help/variable/CMAKE_APPBUNDLE_PATH.rst
@@ -1,6 +1,6 @@
CMAKE_APPBUNDLE_PATH
--------------------
-:ref:`;-list <CMake Language Lists>` of directories specifying a search path
+:ref:`Semicolon-separated list <CMake Language Lists>` of directories specifying a search path
for macOS application bundles used by the :command:`find_program`, and
:command:`find_package` commands.
diff --git a/Help/variable/CMAKE_ARGC.rst b/Help/variable/CMAKE_ARGC.rst
index aec97119a..30db2a2da 100644
--- a/Help/variable/CMAKE_ARGC.rst
+++ b/Help/variable/CMAKE_ARGC.rst
@@ -3,6 +3,6 @@ CMAKE_ARGC
Number of command line arguments passed to CMake in script mode.
-When run in :ref:`-P <CMake Options>` script mode, CMake sets this variable to
-the number of command line arguments. See also :variable:`CMAKE_ARGV0`,
-``1``, ``2`` ...
+When run in :ref:`-P <Script Processing Mode>` script mode, CMake sets this
+variable to the number of command line arguments. See also
+:variable:`CMAKE_ARGV0`, ``1``, ``2`` ...
diff --git a/Help/variable/CMAKE_ARGV0.rst b/Help/variable/CMAKE_ARGV0.rst
index 8b1ecb79e..c4d1c219e 100644
--- a/Help/variable/CMAKE_ARGV0.rst
+++ b/Help/variable/CMAKE_ARGV0.rst
@@ -3,7 +3,7 @@ CMAKE_ARGV0
Command line argument passed to CMake in script mode.
-When run in :ref:`-P <CMake Options>` script mode, CMake sets this variable to
-the first command line argument. It then also sets ``CMAKE_ARGV1``,
+When run in :ref:`-P <Script Processing Mode>` script mode, CMake sets this
+variable to the first command line argument. It then also sets ``CMAKE_ARGV1``,
``CMAKE_ARGV2``, ... and so on, up to the number of command line arguments
given. See also :variable:`CMAKE_ARGC`.
diff --git a/Help/variable/CMAKE_AUTOGEN_ORIGIN_DEPENDS.rst b/Help/variable/CMAKE_AUTOGEN_ORIGIN_DEPENDS.rst
new file mode 100644
index 000000000..1398e7856
--- /dev/null
+++ b/Help/variable/CMAKE_AUTOGEN_ORIGIN_DEPENDS.rst
@@ -0,0 +1,11 @@
+CMAKE_AUTOGEN_ORIGIN_DEPENDS
+----------------------------
+
+Switch for forwarding origin target dependencies to the corresponding
+``_autogen`` targets.
+
+This variable is used to initialize the :prop_tgt:`AUTOGEN_ORIGIN_DEPENDS`
+property on all the targets. See that target property for additional
+information.
+
+By default :variable:`CMAKE_AUTOGEN_ORIGIN_DEPENDS` is ``ON``.
diff --git a/Help/variable/CMAKE_AUTOMOC_MACRO_NAMES.rst b/Help/variable/CMAKE_AUTOMOC_MACRO_NAMES.rst
index 2c8997bbf..ba1b9d27a 100644
--- a/Help/variable/CMAKE_AUTOMOC_MACRO_NAMES.rst
+++ b/Help/variable/CMAKE_AUTOMOC_MACRO_NAMES.rst
@@ -1,7 +1,7 @@
CMAKE_AUTOMOC_MACRO_NAMES
----------------------------
-A :ref:`;-list <CMake Language Lists>` list of macro names used by
+:ref:`Semicolon-separated list <CMake Language Lists>` list of macro names used by
:variable:`CMAKE_AUTOMOC` to determine if a C++ file needs to be
processed by ``moc``.
diff --git a/Help/variable/CMAKE_BUILD_RPATH.rst b/Help/variable/CMAKE_BUILD_RPATH.rst
index f20eb418f..f5d53b88c 100644
--- a/Help/variable/CMAKE_BUILD_RPATH.rst
+++ b/Help/variable/CMAKE_BUILD_RPATH.rst
@@ -1,7 +1,7 @@
CMAKE_BUILD_RPATH
-----------------
-A :ref:`;-list <CMake Language Lists>` specifying runtime path (``RPATH``)
+:ref:`Semicolon-separated list <CMake Language Lists>` specifying runtime path (``RPATH``)
entries to add to binaries linked in the build tree (for platforms that
support it). The entries will *not* be used for binaries in the install
tree. See also the :variable:`CMAKE_INSTALL_RPATH` variable.
diff --git a/Help/variable/CMAKE_BUILD_RPATH_USE_ORIGIN.rst b/Help/variable/CMAKE_BUILD_RPATH_USE_ORIGIN.rst
new file mode 100644
index 000000000..e34ede6ad
--- /dev/null
+++ b/Help/variable/CMAKE_BUILD_RPATH_USE_ORIGIN.rst
@@ -0,0 +1,7 @@
+CMAKE_BUILD_RPATH_USE_ORIGIN
+----------------------------
+
+Whether to use relative paths for the build ``RPATH``.
+
+This is used to initialize the :prop_tgt:`BUILD_RPATH_USE_ORIGIN` target
+property for all targets, see that property for more details.
diff --git a/Help/variable/CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES.rst b/Help/variable/CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES.rst
index 768f571c0..7de50a5a7 100644
--- a/Help/variable/CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES.rst
+++ b/Help/variable/CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES.rst
@@ -2,6 +2,6 @@ CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES
--------------------------------------
When the ``CUDA`` language has been enabled, this provides a
-:ref:`;-list <CMake Language Lists>` of include directories provided
+:ref:`semicolon-separated list <CMake Language Lists>` of include directories provided
by the CUDA Toolkit. The value may be useful for C++ source files
to include CUDA headers.
diff --git a/Help/variable/CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS.rst b/Help/variable/CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS.rst
new file mode 100644
index 000000000..dfbde2035
--- /dev/null
+++ b/Help/variable/CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS.rst
@@ -0,0 +1,10 @@
+CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS
+-----------------------------------
+
+Set to ``TRUE`` to tell :command:`find_package` calls to resolve symbolic
+links in the value of ``<PackageName>_DIR``.
+
+This is helpful in use cases where the package search path points at a
+proxy directory in which symlinks to the real package locations appear.
+This is not enabled by default because there are also common use cases
+in which the symlinks should be preserved.
diff --git a/Help/variable/CMAKE_FIND_ROOT_PATH.rst b/Help/variable/CMAKE_FIND_ROOT_PATH.rst
index ba2cf313e..6172c56ae 100644
--- a/Help/variable/CMAKE_FIND_ROOT_PATH.rst
+++ b/Help/variable/CMAKE_FIND_ROOT_PATH.rst
@@ -1,7 +1,7 @@
CMAKE_FIND_ROOT_PATH
--------------------
-:ref:`;-list <CMake Language Lists>` of root paths to search on the filesystem.
+:ref:`Semicolon-separated list <CMake Language Lists>` of root paths to search on the filesystem.
This variable is most useful when cross-compiling. CMake uses the paths in
this list as alternative roots to find filesystem items with
diff --git a/Help/variable/CMAKE_FRAMEWORK_PATH.rst b/Help/variable/CMAKE_FRAMEWORK_PATH.rst
index 04751f88d..13ade4e5f 100644
--- a/Help/variable/CMAKE_FRAMEWORK_PATH.rst
+++ b/Help/variable/CMAKE_FRAMEWORK_PATH.rst
@@ -1,7 +1,7 @@
CMAKE_FRAMEWORK_PATH
--------------------
-:ref:`;-list <CMake Language Lists>` of directories specifying a search path
+:ref:`Semicolon-separated list <CMake Language Lists>` of directories specifying a search path
for macOS frameworks used by the :command:`find_library`,
:command:`find_package`, :command:`find_path`, and :command:`find_file`
commands.
diff --git a/Help/variable/CMAKE_GENERATOR_TOOLSET.rst b/Help/variable/CMAKE_GENERATOR_TOOLSET.rst
index e9bc28b9e..e77f211dd 100644
--- a/Help/variable/CMAKE_GENERATOR_TOOLSET.rst
+++ b/Help/variable/CMAKE_GENERATOR_TOOLSET.rst
@@ -44,8 +44,8 @@ Supported pairs are:
and above with the CUDA toolkit VS integration installed.
See the :variable:`CMAKE_VS_PLATFORM_TOOLSET_CUDA` variable.
-``host=x64``
- Request use of the native ``x64`` toolchain on ``x64`` hosts.
+``host=<arch>``
+ Specify the host tools architecture as ``x64`` or ``x86``.
Supported by VS 2013 and above.
See the :variable:`CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE`
variable.
diff --git a/Help/variable/CMAKE_GHS_NO_SOURCE_GROUP_FILE.rst b/Help/variable/CMAKE_GHS_NO_SOURCE_GROUP_FILE.rst
new file mode 100644
index 000000000..b6768a131
--- /dev/null
+++ b/Help/variable/CMAKE_GHS_NO_SOURCE_GROUP_FILE.rst
@@ -0,0 +1,6 @@
+CMAKE_GHS_NO_SOURCE_GROUP_FILE
+------------------------------
+
+``ON`` / ``OFF`` boolean to control if the project file for a target should
+be one single file or multiple files. Refer to
+:prop_tgt:`GHS_NO_SOURCE_GROUP_FILE` for further details.
diff --git a/Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET.rst b/Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET.rst
new file mode 100644
index 000000000..e82867dfd
--- /dev/null
+++ b/Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET.rst
@@ -0,0 +1,26 @@
+CMAKE_GLOBAL_AUTOGEN_TARGET
+---------------------------
+
+Switch to enable generation of a global ``autogen`` target.
+
+When :variable:`CMAKE_GLOBAL_AUTORCC_TARGET` is enabled, a custom target
+``autogen`` is generated. This target depends on all :prop_tgt:`AUTOMOC` and
+:prop_tgt:`AUTOUIC` generated ``<ORIGIN>_autogen`` targets in the project.
+By building the global ``autogen`` target, all :prop_tgt:`AUTOMOC` and
+:prop_tgt:`AUTOUIC` files in the project will be generated.
+
+The name of the global ``autogen`` target can be changed by setting
+:variable:`CMAKE_GLOBAL_AUTOGEN_TARGET_NAME`.
+
+By default :variable:`CMAKE_GLOBAL_AUTOGEN_TARGET` is unset.
+
+See the :manual:`cmake-qt(7)` manual for more information on using CMake
+with Qt.
+
+Note
+^^^^
+
+``<ORIGIN>_autogen`` targets by default inherit their origin target's
+dependencies. This might result in unintended dependency target
+builds when only ``<ORIGIN>_autogen`` targets are built. A solution is to
+disable :prop_tgt:`AUTOGEN_ORIGIN_DEPENDS` on the respective origin targets.
diff --git a/Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET_NAME.rst b/Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET_NAME.rst
new file mode 100644
index 000000000..c86a5d0af
--- /dev/null
+++ b/Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET_NAME.rst
@@ -0,0 +1,13 @@
+CMAKE_GLOBAL_AUTOGEN_TARGET_NAME
+--------------------------------
+
+Change the name of the global ``autogen`` target.
+
+When :variable:`CMAKE_GLOBAL_AUTOGEN_TARGET` is enabled, a global custom target
+named ``autogen`` is created. :variable:`CMAKE_GLOBAL_AUTOGEN_TARGET_NAME`
+allows to set a different name for that target.
+
+By default :variable:`CMAKE_GLOBAL_AUTOGEN_TARGET_NAME` is unset.
+
+See the :manual:`cmake-qt(7)` manual for more information on using CMake
+with Qt.
diff --git a/Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET.rst b/Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET.rst
new file mode 100644
index 000000000..f92128cda
--- /dev/null
+++ b/Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET.rst
@@ -0,0 +1,18 @@
+CMAKE_GLOBAL_AUTORCC_TARGET
+---------------------------
+
+Switch to enable generation of a global ``autorcc`` target.
+
+When :variable:`CMAKE_GLOBAL_AUTORCC_TARGET` is enabled, a custom target
+``autorcc`` is generated. This target depends on all :prop_tgt:`AUTORCC`
+generated ``<ORIGIN>_arcc_<QRC>`` targets in the project.
+By building the global ``autorcc`` target, all :prop_tgt:`AUTORCC`
+files in the project will be generated.
+
+The name of the global ``autorcc`` target can be changed by setting
+:variable:`CMAKE_GLOBAL_AUTORCC_TARGET_NAME`.
+
+By default :variable:`CMAKE_GLOBAL_AUTORCC_TARGET` is unset.
+
+See the :manual:`cmake-qt(7)` manual for more information on using CMake
+with Qt.
diff --git a/Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET_NAME.rst b/Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET_NAME.rst
new file mode 100644
index 000000000..c6e05de4e
--- /dev/null
+++ b/Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET_NAME.rst
@@ -0,0 +1,13 @@
+CMAKE_GLOBAL_AUTORCC_TARGET_NAME
+--------------------------------
+
+Change the name of the global ``autorcc`` target.
+
+When :variable:`CMAKE_GLOBAL_AUTORCC_TARGET` is enabled, a global custom target
+named ``autorcc`` is created. :variable:`CMAKE_GLOBAL_AUTORCC_TARGET_NAME`
+allows to set a different name for that target.
+
+By default :variable:`CMAKE_GLOBAL_AUTOGEN_TARGET_NAME` is unset.
+
+See the :manual:`cmake-qt(7)` manual for more information on using CMake
+with Qt.
diff --git a/Help/variable/CMAKE_HOME_DIRECTORY.rst b/Help/variable/CMAKE_HOME_DIRECTORY.rst
index fdc5d8190..b03d95618 100644
--- a/Help/variable/CMAKE_HOME_DIRECTORY.rst
+++ b/Help/variable/CMAKE_HOME_DIRECTORY.rst
@@ -1,6 +1,9 @@
CMAKE_HOME_DIRECTORY
--------------------
-Path to top of source tree.
+Path to top of source tree. Same as :variable:`CMAKE_SOURCE_DIR`.
-This is the path to the top level of the source tree.
+This is an internal cache entry used to locate the source directory
+when loading a ``CMakeCache.txt`` from a build tree. It should not
+be used in project code. The variable :variable:`CMAKE_SOURCE_DIR`
+has the same value and should be preferred.
diff --git a/Help/variable/CMAKE_IGNORE_PATH.rst b/Help/variable/CMAKE_IGNORE_PATH.rst
index 92f377086..4bca34b7e 100644
--- a/Help/variable/CMAKE_IGNORE_PATH.rst
+++ b/Help/variable/CMAKE_IGNORE_PATH.rst
@@ -1,7 +1,7 @@
CMAKE_IGNORE_PATH
-----------------
-:ref:`;-list <CMake Language Lists>` of directories to be *ignored* by
+:ref:`Semicolon-separated list <CMake Language Lists>` of directories to be *ignored* by
the :command:`find_program`, :command:`find_library`, :command:`find_file`,
and :command:`find_path` commands. This is useful in cross-compiling
environments where some system directories contain incompatible but
diff --git a/Help/variable/CMAKE_INCLUDE_PATH.rst b/Help/variable/CMAKE_INCLUDE_PATH.rst
index e4e7f2cfc..4918e9960 100644
--- a/Help/variable/CMAKE_INCLUDE_PATH.rst
+++ b/Help/variable/CMAKE_INCLUDE_PATH.rst
@@ -1,7 +1,7 @@
CMAKE_INCLUDE_PATH
------------------
-:ref:`;-list <CMake Language Lists>` of directories specifying a search path
+:ref:`Semicolon-separated list <CMake Language Lists>` of directories specifying a search path
for the :command:`find_file` and :command:`find_path` commands. By default it
is empty, it is intended to be set by the project. See also
:variable:`CMAKE_SYSTEM_INCLUDE_PATH` and :variable:`CMAKE_PREFIX_PATH`.
diff --git a/Help/variable/CMAKE_LANG_COMPILER_ID.rst b/Help/variable/CMAKE_LANG_COMPILER_ID.rst
index 226426970..5323880d5 100644
--- a/Help/variable/CMAKE_LANG_COMPILER_ID.rst
+++ b/Help/variable/CMAKE_LANG_COMPILER_ID.rst
@@ -17,8 +17,10 @@ include:
Clang = LLVM Clang (clang.llvm.org)
Cray = Cray Compiler (cray.com)
Embarcadero, Borland = Embarcadero (embarcadero.com)
+ Flang = Flang LLVM Fortran Compiler
G95 = G95 Fortran (g95.org)
GNU = GNU Compiler Collection (gcc.gnu.org)
+ GHS = Green Hills Software (www.ghs.com)
HP = Hewlett-Packard Compiler (hp.com)
IAR = IAR Systems (iar.com)
Intel = Intel Compiler (intel.com)
@@ -27,7 +29,6 @@ include:
NVIDIA = NVIDIA CUDA Compiler (nvidia.com)
OpenWatcom = Open Watcom (openwatcom.org)
PGI = The Portland Group (pgroup.com)
- Flang = Flang Fortran Compiler
PathScale = PathScale (pathscale.com)
SDCC = Small Device C Compiler (sdcc.sourceforge.net)
SunPro = Oracle Solaris Studio (oracle.com)
diff --git a/Help/variable/CMAKE_LANG_CREATE_SHARED_LIBRARY.rst b/Help/variable/CMAKE_LANG_CREATE_SHARED_LIBRARY.rst
index be89f8529..16fcc0344 100644
--- a/Help/variable/CMAKE_LANG_CREATE_SHARED_LIBRARY.rst
+++ b/Help/variable/CMAKE_LANG_CREATE_SHARED_LIBRARY.rst
@@ -4,4 +4,5 @@ CMAKE_<LANG>_CREATE_SHARED_LIBRARY
Rule variable to create a shared library.
This is a rule variable that tells CMake how to create a shared
-library for the language ``<LANG>``.
+library for the language ``<LANG>``. This rule variable is a ``;`` delimited
+list of commands to run to perform the linking step.
diff --git a/Help/variable/CMAKE_LANG_CREATE_SHARED_MODULE.rst b/Help/variable/CMAKE_LANG_CREATE_SHARED_MODULE.rst
index ae5f69d56..807229dec 100644
--- a/Help/variable/CMAKE_LANG_CREATE_SHARED_MODULE.rst
+++ b/Help/variable/CMAKE_LANG_CREATE_SHARED_MODULE.rst
@@ -4,4 +4,5 @@ CMAKE_<LANG>_CREATE_SHARED_MODULE
Rule variable to create a shared module.
This is a rule variable that tells CMake how to create a shared
-library for the language ``<LANG>``.
+library for the language ``<LANG>``. This rule variable is a ``;`` delimited
+list of commands to run.
diff --git a/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_CONFIG.rst b/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_CONFIG.rst
deleted file mode 100644
index 8ed1c02cc..000000000
--- a/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_CONFIG.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-CMAKE_<LANG>_GHS_KERNEL_FLAGS_<CONFIG>
---------------------------------------
-
-GHS kernel flags for language ``<LANG>`` when building for the ``<CONFIG>``
-configuration.
diff --git a/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_DEBUG.rst b/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_DEBUG.rst
deleted file mode 100644
index 4fea67a4a..000000000
--- a/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_DEBUG.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-CMAKE_<LANG>_GHS_KERNEL_FLAGS_DEBUG
------------------------------------
-
-This variable is the ``Debug`` variant of the
-:variable:`CMAKE_<LANG>_GHS_KERNEL_FLAGS_<CONFIG>` variable.
diff --git a/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_MINSIZEREL.rst b/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_MINSIZEREL.rst
deleted file mode 100644
index 31f87f2ac..000000000
--- a/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_MINSIZEREL.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-CMAKE_<LANG>_GHS_KERNEL_FLAGS_MINSIZEREL
-----------------------------------------
-
-This variable is the ``MinSizeRel`` variant of the
-:variable:`CMAKE_<LANG>_GHS_KERNEL_FLAGS_<CONFIG>` variable.
diff --git a/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_RELEASE.rst b/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_RELEASE.rst
deleted file mode 100644
index 1acd19876..000000000
--- a/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_RELEASE.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-CMAKE_<LANG>_GHS_KERNEL_FLAGS_RELEASE
--------------------------------------
-
-This variable is the ``Release`` variant of the
-:variable:`CMAKE_<LANG>_GHS_KERNEL_FLAGS_<CONFIG>` variable.
diff --git a/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_RELWITHDEBINFO.rst b/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_RELWITHDEBINFO.rst
deleted file mode 100644
index ac1b6bceb..000000000
--- a/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_RELWITHDEBINFO.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-CMAKE_<LANG>_GHS_KERNEL_FLAGS_RELWITHDEBINFO
---------------------------------------------
-
-This variable is the ``RelWithDebInfo`` variant of the
-:variable:`CMAKE_<LANG>_GHS_KERNEL_FLAGS_<CONFIG>` variable.
diff --git a/Help/variable/CMAKE_LANG_IMPLICIT_INCLUDE_DIRECTORIES.rst b/Help/variable/CMAKE_LANG_IMPLICIT_INCLUDE_DIRECTORIES.rst
index cc8085107..e361fd98e 100644
--- a/Help/variable/CMAKE_LANG_IMPLICIT_INCLUDE_DIRECTORIES.rst
+++ b/Help/variable/CMAKE_LANG_IMPLICIT_INCLUDE_DIRECTORIES.rst
@@ -6,4 +6,9 @@ Directories implicitly searched by the compiler for header files.
CMake does not explicitly specify these directories on compiler
command lines for language ``<LANG>``. This prevents system include
directories from being treated as user include directories on some
-compilers.
+compilers, which is important for ``C``, ``CXX``, and ``CUDA`` to
+avoid overriding standard library headers.
+
+This value is not used for ``Fortran`` because it has no standard
+library headers and some compilers do not search their implicit
+include directories for module ``.mod`` files.
diff --git a/Help/variable/CMAKE_LANG_LINKER_WRAPPER_FLAG.rst b/Help/variable/CMAKE_LANG_LINKER_WRAPPER_FLAG.rst
index 321f97ed1..df514075c 100644
--- a/Help/variable/CMAKE_LANG_LINKER_WRAPPER_FLAG.rst
+++ b/Help/variable/CMAKE_LANG_LINKER_WRAPPER_FLAG.rst
@@ -5,7 +5,7 @@ Defines the syntax of compiler driver option to pass options to the linker
tool. It will be used to translate the ``LINKER:`` prefix in the link options
(see :command:`add_link_options` and :command:`target_link_options`).
-This variable holds a :ref:`;-list <CMake Language Lists>` of tokens.
+This variable holds a :ref:`semicolon-separated list <CMake Language Lists>` of tokens.
If a space (i.e. " ") is specified as last token, flag and ``LINKER:``
arguments will be specified as separate arguments to the compiler driver.
The :variable:`CMAKE_<LANG>_LINKER_WRAPPER_FLAG_SEP` variable can be specified
diff --git a/Help/variable/CMAKE_LIBRARY_PATH.rst b/Help/variable/CMAKE_LIBRARY_PATH.rst
index b1770dc26..8135b6581 100644
--- a/Help/variable/CMAKE_LIBRARY_PATH.rst
+++ b/Help/variable/CMAKE_LIBRARY_PATH.rst
@@ -1,7 +1,7 @@
CMAKE_LIBRARY_PATH
------------------
-:ref:`;-list <CMake Language Lists>` of directories specifying a search path
+:ref:`Semicolon-separated list <CMake Language Lists>` of directories specifying a search path
for the :command:`find_library` command. By default it is empty, it is
intended to be set by the project. See also
:variable:`CMAKE_SYSTEM_LIBRARY_PATH` and :variable:`CMAKE_PREFIX_PATH`.
diff --git a/Help/variable/CMAKE_MACOSX_BUNDLE.rst b/Help/variable/CMAKE_MACOSX_BUNDLE.rst
index 0badaf0da..43ddff517 100644
--- a/Help/variable/CMAKE_MACOSX_BUNDLE.rst
+++ b/Help/variable/CMAKE_MACOSX_BUNDLE.rst
@@ -5,3 +5,6 @@ Default value for :prop_tgt:`MACOSX_BUNDLE` of targets.
This variable is used to initialize the :prop_tgt:`MACOSX_BUNDLE` property on
all the targets. See that target property for additional information.
+
+This variable is set to ``ON`` by default if :variable:`CMAKE_SYSTEM_NAME`
+equals to :ref:`iOS, tvOS or watchOS <Cross Compiling for iOS, tvOS, or watchOS>`.
diff --git a/Help/variable/CMAKE_MAXIMUM_RECURSION_DEPTH.rst b/Help/variable/CMAKE_MAXIMUM_RECURSION_DEPTH.rst
new file mode 100644
index 000000000..7110b1685
--- /dev/null
+++ b/Help/variable/CMAKE_MAXIMUM_RECURSION_DEPTH.rst
@@ -0,0 +1,33 @@
+CMAKE_MAXIMUM_RECURSION_DEPTH
+-----------------------------
+
+Maximum recursion depth for CMake scripts. It is intended to be set on the
+command line with ``-DCMAKE_MAXIMUM_RECURSION_DEPTH=<x>``, or within
+``CMakeLists.txt`` by projects that require a large recursion depth. Projects
+that set this variable should provide the user with a way to override it. For
+example:
+
+.. code-block:: cmake
+
+ # About to perform deeply recursive actions
+ if(NOT CMAKE_MAXIMUM_RECURSION_DEPTH)
+ set(CMAKE_MAXIMUM_RECURSION_DEPTH 2000)
+ endif()
+
+If it is not set, or is set to a non-integer value, a sensible default limit is
+used. If the recursion limit is reached, the script terminates immediately with
+a fatal error.
+
+Calling any of the following commands increases the recursion depth:
+
+* :command:`include`
+* :command:`find_package`
+* :command:`add_subdirectory`
+* :command:`try_compile`
+* :command:`ctest_read_custom_files`
+* :command:`ctest_run_script` (unless ``NEW_PROCESS`` is specified)
+* User-defined :command:`function`'s and :command:`macro`'s (note that
+ :command:`function` and :command:`macro` themselves don't increase recursion
+ depth)
+* Reading or writing variables that are being watched by a
+ :command:`variable_watch`
diff --git a/Help/variable/CMAKE_MFC_FLAG.rst b/Help/variable/CMAKE_MFC_FLAG.rst
index 5a392bfbb..2c4d1c551 100644
--- a/Help/variable/CMAKE_MFC_FLAG.rst
+++ b/Help/variable/CMAKE_MFC_FLAG.rst
@@ -1,15 +1,16 @@
CMAKE_MFC_FLAG
--------------
-Tell cmake to use MFC for an executable or dll.
+Use the MFC library for an executable or dll.
-This can be set in a ``CMakeLists.txt`` file and will enable MFC in the
-application. It should be set to ``1`` for the static MFC library, and ``2``
-for the shared MFC library. This is used in Visual Studio
-project files. The CMakeSetup dialog used MFC and the ``CMakeLists.txt``
-looks like this:
+Enables the use of the Microsoft Foundation Classes (MFC).
+It should be set to ``1`` for the static MFC library, and
+``2`` for the shared MFC library. This is used in Visual Studio
+project files.
-::
+Usage example:
+
+.. code-block:: cmake
add_definitions(-D_AFXDLL)
set(CMAKE_MFC_FLAG 2)
diff --git a/Help/variable/CMAKE_MODULE_PATH.rst b/Help/variable/CMAKE_MODULE_PATH.rst
index 6490054a4..4dcf6b526 100644
--- a/Help/variable/CMAKE_MODULE_PATH.rst
+++ b/Help/variable/CMAKE_MODULE_PATH.rst
@@ -1,7 +1,7 @@
CMAKE_MODULE_PATH
-----------------
-:ref:`;-list <CMake Language Lists>` of directories specifying a search path
+:ref:`Semicolon-separated list <CMake Language Lists>` of directories specifying a search path
for CMake modules to be loaded by the :command:`include` or
:command:`find_package` commands before checking the default modules that come
with CMake. By default it is empty, it is intended to be set by the project.
diff --git a/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst b/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst
index aa23b65f9..d17972873 100644
--- a/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst
+++ b/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst
@@ -19,6 +19,8 @@ warn by default:
policy :policy:`CMP0066`.
* ``CMAKE_POLICY_WARNING_CMP0067`` controls the warning for
policy :policy:`CMP0067`.
+* ``CMAKE_POLICY_WARNING_CMP0082`` controls the warning for
+ policy :policy:`CMP0082`.
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_PREFIX_PATH.rst b/Help/variable/CMAKE_PREFIX_PATH.rst
index c2a4a6038..1d4fd0b42 100644
--- a/Help/variable/CMAKE_PREFIX_PATH.rst
+++ b/Help/variable/CMAKE_PREFIX_PATH.rst
@@ -1,7 +1,7 @@
CMAKE_PREFIX_PATH
-----------------
-:ref:`;-list <CMake Language Lists>` of directories specifying installation
+:ref:`Semicolon-separated list <CMake Language Lists>` of directories specifying installation
*prefixes* to be searched by the :command:`find_package`,
:command:`find_program`, :command:`find_library`, :command:`find_file`, and
:command:`find_path` commands. Each command will add appropriate
diff --git a/Help/variable/CMAKE_PROGRAM_PATH.rst b/Help/variable/CMAKE_PROGRAM_PATH.rst
index 799e1192c..2d0c090df 100644
--- a/Help/variable/CMAKE_PROGRAM_PATH.rst
+++ b/Help/variable/CMAKE_PROGRAM_PATH.rst
@@ -1,7 +1,7 @@
CMAKE_PROGRAM_PATH
------------------
-:ref:`;-list <CMake Language Lists>` of directories specifying a search path
+:ref:`Semicolon-separated list <CMake Language Lists>` of directories specifying a search path
for the :command:`find_program` command. By default it is empty, it is
intended to be set by the project. See also
:variable:`CMAKE_SYSTEM_PROGRAM_PATH` and :variable:`CMAKE_PREFIX_PATH`.
diff --git a/Help/variable/CMAKE_SYSTEM_IGNORE_PATH.rst b/Help/variable/CMAKE_SYSTEM_IGNORE_PATH.rst
index 4ad7e33ce..6afbd337a 100644
--- a/Help/variable/CMAKE_SYSTEM_IGNORE_PATH.rst
+++ b/Help/variable/CMAKE_SYSTEM_IGNORE_PATH.rst
@@ -1,7 +1,7 @@
CMAKE_SYSTEM_IGNORE_PATH
------------------------
-:ref:`;-list <CMake Language Lists>` of directories to be *ignored* by
+:ref:`Semicolon-separated list <CMake Language Lists>` of directories to be *ignored* by
the :command:`find_program`, :command:`find_library`, :command:`find_file`,
and :command:`find_path` commands. This is useful in cross-compiling
environments where some system directories contain incompatible but
diff --git a/Help/variable/CMAKE_SYSTEM_INCLUDE_PATH.rst b/Help/variable/CMAKE_SYSTEM_INCLUDE_PATH.rst
index 2c14345c0..680404ef5 100644
--- a/Help/variable/CMAKE_SYSTEM_INCLUDE_PATH.rst
+++ b/Help/variable/CMAKE_SYSTEM_INCLUDE_PATH.rst
@@ -1,7 +1,7 @@
CMAKE_SYSTEM_INCLUDE_PATH
-------------------------
-:ref:`;-list <CMake Language Lists>` of directories specifying a search path
+:ref:`Semicolon-separated list <CMake Language Lists>` of directories specifying a search path
for the :command:`find_file` and :command:`find_path` commands. By default
this contains the standard directories for the current system. It is *not*
intended to be modified by the project; use :variable:`CMAKE_INCLUDE_PATH` for
diff --git a/Help/variable/CMAKE_SYSTEM_LIBRARY_PATH.rst b/Help/variable/CMAKE_SYSTEM_LIBRARY_PATH.rst
index 3969cb94c..116832bf9 100644
--- a/Help/variable/CMAKE_SYSTEM_LIBRARY_PATH.rst
+++ b/Help/variable/CMAKE_SYSTEM_LIBRARY_PATH.rst
@@ -1,7 +1,7 @@
CMAKE_SYSTEM_LIBRARY_PATH
-------------------------
-:ref:`;-list <CMake Language Lists>` of directories specifying a search path
+:ref:`Semicolon-separated list <CMake Language Lists>` of directories specifying a search path
for the :command:`find_library` command. By default this contains the
standard directories for the current system. It is *not* intended to be
modified by the project; use :variable:`CMAKE_LIBRARY_PATH` for this.
diff --git a/Help/variable/CMAKE_SYSTEM_PREFIX_PATH.rst b/Help/variable/CMAKE_SYSTEM_PREFIX_PATH.rst
index 38b2f8dca..87a9d06a8 100644
--- a/Help/variable/CMAKE_SYSTEM_PREFIX_PATH.rst
+++ b/Help/variable/CMAKE_SYSTEM_PREFIX_PATH.rst
@@ -1,7 +1,7 @@
CMAKE_SYSTEM_PREFIX_PATH
------------------------
-:ref:`;-list <CMake Language Lists>` of directories specifying installation
+:ref:`Semicolon-separated list <CMake Language Lists>` of directories specifying installation
*prefixes* to be searched by the :command:`find_package`,
:command:`find_program`, :command:`find_library`, :command:`find_file`, and
:command:`find_path` commands. Each command will add appropriate
diff --git a/Help/variable/CMAKE_SYSTEM_PROGRAM_PATH.rst b/Help/variable/CMAKE_SYSTEM_PROGRAM_PATH.rst
index cf1b83e80..9b7036182 100644
--- a/Help/variable/CMAKE_SYSTEM_PROGRAM_PATH.rst
+++ b/Help/variable/CMAKE_SYSTEM_PROGRAM_PATH.rst
@@ -1,7 +1,7 @@
CMAKE_SYSTEM_PROGRAM_PATH
-------------------------
-:ref:`;-list <CMake Language Lists>` of directories specifying a search path
+:ref:`Semicolon-separated list <CMake Language Lists>` of directories specifying a search path
for the :command:`find_program` command. By default this contains the
standard directories for the current system. It is *not* intended to be
modified by the project; use :variable:`CMAKE_PROGRAM_PATH` for this.
diff --git a/Help/variable/CMAKE_Swift_LANGUAGE_VERSION.rst b/Help/variable/CMAKE_Swift_LANGUAGE_VERSION.rst
index 50121e286..b4a74eb03 100644
--- a/Help/variable/CMAKE_Swift_LANGUAGE_VERSION.rst
+++ b/Help/variable/CMAKE_Swift_LANGUAGE_VERSION.rst
@@ -1,5 +1,9 @@
CMAKE_Swift_LANGUAGE_VERSION
----------------------------
-Set to the Swift language version number. If not set, the legacy "2.3"
-version is assumed.
+Set to the Swift language version number. If not set, the oldest legacy
+version known to be available in the host Xcode version is assumed:
+
+* Swift ``4.0`` for Xcode 10.2 and above.
+* Swift ``3.0`` for Xcode 8.3 and above.
+* Swift ``2.3`` for Xcode 8.2 and below.
diff --git a/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE.rst b/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE.rst
index 9b59c52a6..99ac90ddc 100644
--- a/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE.rst
+++ b/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE.rst
@@ -3,8 +3,8 @@ CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE
Visual Studio preferred tool architecture.
-The :ref:`Visual Studio Generators` for VS 2013 and above support optional
-selection of a 64-bit toolchain on 64-bit hosts by specifying a ``host=x64``
-value in the :variable:`CMAKE_GENERATOR_TOOLSET` option. CMake provides
-the selected toolchain architecture preference in this variable (either
-``x64`` or empty).
+The :ref:`Visual Studio Generators` for VS 2013 and above support using
+either the 32-bit or 64-bit host toolchains by specifying a ``host=x86``
+or ``host=x64`` value in the :variable:`CMAKE_GENERATOR_TOOLSET` option.
+CMake provides the selected toolchain architecture preference in this
+variable (``x86``, ``x64``, or empty).
diff --git a/Help/variable/CMAKE_XCODE_GENERATE_SCHEME.rst b/Help/variable/CMAKE_XCODE_GENERATE_SCHEME.rst
index ed20bbe92..74667845d 100644
--- a/Help/variable/CMAKE_XCODE_GENERATE_SCHEME.rst
+++ b/Help/variable/CMAKE_XCODE_GENERATE_SCHEME.rst
@@ -1,15 +1,10 @@
CMAKE_XCODE_GENERATE_SCHEME
---------------------------
-If enabled, the Xcode generator will generate schema files. Those are
+If enabled, the Xcode generator will generate schema files. These
are useful to invoke analyze, archive, build-for-testing and test
actions from the command line.
-.. note::
-
- The Xcode Schema Generator is still experimental and subject to
- change.
-
The following target properties overwrite the default of the
corresponding settings on the "Diagnostic" tab for each schema file.
Each of those is initialized by the respective ``CMAKE_`` variable
@@ -17,23 +12,23 @@ at target creation time.
- :prop_tgt:`XCODE_SCHEME_ADDRESS_SANITIZER`
- :prop_tgt:`XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN`
+- :prop_tgt:`XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER`
+- :prop_tgt:`XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS`
+- :prop_tgt:`XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE`
+- :prop_tgt:`XCODE_SCHEME_GUARD_MALLOC`
+- :prop_tgt:`XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP`
+- :prop_tgt:`XCODE_SCHEME_MALLOC_GUARD_EDGES`
+- :prop_tgt:`XCODE_SCHEME_MALLOC_SCRIBBLE`
+- :prop_tgt:`XCODE_SCHEME_MALLOC_STACK`
- :prop_tgt:`XCODE_SCHEME_THREAD_SANITIZER`
- :prop_tgt:`XCODE_SCHEME_THREAD_SANITIZER_STOP`
- :prop_tgt:`XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER`
- :prop_tgt:`XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP`
-- :prop_tgt:`XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER`
-- :prop_tgt:`XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP`
-- :prop_tgt:`XCODE_SCHEME_MALLOC_SCRIBBLE`
-- :prop_tgt:`XCODE_SCHEME_MALLOC_GUARD_EDGES`
-- :prop_tgt:`XCODE_SCHEME_GUARD_MALLOC`
- :prop_tgt:`XCODE_SCHEME_ZOMBIE_OBJECTS`
-- :prop_tgt:`XCODE_SCHEME_MALLOC_STACK`
-- :prop_tgt:`XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE`
-- :prop_tgt:`XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS`
The following target properties will be applied on the
"Info" and "Arguments" tab:
-- :prop_tgt:`XCODE_SCHEME_EXECUTABLE`
- :prop_tgt:`XCODE_SCHEME_ARGUMENTS`
- :prop_tgt:`XCODE_SCHEME_ENVIRONMENT`
+- :prop_tgt:`XCODE_SCHEME_EXECUTABLE`
diff --git a/Help/variable/CTEST_CUSTOM_TEST_IGNORE.rst b/Help/variable/CTEST_CUSTOM_TESTS_IGNORE.rst
index 6114e608c..57222ca1e 100644
--- a/Help/variable/CTEST_CUSTOM_TEST_IGNORE.rst
+++ b/Help/variable/CTEST_CUSTOM_TESTS_IGNORE.rst
@@ -1,5 +1,5 @@
-CTEST_CUSTOM_TEST_IGNORE
-------------------------
+CTEST_CUSTOM_TESTS_IGNORE
+-------------------------
A list of regular expressions to use to exclude tests during the
:command:`ctest_test` command.
diff --git a/Help/variable/CTEST_SCP_COMMAND.rst b/Help/variable/CTEST_SCP_COMMAND.rst
index 0f128b14a..19ea8b33d 100644
--- a/Help/variable/CTEST_SCP_COMMAND.rst
+++ b/Help/variable/CTEST_SCP_COMMAND.rst
@@ -1,5 +1,4 @@
CTEST_SCP_COMMAND
-----------------
-Specify the CTest ``SCPCommand`` setting
-in a :manual:`ctest(1)` dashboard client script.
+Legacy option. Not used.
diff --git a/Help/variable/CTEST_SUBMIT_URL.rst b/Help/variable/CTEST_SUBMIT_URL.rst
new file mode 100644
index 000000000..7d84da4b4
--- /dev/null
+++ b/Help/variable/CTEST_SUBMIT_URL.rst
@@ -0,0 +1,5 @@
+CTEST_SUBMIT_URL
+----------------
+
+Specify the CTest ``SubmitURL`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_TRIGGER_SITE.rst b/Help/variable/CTEST_TRIGGER_SITE.rst
index de9242807..a50e405cc 100644
--- a/Help/variable/CTEST_TRIGGER_SITE.rst
+++ b/Help/variable/CTEST_TRIGGER_SITE.rst
@@ -1,5 +1,4 @@
CTEST_TRIGGER_SITE
------------------
-Specify the CTest ``TriggerSite`` setting
-in a :manual:`ctest(1)` dashboard client script.
+Legacy option. Not used.
diff --git a/Help/variable/ENV.rst b/Help/variable/ENV.rst
index 98677ddc9..2b439342e 100644
--- a/Help/variable/ENV.rst
+++ b/Help/variable/ENV.rst
@@ -1,8 +1,12 @@
ENV
---
-Read environment variables.
+Operator to read environment variables.
Use the syntax ``$ENV{VAR}`` to read environment variable ``VAR``.
-See the :command:`set` command to see how to write environment variables.
+To test whether an environment variable is defined, use the signature
+``if(DEFINED ENV{<name>})`` of the :command:`if` command.
+
+See the :command:`set` and :command:`unset` commands to see how to
+write or remove environment variables.
diff --git a/Help/variable/GHS-MULTI.rst b/Help/variable/GHS-MULTI.rst
index 0f91be8ad..fe3b17e18 100644
--- a/Help/variable/GHS-MULTI.rst
+++ b/Help/variable/GHS-MULTI.rst
@@ -1,4 +1,4 @@
GHS-MULTI
---------
-True when using Green Hills MULTI
+``True`` when using :generator:`Green Hills MULTI` generator.
diff --git a/Help/variable/IOS.rst b/Help/variable/IOS.rst
new file mode 100644
index 000000000..e5cc3f69c
--- /dev/null
+++ b/Help/variable/IOS.rst
@@ -0,0 +1,4 @@
+IOS
+---
+
+Set to ``1`` when the target system (:variable:`CMAKE_SYSTEM_NAME`) is ``iOS``.
diff --git a/Help/variable/MSVC_VERSION.rst b/Help/variable/MSVC_VERSION.rst
index 4ef43d831..45df37fa0 100644
--- a/Help/variable/MSVC_VERSION.rst
+++ b/Help/variable/MSVC_VERSION.rst
@@ -18,6 +18,7 @@ Known version numbers are::
1800 = VS 12.0 (v120 toolset)
1900 = VS 14.0 (v140 toolset)
1910-1919 = VS 15.0 (v141 toolset)
+ 1920-1929 = VS 16.0 (v142 toolset)
See also the :variable:`CMAKE_<LANG>_COMPILER_VERSION` and
:variable:`MSVC_TOOLSET_VERSION` variable.
diff --git a/Help/variable/MSYS.rst b/Help/variable/MSYS.rst
new file mode 100644
index 000000000..25ddc7f73
--- /dev/null
+++ b/Help/variable/MSYS.rst
@@ -0,0 +1,4 @@
+MSYS
+----
+
+``True`` when using the :generator:`MSYS Makefiles` generator.
diff --git a/Help/variable/PackageName_ROOT.rst b/Help/variable/PackageName_ROOT.rst
index 4f6c25b34..c5b07ae2b 100644
--- a/Help/variable/PackageName_ROOT.rst
+++ b/Help/variable/PackageName_ROOT.rst
@@ -9,6 +9,6 @@ prefixes specified in the ``Foo_ROOT`` CMake variable (if set).
See policy :policy:`CMP0074`.
This variable may hold a single prefix or a
-:ref:`;-list <CMake Language Lists>` of multiple prefixes.
+:ref:`semicolon-separated list <CMake Language Lists>` of multiple prefixes.
See also the :envvar:`<PackageName>_ROOT` environment variable.