diff options
Diffstat (limited to 'Help')
137 files changed, 957 insertions, 372 deletions
diff --git a/Help/command/DEVICE_LINK_OPTIONS.txt b/Help/command/DEVICE_LINK_OPTIONS.txt index 3d50208..878754d 100644 --- a/Help/command/DEVICE_LINK_OPTIONS.txt +++ b/Help/command/DEVICE_LINK_OPTIONS.txt @@ -7,8 +7,6 @@ Host And Device Specific Link Options :prop_tgt:`CUDA_RESOLVE_DEVICE_SYMBOLS` properties and policy :policy:`CMP0105`, the raw options will be delivered to the host and device link steps (wrapped in ``-Xcompiler`` or equivalent for device link). Options wrapped with - ``$<DEVICE_LINK:...>`` - :manual:`generator expression <cmake-generator-expressions(7)>` will be used - only for the device link step. Options wrapped with ``$<HOST_LINK:...>`` - :manual:`generator expression <cmake-generator-expressions(7)>` will be used - only for the host link step. + :genex:`$<DEVICE_LINK:...>` generator expression will be used + only for the device link step. Options wrapped with :genex:`$<HOST_LINK:...>` + generator expression will be used only for the host link step. diff --git a/Help/command/GENEX_NOTE.txt b/Help/command/GENEX_NOTE.txt new file mode 100644 index 0000000..4a7906c --- /dev/null +++ b/Help/command/GENEX_NOTE.txt @@ -0,0 +1,6 @@ +.. |more_see_also| replace:: See the :manual:`cmake-buildsystem(7)` manual + for more on defining buildsystem properties. + +Arguments to |command_name| may use generator expressions +with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` +manual for available expressions. |more_see_also| diff --git a/Help/command/add_compile_definitions.rst b/Help/command/add_compile_definitions.rst index 48e33be..ad1fc43 100644 --- a/Help/command/add_compile_definitions.rst +++ b/Help/command/add_compile_definitions.rst @@ -21,7 +21,10 @@ Function-style definitions are not supported. CMake will automatically escape the value correctly for the native build system (note that CMake language syntax may require escapes to specify some values). -Arguments to ``add_compile_definitions`` may use "generator expressions" with -the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` -manual for available expressions. See the :manual:`cmake-buildsystem(7)` -manual for more on defining buildsystem properties. +.. |command_name| replace:: ``add_compile_definitions`` +.. include:: GENEX_NOTE.txt + +See Also +^^^^^^^^ + +* The command :command:`target_compile_definitions` adds target-specific definitions. diff --git a/Help/command/add_compile_options.rst b/Help/command/add_compile_options.rst index 36f403c..ad65357 100644 --- a/Help/command/add_compile_options.rst +++ b/Help/command/add_compile_options.rst @@ -14,10 +14,8 @@ directory and below. Arguments ^^^^^^^^^ -Arguments to ``add_compile_options`` may use "generator expressions" with -the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` -manual for available expressions. See the :manual:`cmake-buildsystem(7)` -manual for more on defining buildsystem properties. +.. |command_name| replace:: ``add_compile_options`` +.. include:: GENEX_NOTE.txt .. include:: OPTIONS_SHELL.txt @@ -40,12 +38,12 @@ this command is in a compiler-specific conditional clause: 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`. +* 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. +* The command :command:`target_compile_options` adds target-specific options. -The source file property :prop_sf:`COMPILE_OPTIONS` adds options to one -source file. +* The source file property :prop_sf:`COMPILE_OPTIONS` adds options to one + source file. diff --git a/Help/command/add_custom_command.rst b/Help/command/add_custom_command.rst index 99adc85..a999c2d 100644 --- a/Help/command/add_custom_command.rst +++ b/Help/command/add_custom_command.rst @@ -490,3 +490,8 @@ Ninja Multi-Config ``add_custom_command`` supports the :generator:`Ninja Multi-Config` generator's cross-config capabilities. See the generator documentation for more information. + +See Also +^^^^^^^^ + +* :command:`add_custom_target` diff --git a/Help/command/add_custom_target.rst b/Help/command/add_custom_target.rst index d8882ca..ec02ee2 100644 --- a/Help/command/add_custom_target.rst +++ b/Help/command/add_custom_target.rst @@ -181,3 +181,8 @@ Ninja Multi-Config ``add_custom_target`` supports the :generator:`Ninja Multi-Config` generator's cross-config capabilities. See the generator documentation for more information. + +See Also +^^^^^^^^ + +* :command:`add_custom_command` diff --git a/Help/command/add_definitions.rst b/Help/command/add_definitions.rst index fe69188..5c1f7b4 100644 --- a/Help/command/add_definitions.rst +++ b/Help/command/add_definitions.rst @@ -1,7 +1,7 @@ add_definitions --------------- -Add -D define flags to the compilation of source files. +Add ``-D`` define flags to the compilation of source files. .. code-block:: cmake @@ -31,5 +31,8 @@ backwards compatibility. See documentation of the properties for details on adding preprocessor definitions to specific scopes and configurations. -See the :manual:`cmake-buildsystem(7)` manual for more on defining -buildsystem properties. +See Also +^^^^^^^^ + +* The :manual:`cmake-buildsystem(7)` manual for more on defining + buildsystem properties. diff --git a/Help/command/add_dependencies.rst b/Help/command/add_dependencies.rst index 14c0183..23cb405 100644 --- a/Help/command/add_dependencies.rst +++ b/Help/command/add_dependencies.rst @@ -20,7 +20,12 @@ transitively in its place since the target itself does not build. .. versionadded:: 3.3 Allow adding dependencies to interface libraries. -See the ``DEPENDS`` option of :command:`add_custom_target` and -:command:`add_custom_command` commands for adding file-level -dependencies in custom rules. See the :prop_sf:`OBJECT_DEPENDS` -source file property to add file-level dependencies to object files. +See Also +^^^^^^^^ + +* The ``DEPENDS`` option of :command:`add_custom_target` and + :command:`add_custom_command` commands for adding file-level + dependencies in custom rules. + +* The :prop_sf:`OBJECT_DEPENDS` source file property to add + file-level dependencies to object files. diff --git a/Help/command/add_executable.rst b/Help/command/add_executable.rst index dde9429..d9ea0da 100644 --- a/Help/command/add_executable.rst +++ b/Help/command/add_executable.rst @@ -107,3 +107,8 @@ The ``<name>`` may not be used to modify properties of ``<target>``, that is, it may not be used as the operand of :command:`set_property`, :command:`set_target_properties`, :command:`target_link_libraries` etc. An ``ALIAS`` target may not be installed or exported. + +See Also +^^^^^^^^ + +* :command:`add_library` diff --git a/Help/command/add_library.rst b/Help/command/add_library.rst index 7dc4365..43cefca 100644 --- a/Help/command/add_library.rst +++ b/Help/command/add_library.rst @@ -85,8 +85,8 @@ Creates an :ref:`Object Library <Object Libraries>`. An object library compiles source files but does not archive or link their object files into a library. Instead other targets created by :command:`add_library` or :command:`add_executable` may reference the objects using an expression of the -form ``$<TARGET_OBJECTS:objlib>`` as a source, where ``objlib`` is the -object library name. For example: +form :genex:`$\<TARGET_OBJECTS:objlib\> <TARGET_OBJECTS>` as a source, where +``objlib`` is the object library name. For example: .. code-block:: cmake @@ -101,7 +101,7 @@ They may contain custom commands generating such sources, but not ``PRE_BUILD``, ``PRE_LINK``, or ``POST_BUILD`` commands. Some native build systems (such as Xcode) may not like targets that have only object files, so consider adding at least one real source file to any target that references -``$<TARGET_OBJECTS:objlib>``. +:genex:`$\<TARGET_OBJECTS:objlib\> <TARGET_OBJECTS>`. .. versionadded:: 3.12 Object libraries can be linked to with :command:`target_link_libraries`. @@ -261,3 +261,8 @@ to modify properties of ``<target>``, that is, it may not be used as the operand of :command:`set_property`, :command:`set_target_properties`, :command:`target_link_libraries` etc. An ``ALIAS`` target may not be installed or exported. + +See Also +^^^^^^^^ + +* :command:`add_executable` diff --git a/Help/command/add_link_options.rst b/Help/command/add_link_options.rst index f03e7c0..c09e106 100644 --- a/Help/command/add_link_options.rst +++ b/Help/command/add_link_options.rst @@ -23,13 +23,18 @@ exist to add libraries (:command:`target_link_libraries` or since they do not use a linker. To add archiver or MSVC librarian flags, see the :prop_tgt:`STATIC_LIBRARY_OPTIONS` target property. -Arguments to ``add_link_options`` may use "generator expressions" with -the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` -manual for available expressions. See the :manual:`cmake-buildsystem(7)` -manual for more on defining buildsystem properties. +.. |command_name| replace:: ``add_link_options`` +.. include:: GENEX_NOTE.txt .. include:: DEVICE_LINK_OPTIONS.txt .. include:: OPTIONS_SHELL.txt .. include:: LINK_OPTIONS_LINKER.txt + +See Also +^^^^^^^^ + +* :command:`link_libraries` +* :command:`target_link_libraries` +* :command:`target_link_options` diff --git a/Help/command/block.rst b/Help/command/block.rst index dfd60d4..a352e83 100644 --- a/Help/command/block.rst +++ b/Help/command/block.rst @@ -71,6 +71,6 @@ inside the block. See Also ^^^^^^^^ - * :command:`endblock` - * :command:`return` - * :command:`cmake_policy` +* :command:`endblock` +* :command:`return` +* :command:`cmake_policy` diff --git a/Help/command/build_name.rst b/Help/command/build_name.rst index 2a1fbae..5acf858 100644 --- a/Help/command/build_name.rst +++ b/Help/command/build_name.rst @@ -5,7 +5,7 @@ Disallowed since version 3.0. See CMake Policy :policy:`CMP0036`. Use ``${CMAKE_SYSTEM}`` and ``${CMAKE_CXX_COMPILER}`` instead. -:: +.. code-block:: cmake build_name(variable) diff --git a/Help/command/cmake_host_system_information.rst b/Help/command/cmake_host_system_information.rst index c84c5b5..76824ef 100644 --- a/Help/command/cmake_host_system_information.rst +++ b/Help/command/cmake_host_system_information.rst @@ -17,7 +17,7 @@ Synopsis 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 d159770..031bd56 100644 --- a/Help/command/cmake_minimum_required.rst +++ b/Help/command/cmake_minimum_required.rst @@ -79,3 +79,8 @@ invokes cmake_policy(VERSION 2.4[...<max>]) which enables compatibility features for CMake 2.4 and lower. + +See Also +^^^^^^^^ + +* :command:`cmake_policy` diff --git a/Help/command/cmake_parse_arguments.rst b/Help/command/cmake_parse_arguments.rst index 7c85da6..0bb1d91 100644 --- a/Help/command/cmake_parse_arguments.rst +++ b/Help/command/cmake_parse_arguments.rst @@ -113,3 +113,9 @@ interpreted as the beginning of the new option. E.g. is a keyword itself ``MY_INSTALL_DESTINATION`` will be empty (but added to ``MY_INSTALL_KEYWORDS_MISSING_VALUES``) and ``MY_INSTALL_OPTIONAL`` will therefore be set to ``TRUE``. + +See Also +^^^^^^^^ + +* :command:`function` +* :command:`macro` diff --git a/Help/command/cmake_path.rst b/Help/command/cmake_path.rst index eb7da07..4e6bedb 100644 --- a/Help/command/cmake_path.rst +++ b/Help/command/cmake_path.rst @@ -237,7 +237,7 @@ The following forms of the ``GET`` subcommand each retrieve a different component or group of components from a path. See `Path Structure And Terminology`_ for the meaning of each path component. -:: +.. code-block:: cmake cmake_path(GET <path-var> ROOT_NAME <out-var>) cmake_path(GET <path-var> ROOT_DIRECTORY <out-var>) @@ -408,7 +408,7 @@ meaning of each path component. .. _HAS_RELATIVE_PART: .. _HAS_PARENT_PATH: -:: +.. code-block:: cmake cmake_path(HAS_ROOT_NAME <path-var> <out-var>) cmake_path(HAS_ROOT_DIRECTORY <path-var> <out-var>) @@ -432,7 +432,7 @@ Note the following special cases: .. _IS_ABSOLUTE: -:: +.. code-block:: cmake cmake_path(IS_ABSOLUTE <path-var> <out-var>) @@ -446,7 +446,7 @@ false while ``HAS_ROOT_DIRECTORY`` can be true. .. _IS_RELATIVE: -:: +.. code-block:: cmake cmake_path(IS_RELATIVE <path-var> <out-var>) @@ -454,7 +454,7 @@ This will store the opposite of ``IS_ABSOLUTE`` in ``<out-var>``. .. _IS_PREFIX: -:: +.. code-block:: cmake cmake_path(IS_PREFIX <path-var> <input> [NORMALIZE] <out-var>) @@ -476,7 +476,7 @@ are :ref:`normalized <Normalization>` before the check. .. _Path COMPARE: .. _COMPARE: -:: +.. code-block:: cmake cmake_path(COMPARE <input1> EQUAL <input2> <out-var>) cmake_path(COMPARE <input1> NOT_EQUAL <input2> <out-var>) @@ -510,7 +510,7 @@ Modification .. _cmake_path-SET: -:: +.. code-block:: cmake cmake_path(SET <path-var> [NORMALIZE] <input>) @@ -539,7 +539,7 @@ Output:: .. _APPEND: -:: +.. code-block:: cmake cmake_path(APPEND <path-var> [<input>...] [OUTPUT_VARIABLE <out-var>]) @@ -570,7 +570,7 @@ the following algorithm (pseudo-code) applies: .. _APPEND_STRING: -:: +.. code-block:: cmake cmake_path(APPEND_STRING <path-var> [<input>...] [OUTPUT_VARIABLE <out-var>]) @@ -579,7 +579,7 @@ Append all the ``<input>`` arguments to the ``<path-var>`` without adding any .. _REMOVE_FILENAME: -:: +.. code-block:: cmake cmake_path(REMOVE_FILENAME <path-var> [OUTPUT_VARIABLE <out-var>]) @@ -609,7 +609,7 @@ Output:: .. _REPLACE_FILENAME: -:: +.. code-block:: cmake cmake_path(REPLACE_FILENAME <path-var> <input> [OUTPUT_VARIABLE <out-var>]) @@ -628,7 +628,7 @@ equivalent to the following: .. _REMOVE_EXTENSION: -:: +.. code-block:: cmake cmake_path(REMOVE_EXTENSION <path-var> [LAST_ONLY] [OUTPUT_VARIABLE <out-var>]) @@ -637,7 +637,7 @@ Removes the :ref:`extension <EXTENSION_DEF>`, if any, from ``<path-var>``. .. _REPLACE_EXTENSION: -:: +.. code-block:: cmake cmake_path(REPLACE_EXTENSION <path-var> [LAST_ONLY] <input> [OUTPUT_VARIABLE <out-var>]) @@ -661,7 +661,7 @@ Generation .. _NORMAL_PATH: -:: +.. code-block:: cmake cmake_path(NORMAL_PATH <path-var> [OUTPUT_VARIABLE <out-var>]) @@ -670,7 +670,7 @@ Normalize ``<path-var>`` according the steps described in :ref:`Normalization`. .. _cmake_path-RELATIVE_PATH: .. _RELATIVE_PATH: -:: +.. code-block:: cmake cmake_path(RELATIVE_PATH <path-var> [BASE_DIRECTORY <input>] [OUTPUT_VARIABLE <out-var>]) @@ -686,7 +686,7 @@ as that used by C++ .. _ABSOLUTE_PATH: -:: +.. code-block:: cmake cmake_path(ABSOLUTE_PATH <path-var> [BASE_DIRECTORY <input>] [NORMALIZE] [OUTPUT_VARIABLE <out-var>]) @@ -713,7 +713,7 @@ target platform when cross-compiling. .. _cmake_path-NATIVE_PATH: .. _NATIVE_PATH: -:: +.. code-block:: cmake cmake_path(NATIVE_PATH <path-var> [NORMALIZE] <out-var>) @@ -727,7 +727,7 @@ When the ``NORMALIZE`` option is specified, the path is :ref:`normalized .. _cmake_path-TO_CMAKE_PATH_LIST: .. _TO_CMAKE_PATH_LIST: -:: +.. code-block:: cmake cmake_path(CONVERT <input> TO_CMAKE_PATH_LIST <out-var> [NORMALIZE]) @@ -749,7 +749,7 @@ When the ``NORMALIZE`` option is specified, the path is :ref:`normalized .. _cmake_path-TO_NATIVE_PATH_LIST: .. _TO_NATIVE_PATH_LIST: -:: +.. code-block:: cmake cmake_path(CONVERT <input> TO_NATIVE_PATH_LIST <out-var> [NORMALIZE]) @@ -788,7 +788,7 @@ Hashing .. _HASH: -:: +.. code-block:: cmake cmake_path(HASH <path-var> <out-var>) diff --git a/Help/command/cmake_policy.rst b/Help/command/cmake_policy.rst index 54fc548..cde74a7 100644 --- a/Help/command/cmake_policy.rst +++ b/Help/command/cmake_policy.rst @@ -150,3 +150,8 @@ use the pre-record policies when they are invoked. If the function or macro implementation sets policies, the changes automatically propagate up through callers until they reach the closest nested policy stack entry. + +See Also +^^^^^^^^ + +* :command:`cmake_minimum_required` diff --git a/Help/command/configure_file.rst b/Help/command/configure_file.rst index 1d81423..7fa2941 100644 --- a/Help/command/configure_file.rst +++ b/Help/command/configure_file.rst @@ -182,3 +182,8 @@ specify the output directory as an include directory: include_directories(${CMAKE_CURRENT_BINARY_DIR}) so that sources may include the header as ``#include <foo.h>``. + +See Also +^^^^^^^^ + +* :command:`file(GENERATE)` diff --git a/Help/command/ctest_build.rst b/Help/command/ctest_build.rst index 8c81f2d..bce1739 100644 --- a/Help/command/ctest_build.rst +++ b/Help/command/ctest_build.rst @@ -3,7 +3,7 @@ ctest_build Perform the :ref:`CTest Build Step` as a :ref:`Dashboard Client`. -:: +.. code-block:: cmake ctest_build([BUILD <build-dir>] [APPEND] [CONFIGURATION <config>] diff --git a/Help/command/ctest_configure.rst b/Help/command/ctest_configure.rst index 95712aa..f23dd22 100644 --- a/Help/command/ctest_configure.rst +++ b/Help/command/ctest_configure.rst @@ -3,7 +3,7 @@ ctest_configure Perform the :ref:`CTest Configure Step` as a :ref:`Dashboard Client`. -:: +.. code-block:: cmake ctest_configure([BUILD <build-dir>] [SOURCE <source-dir>] [APPEND] [OPTIONS <options>] [RETURN_VALUE <result-var>] [QUIET] diff --git a/Help/command/ctest_coverage.rst b/Help/command/ctest_coverage.rst index a6c643b..319c978 100644 --- a/Help/command/ctest_coverage.rst +++ b/Help/command/ctest_coverage.rst @@ -3,7 +3,7 @@ ctest_coverage Perform the :ref:`CTest Coverage Step` as a :ref:`Dashboard Client`. -:: +.. code-block:: cmake ctest_coverage([BUILD <build-dir>] [APPEND] [LABELS <label>...] diff --git a/Help/command/ctest_empty_binary_directory.rst b/Help/command/ctest_empty_binary_directory.rst index 7753667..5d26de1 100644 --- a/Help/command/ctest_empty_binary_directory.rst +++ b/Help/command/ctest_empty_binary_directory.rst @@ -3,9 +3,9 @@ ctest_empty_binary_directory empties the binary directory -:: +.. code-block:: cmake - ctest_empty_binary_directory( directory ) + ctest_empty_binary_directory(<directory>) Removes a binary directory. This command will perform some checks prior to deleting the directory in an attempt to avoid malicious or diff --git a/Help/command/ctest_memcheck.rst b/Help/command/ctest_memcheck.rst index 8b79077..4ca7364 100644 --- a/Help/command/ctest_memcheck.rst +++ b/Help/command/ctest_memcheck.rst @@ -3,7 +3,7 @@ ctest_memcheck Perform the :ref:`CTest MemCheck Step` as a :ref:`Dashboard Client`. -:: +.. code-block:: cmake ctest_memcheck([BUILD <build-dir>] [APPEND] [START <start-number>] diff --git a/Help/command/ctest_read_custom_files.rst b/Help/command/ctest_read_custom_files.rst index cf8e17a..53c093e 100644 --- a/Help/command/ctest_read_custom_files.rst +++ b/Help/command/ctest_read_custom_files.rst @@ -3,9 +3,9 @@ ctest_read_custom_files read CTestCustom files. -:: +.. code-block:: cmake - ctest_read_custom_files( directory ... ) + ctest_read_custom_files(<directory>...) Read all the CTestCustom.ctest or CTestCustom.cmake files from the given directory. diff --git a/Help/command/ctest_run_script.rst b/Help/command/ctest_run_script.rst index a2b348f..145bd90 100644 --- a/Help/command/ctest_run_script.rst +++ b/Help/command/ctest_run_script.rst @@ -3,7 +3,7 @@ ctest_run_script runs a :option:`ctest -S` script -:: +.. code-block:: cmake ctest_run_script([NEW_PROCESS] script_file_name script_file_name1 script_file_name2 ... [RETURN_VALUE var]) diff --git a/Help/command/ctest_sleep.rst b/Help/command/ctest_sleep.rst index 16a914c..42b9768 100644 --- a/Help/command/ctest_sleep.rst +++ b/Help/command/ctest_sleep.rst @@ -3,13 +3,13 @@ ctest_sleep sleeps for some amount of time -:: +.. code-block:: cmake ctest_sleep(<seconds>) Sleep for given number of seconds. -:: +.. code-block:: cmake ctest_sleep(<time1> <duration> <time2>) diff --git a/Help/command/ctest_start.rst b/Help/command/ctest_start.rst index 921279a..2d68a37 100644 --- a/Help/command/ctest_start.rst +++ b/Help/command/ctest_start.rst @@ -3,7 +3,7 @@ ctest_start Starts the testing for a given model -:: +.. code-block:: cmake ctest_start(<model> [<source> [<binary>]] [GROUP <group>] [QUIET]) diff --git a/Help/command/ctest_submit.rst b/Help/command/ctest_submit.rst index d661825..3b6bf3a 100644 --- a/Help/command/ctest_submit.rst +++ b/Help/command/ctest_submit.rst @@ -3,7 +3,7 @@ ctest_submit Perform the :ref:`CTest Submit Step` as a :ref:`Dashboard Client`. -:: +.. code-block:: cmake ctest_submit([PARTS <part>...] [FILES <file>...] [SUBMIT_URL <url>] @@ -96,7 +96,7 @@ Submit to CDash Upload API .. versionadded:: 3.2 -:: +.. code-block:: cmake ctest_submit(CDASH_UPLOAD <file> [CDASH_UPLOAD_TYPE <type>] [SUBMIT_URL <url>] diff --git a/Help/command/ctest_test.rst b/Help/command/ctest_test.rst index 4f9f891..cf20ade 100644 --- a/Help/command/ctest_test.rst +++ b/Help/command/ctest_test.rst @@ -3,7 +3,7 @@ ctest_test Perform the :ref:`CTest Test Step` as a :ref:`Dashboard Client`. -:: +.. code-block:: cmake ctest_test([BUILD <build-dir>] [APPEND] [START <start-number>] @@ -30,7 +30,7 @@ Perform the :ref:`CTest Test Step` as a :ref:`Dashboard Client`. ) .. - _note: If updating the argument list here, please also update the argument + NOTE If updating the argument list here, please also update the argument list documentation for :command:`ctest_memcheck` as well. Run tests in the project build tree and store results in diff --git a/Help/command/ctest_update.rst b/Help/command/ctest_update.rst index 63f991b..836cdf1 100644 --- a/Help/command/ctest_update.rst +++ b/Help/command/ctest_update.rst @@ -3,7 +3,7 @@ ctest_update Perform the :ref:`CTest Update Step` as a :ref:`Dashboard Client`. -:: +.. code-block:: cmake ctest_update([SOURCE <source-dir>] [RETURN_VALUE <result-var>] diff --git a/Help/command/ctest_upload.rst b/Help/command/ctest_upload.rst index ffddd0a..344979a 100644 --- a/Help/command/ctest_upload.rst +++ b/Help/command/ctest_upload.rst @@ -3,7 +3,7 @@ ctest_upload Upload files to a dashboard server as a :ref:`Dashboard Client`. -:: +.. code-block:: cmake ctest_upload(FILES <file>... [QUIET] [CAPTURE_CMAKE_ERROR <result-var>]) diff --git a/Help/command/define_property.rst b/Help/command/define_property.rst index 76b060b..5278e30 100644 --- a/Help/command/define_property.rst +++ b/Help/command/define_property.rst @@ -73,3 +73,9 @@ project via corresponding options to the :command:`get_property` command. with ``CMAKE_`` or ``_CMAKE_``. The property name must contain at least one underscore. It is recommended that the property name have a prefix specific to the project. + +See Also +^^^^^^^^ + +* :command:`get_property` +* :command:`set_property` diff --git a/Help/command/exec_program.rst b/Help/command/exec_program.rst index bc9b069..983a6df 100644 --- a/Help/command/exec_program.rst +++ b/Help/command/exec_program.rst @@ -8,7 +8,7 @@ exec_program Run an executable program during the processing of the CMakeList.txt file. -:: +.. code-block:: cmake exec_program(Executable [directory in which to run] [ARGS <arguments to executable>] diff --git a/Help/command/export_library_dependencies.rst b/Help/command/export_library_dependencies.rst index 9753abf..6cb4643 100644 --- a/Help/command/export_library_dependencies.rst +++ b/Help/command/export_library_dependencies.rst @@ -15,7 +15,7 @@ The old-style library dependencies file does not take into account per-configuration names of libraries or the :prop_tgt:`LINK_INTERFACE_LIBRARIES` target property. -:: +.. code-block:: cmake export_library_dependencies(<file> [APPEND]) diff --git a/Help/command/file.rst b/Help/command/file.rst index fbe2a81..673125d 100644 --- a/Help/command/file.rst +++ b/Help/command/file.rst @@ -526,10 +526,10 @@ from the input content to produce the output content. The options are: ``OUTPUT <output-file>`` Specify the output file name to generate. Use generator expressions - such as ``$<CONFIG>`` to specify a configuration-specific output file - name. Multiple configurations may generate the same output file only - if the generated content is identical. Otherwise, the ``<output-file>`` - must evaluate to an unique name for each configuration. + such as :genex:`$<CONFIG>` to specify a configuration-specific + output file name. Multiple configurations may generate the same output + file only if the generated content is identical. Otherwise, the + ``<output-file>`` must evaluate to an unique name for each configuration. .. versionchanged:: 3.10 A relative path (after evaluating generator expressions) is treated @@ -540,8 +540,9 @@ from the input content to produce the output content. The options are: .. versionadded:: 3.19 Specify which target to use when evaluating generator expressions that - require a target for evaluation (e.g. ``$<COMPILE_FEATURES:...>``, - ``$<TARGET_PROPERTY:prop>``). + require a target for evaluation (e.g. + :genex:`$<COMPILE_FEATURES:...>`, + :genex:`$<TARGET_PROPERTY:prop>`). ``NO_SOURCE_PERMISSIONS`` .. versionadded:: 3.20 diff --git a/Help/command/foreach.rst b/Help/command/foreach.rst index ddf8dfa..c3fdbf7 100644 --- a/Help/command/foreach.rst +++ b/Help/command/foreach.rst @@ -74,8 +74,7 @@ processed: message(STATUS "X=${X}") endforeach() -yields -:: +yields:: -- X=0 -- X=1 @@ -119,8 +118,7 @@ iteration variables as follows: message(STATUS "en=${en}, ba=${ba}") endforeach() -yields -:: +yields:: -- num_0=one, num_1=satu -- num_0=two, num_1=dua diff --git a/Help/command/function.rst b/Help/command/function.rst index fc55c03..069f9fa 100644 --- a/Help/command/function.rst +++ b/Help/command/function.rst @@ -77,5 +77,6 @@ extra argument. See Also ^^^^^^^^ +* :command:`cmake_parse_arguments` * :command:`endfunction` * :command:`return` diff --git a/Help/command/get_cmake_property.rst b/Help/command/get_cmake_property.rst index 96764a3..b1d18a0 100644 --- a/Help/command/get_cmake_property.rst +++ b/Help/command/get_cmake_property.rst @@ -12,9 +12,12 @@ 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. - In addition to global properties, this command (for historical reasons) also supports the :prop_dir:`VARIABLES` and :prop_dir:`MACROS` directory properties. It also supports a special ``COMPONENTS`` global property that lists the components given to the :command:`install` command. + +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 0ccbfb0..209d2f8 100644 --- a/Help/command/get_directory_property.rst +++ b/Help/command/get_directory_property.rst @@ -33,4 +33,9 @@ the search will chain to a parent scope as described for the Get a variable definition from a directory. This form is useful to get a variable definition from another directory. -See also the more general :command:`get_property` command. + +See Also +^^^^^^^^ + +* :command:`define_property` +* the more general :command:`get_property` command diff --git a/Help/command/get_filename_component.rst b/Help/command/get_filename_component.rst index 4bfe087..899ede6 100644 --- a/Help/command/get_filename_component.rst +++ b/Help/command/get_filename_component.rst @@ -69,3 +69,8 @@ left as a full path. If ``PROGRAM_ARGS`` is present with ``PROGRAM``, then any command-line arguments present in the ``<FileName>`` string are split from the program name and stored in ``<arg_var>``. This is used to separate a program name from its arguments in a command line string. + +See Also +^^^^^^^^ + +* :command:`cmake_path` diff --git a/Help/command/get_property.rst b/Help/command/get_property.rst index 46da285..6b9931e 100644 --- a/Help/command/get_property.rst +++ b/Help/command/get_property.rst @@ -99,3 +99,9 @@ documentation is requested for a property that has not been defined The :prop_sf:`GENERATED` source file property may be globally visible. See its documentation for details. + +See Also +^^^^^^^^ + +* :command:`define_property` +* :command:`set_property` diff --git a/Help/command/get_source_file_property.rst b/Help/command/get_source_file_property.rst index ae41565..e83e9c2 100644 --- a/Help/command/get_source_file_property.rst +++ b/Help/command/get_source_file_property.rst @@ -39,9 +39,14 @@ Use :command:`set_source_files_properties` to set property values. Source file properties usually control how the file is built. One property that is always there is :prop_sf:`LOCATION`. -See also the more general :command:`get_property` command. - .. note:: The :prop_sf:`GENERATED` source file property may be globally visible. See its documentation for details. + +See Also +^^^^^^^^ + +* :command:`define_property` +* the more general :command:`get_property` command +* :command:`set_source_files_properties` diff --git a/Help/command/get_target_property.rst b/Help/command/get_target_property.rst index 985b1ff..8c6dcb1 100644 --- a/Help/command/get_target_property.rst +++ b/Help/command/get_target_property.rst @@ -22,6 +22,10 @@ query the target instead. This command can get properties for any 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 Also +^^^^^^^^ -See :ref:`Target Properties` for the list of properties known to CMake. +* :command:`define_property` +* the more general :command:`get_property` command +* :command:`set_target_properties` +* :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 6bcc1ef..2b6f354 100644 --- a/Help/command/get_test_property.rst +++ b/Help/command/get_test_property.rst @@ -19,4 +19,8 @@ an empty string. For a list of standard properties you can type :option:`cmake --help-property-list`. -See also the more general :command:`get_property` command. +See Also +^^^^^^^^ + +* :command:`define_property` +* the more general :command:`get_property` command diff --git a/Help/command/if.rst b/Help/command/if.rst index b72769f..a57630b 100644 --- a/Help/command/if.rst +++ b/Help/command/if.rst @@ -428,6 +428,6 @@ condition syntax accepts ``<variable|string>``. See also ^^^^^^^^ - * :command:`else` - * :command:`elseif` - * :command:`endif` +* :command:`else` +* :command:`elseif` +* :command:`endif` diff --git a/Help/command/include_directories.rst b/Help/command/include_directories.rst index fe281c3..d2948ed 100644 --- a/Help/command/include_directories.rst +++ b/Help/command/include_directories.rst @@ -29,13 +29,16 @@ Signalling this setting might achieve effects such as the compiler skipping warnings, or these fixed-install system files not being considered in dependency calculations - see compiler docs. -Arguments to ``include_directories`` may use "generator expressions" with -the syntax "$<...>". See the :manual:`cmake-generator-expressions(7)` -manual for available expressions. See the :manual:`cmake-buildsystem(7)` -manual for more on defining buildsystem properties. +.. |command_name| replace:: ``include_directories`` +.. include:: GENEX_NOTE.txt .. note:: Prefer the :command:`target_include_directories` command to add include directories to individual targets and optionally propagate/export them to dependents. + +See Also +^^^^^^^^ + +* :command:`target_include_directories` diff --git a/Help/command/install.rst b/Help/command/install.rst index feff436..d036a20 100644 --- a/Help/command/install.rst +++ b/Help/command/install.rst @@ -379,7 +379,7 @@ top level: :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` target property of the ``<targets>`` when exported by the `install(EXPORT)`_ command. If a relative path is specified, it is treated as relative to the - ``$<INSTALL_PREFIX>``. + :genex:`$<INSTALL_PREFIX>`. ``RUNTIME_DEPENDENCY_SET`` .. versionadded:: 3.21 diff --git a/Help/command/install_files.rst b/Help/command/install_files.rst index 494f3d0..9b19124 100644 --- a/Help/command/install_files.rst +++ b/Help/command/install_files.rst @@ -11,7 +11,7 @@ directly replaced by the ``FILES`` form of the :command:`install` command. The regexp form can be expressed more clearly using the ``GLOB`` form of the :command:`file` command. -:: +.. code-block:: cmake install_files(<dir> extension file file ...) @@ -23,14 +23,14 @@ removed first. This is useful for providing lists of source files such as foo.cxx when you want the corresponding foo.h to be installed. A typical extension is ``.h``. -:: +.. code-block:: cmake install_files(<dir> regexp) Any files in the current source directory that match the regular expression will be installed. -:: +.. code-block:: cmake install_files(<dir> FILES file file ...) diff --git a/Help/command/install_programs.rst b/Help/command/install_programs.rst index eafae89..5b42904 100644 --- a/Help/command/install_programs.rst +++ b/Help/command/install_programs.rst @@ -11,7 +11,7 @@ directly replaced by the ``PROGRAMS`` form of the :command:`install` command. The regexp form can be expressed more clearly using the ``GLOB`` form of the :command:`file` command. -:: +.. code-block:: cmake install_programs(<dir> file1 file2 [file3 ...]) install_programs(<dir> FILES file1 [file2 ...]) @@ -20,7 +20,7 @@ Create rules to install the listed programs into the given directory. Use the ``FILES`` argument to guarantee that the file list version of the command will be used even when there is only one argument. -:: +.. code-block:: cmake install_programs(<dir> regexp) diff --git a/Help/command/install_targets.rst b/Help/command/install_targets.rst index 9355f8d..7653776 100644 --- a/Help/command/install_targets.rst +++ b/Help/command/install_targets.rst @@ -8,7 +8,7 @@ install_targets This command has been superseded by the :command:`install` command. It is provided for compatibility with older CMake code. -:: +.. code-block:: cmake install_targets(<dir> [RUNTIME_DIRECTORY dir] target target) diff --git a/Help/command/link_directories.rst b/Help/command/link_directories.rst index 6732402..5e7fc39 100644 --- a/Help/command/link_directories.rst +++ b/Help/command/link_directories.rst @@ -53,3 +53,9 @@ The command will apply only to targets created after it is called. where possible by using the :command:`target_link_directories` command rather than ``link_directories()``. The target-specific command can also control how the search directories propagate to other dependent targets. + +See Also +^^^^^^^^ + +* :command:`target_link_directories` +* :command:`target_link_libraries` diff --git a/Help/command/load_command.rst b/Help/command/load_command.rst index dc23599..4b3888f 100644 --- a/Help/command/load_command.rst +++ b/Help/command/load_command.rst @@ -5,7 +5,7 @@ Disallowed since version 3.0. See CMake Policy :policy:`CMP0031`. Load a command into a running CMake. -:: +.. code-block:: cmake load_command(COMMAND_NAME <loc1> [loc2 ...]) @@ -15,7 +15,7 @@ added to the set of available CMake commands. Usually, :command:`try_compile` is used before this command to compile the module. If the command is successfully loaded a variable named -:: +.. code-block:: cmake CMAKE_LOADED_COMMAND_<COMMAND_NAME> diff --git a/Help/command/macro.rst b/Help/command/macro.rst index 5fe4c00..2858622 100644 --- a/Help/command/macro.rst +++ b/Help/command/macro.rst @@ -149,3 +149,9 @@ existing variable instead of the arguments. For example: 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. + +See Also +^^^^^^^^ + +* :command:`cmake_parse_arguments` +* :command:`endmacro` diff --git a/Help/command/make_directory.rst b/Help/command/make_directory.rst index 8469b0a..959749d 100644 --- a/Help/command/make_directory.rst +++ b/Help/command/make_directory.rst @@ -5,7 +5,7 @@ make_directory Use the :command:`file(MAKE_DIRECTORY)` command instead. -:: +.. code-block:: cmake make_directory(directory) diff --git a/Help/command/message.rst b/Help/command/message.rst index 77d21c8..9ac4277 100644 --- a/Help/command/message.rst +++ b/Help/command/message.rst @@ -193,3 +193,8 @@ Output from the above would appear something like the following:: -- Finding partB -- Finding partB - not found -- Finding my things - missing components: B + +See Also +^^^^^^^^ + +* :command:`cmake_language(GET_MESSAGE_LOG_LEVEL)` diff --git a/Help/command/output_required_files.rst b/Help/command/output_required_files.rst index b3a6e86..fbe5dbd 100644 --- a/Help/command/output_required_files.rst +++ b/Help/command/output_required_files.rst @@ -9,7 +9,7 @@ This command exists only because ancient CMake versions provided it. CMake handles preprocessor dependency scanning automatically using a more advanced scanner. -:: +.. code-block:: cmake output_required_files(srcfile outputfile) diff --git a/Help/command/project.rst b/Help/command/project.rst index 8f32fa3..4e57d09 100644 --- a/Help/command/project.rst +++ b/Help/command/project.rst @@ -188,5 +188,6 @@ call exists, CMake will issue a warning and pretend there is a Call the ``project()`` command near the top of the top-level ``CMakeLists.txt``, but *after* calling :command:`cmake_minimum_required`. It is important to establish version and policy settings before invoking - other commands whose behavior they may affect. + other commands whose behavior they may affect and for this reason the + ``project()`` command will issue a warning if this order is not kept. See also policy :policy:`CMP0000`. diff --git a/Help/command/remove.rst b/Help/command/remove.rst index 543d016..e12a937 100644 --- a/Help/command/remove.rst +++ b/Help/command/remove.rst @@ -5,7 +5,7 @@ remove Use the :command:`list(REMOVE_ITEM)` command instead. -:: +.. code-block:: cmake remove(VAR VALUE VALUE ...) diff --git a/Help/command/return.rst b/Help/command/return.rst index 3013b52..795dbeb 100644 --- a/Help/command/return.rst +++ b/Help/command/return.rst @@ -88,4 +88,5 @@ command. All arguments are ignored unless that policy is set to ``NEW``. See Also ^^^^^^^^ - * :command:`block` +* :command:`block` +* :command:`function` diff --git a/Help/command/set.rst b/Help/command/set.rst index 90b57d2..c724844 100644 --- a/Help/command/set.rst +++ b/Help/command/set.rst @@ -111,3 +111,8 @@ environment variable. Arguments after ``<value>`` are ignored. If extra arguments are found, then an author warning is issued. + +See Also +^^^^^^^^ + +* :command:`unset` diff --git a/Help/command/set_directory_properties.rst b/Help/command/set_directory_properties.rst index f02a8e6..93ad39b 100644 --- a/Help/command/set_directory_properties.rst +++ b/Help/command/set_directory_properties.rst @@ -13,3 +13,10 @@ 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. + +See Also +^^^^^^^^ + +* :command:`define_property` +* :command:`get_directory_property` +* the more general :command:`set_property` command diff --git a/Help/command/set_property.rst b/Help/command/set_property.rst index b9b12c4..d446a2d 100644 --- a/Help/command/set_property.rst +++ b/Help/command/set_property.rst @@ -107,10 +107,15 @@ finding the initial value to append to. If the property is not already directly set in the nominated scope, the command will behave as though ``APPEND`` or ``APPEND_STRING`` had not been given. -See the :manual:`cmake-properties(7)` manual for a list of properties -in each scope. - .. note:: The :prop_sf:`GENERATED` source file property may be globally visible. See its documentation for details. + +See Also +^^^^^^^^ + +* :command:`define_property` +* :command:`get_property` +* The :manual:`cmake-properties(7)` manual for a list of properties + in each scope. diff --git a/Help/command/set_source_files_properties.rst b/Help/command/set_source_files_properties.rst index 61c69a2..d937b33 100644 --- a/Help/command/set_source_files_properties.rst +++ b/Help/command/set_source_files_properties.rst @@ -34,10 +34,15 @@ list. Use :command:`get_source_file_property` to get property values. See also the :command:`set_property(SOURCE)` command. -See :ref:`Source File Properties` for the list of properties known -to CMake. - .. note:: The :prop_sf:`GENERATED` source file property may be globally visible. See its documentation for details. + +See Also +^^^^^^^^ + +* :command:`define_property` +* :command:`get_source_file_property` +* :ref:`Source File Properties` for the list of properties known + to CMake diff --git a/Help/command/set_target_properties.rst b/Help/command/set_target_properties.rst index 597be23..856b92c 100644 --- a/Help/command/set_target_properties.rst +++ b/Help/command/set_target_properties.rst @@ -15,6 +15,10 @@ 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` command. -See also the :command:`set_property(TARGET)` command. +See Also +^^^^^^^^ -See :ref:`Target Properties` for the list of properties known to CMake. +* :command:`define_property` +* :command:`get_target_property` +* the more general :command:`set_property` command +* :ref:`Target Properties` for the list of properties known to CMake diff --git a/Help/command/set_tests_properties.rst b/Help/command/set_tests_properties.rst index eadde33..125e460 100644 --- a/Help/command/set_tests_properties.rst +++ b/Help/command/set_tests_properties.rst @@ -14,6 +14,10 @@ Test property values may be specified using :manual:`generator expressions <cmake-generator-expressions(7)>` for tests created by the :command:`add_test(NAME)` signature. -See also the :command:`set_property(TEST)` command. +See Also +^^^^^^^^ -See :ref:`Test Properties` for the list of properties known to CMake. +* :command:`add_test` +* :command:`define_property` +* the more general :command:`set_property` command +* :ref:`Target Properties` for the list of properties known to CMake diff --git a/Help/command/string.rst b/Help/command/string.rst index 86cbd2e..217157c 100644 --- a/Help/command/string.rst +++ b/Help/command/string.rst @@ -522,6 +522,17 @@ specifiers: ``%Y`` The current year. +``%z`` + .. versionadded:: 3.26 + + The offset of the time zone from UTC, in hours and minutes, + with format ``+hhmm`` or ``-hhmm``. + +``%Z`` + .. versionadded:: 3.26 + + The time zone name. + Unknown format specifiers will be ignored and copied to the output as-is. diff --git a/Help/command/subdir_depends.rst b/Help/command/subdir_depends.rst index 0c1b3c1..2115b33 100644 --- a/Help/command/subdir_depends.rst +++ b/Help/command/subdir_depends.rst @@ -5,7 +5,7 @@ Disallowed since version 3.0. See CMake Policy :policy:`CMP0029`. Does nothing. -:: +.. code-block:: cmake subdir_depends(subdir dep1 dep2 ...) diff --git a/Help/command/subdirs.rst b/Help/command/subdirs.rst index 530951b..ecc6d1f 100644 --- a/Help/command/subdirs.rst +++ b/Help/command/subdirs.rst @@ -7,7 +7,7 @@ subdirs Add a list of subdirectories to the build. -:: +.. code-block:: cmake subdirs(dir1 dir2 ...[EXCLUDE_FROM_ALL exclude_dir1 exclude_dir2 ...] [PREORDER] ) diff --git a/Help/command/target_compile_definitions.rst b/Help/command/target_compile_definitions.rst index 2d292af..2290efb 100644 --- a/Help/command/target_compile_definitions.rst +++ b/Help/command/target_compile_definitions.rst @@ -25,10 +25,8 @@ same ``<target>`` append items in the order called. .. versionadded:: 3.11 Allow setting ``INTERFACE`` items on :ref:`IMPORTED targets <Imported Targets>`. -Arguments to ``target_compile_definitions`` may use "generator expressions" -with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` -manual for available expressions. See the :manual:`cmake-buildsystem(7)` -manual for more on defining buildsystem properties. +.. |command_name| replace:: ``target_compile_definitions`` +.. include:: GENEX_NOTE.txt Any leading ``-D`` on an item will be removed. Empty items are ignored. For example, the following are all equivalent: @@ -48,3 +46,16 @@ Definitions may optionally have values: Note that many compilers treat ``-DFOO`` as equivalent to ``-DFOO=1``, but other tools may not recognize this in all circumstances (e.g. IntelliSense). + +See Also +^^^^^^^^ + +* :command:`add_compile_definitions` +* :command:`target_compile_features` +* :command:`target_compile_options` +* :command:`target_include_directories` +* :command:`target_link_libraries` +* :command:`target_link_directories` +* :command:`target_link_options` +* :command:`target_precompile_headers` +* :command:`target_sources` diff --git a/Help/command/target_compile_features.rst b/Help/command/target_compile_features.rst index 58502bf..531af81 100644 --- a/Help/command/target_compile_features.rst +++ b/Help/command/target_compile_features.rst @@ -30,8 +30,20 @@ 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>`. -Arguments to ``target_compile_features`` may use "generator expressions" -with the syntax ``$<...>``. -See the :manual:`cmake-generator-expressions(7)` manual for available -expressions. See the :manual:`cmake-compile-features(7)` manual for -information on compile features and a list of supported compilers. +.. |command_name| replace:: ``target_compile_features`` +.. |more_see_also| replace:: See the :manual:`cmake-compile-features(7)` + manual for information on compile features and a list of supported compilers. +.. include:: GENEX_NOTE.txt + :start-line: 1 + +See Also +^^^^^^^^ + +* :command:`target_compile_definitions` +* :command:`target_compile_options` +* :command:`target_include_directories` +* :command:`target_link_libraries` +* :command:`target_link_directories` +* :command:`target_link_options` +* :command:`target_precompile_headers` +* :command:`target_sources` diff --git a/Help/command/target_compile_options.rst b/Help/command/target_compile_options.rst index 0d86c91..8f13f45 100644 --- a/Help/command/target_compile_options.rst +++ b/Help/command/target_compile_options.rst @@ -32,21 +32,26 @@ The following arguments specify compile options. Repeated calls for the same .. versionadded:: 3.11 Allow setting ``INTERFACE`` items on :ref:`IMPORTED targets <Imported Targets>`. -Arguments to ``target_compile_options`` may use "generator expressions" -with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` -manual for available expressions. See the :manual:`cmake-buildsystem(7)` -manual for more on defining buildsystem properties. +.. |command_name| replace:: ``target_compile_options`` +.. include:: GENEX_NOTE.txt .. 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`. +* 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`. +* For directory-wide settings, there is the command :command:`add_compile_options`. -For file-specific settings, there is the source file property :prop_sf:`COMPILE_OPTIONS`. +* For file-specific settings, there is the source file property :prop_sf:`COMPILE_OPTIONS`. + +* :command:`target_compile_features` +* :command:`target_link_libraries` +* :command:`target_link_directories` +* :command:`target_link_options` +* :command:`target_precompile_headers` +* :command:`target_sources` diff --git a/Help/command/target_include_directories.rst b/Help/command/target_include_directories.rst index f13ff29..2a410ec 100644 --- a/Help/command/target_include_directories.rst +++ b/Help/command/target_include_directories.rst @@ -40,10 +40,8 @@ If ``SYSTEM`` is used together with ``PUBLIC`` or ``INTERFACE``, the :prop_tgt:`INTERFACE_SYSTEM_INCLUDE_DIRECTORIES` target property will be populated with the specified directories. -Arguments to ``target_include_directories`` may use "generator expressions" -with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` -manual for available expressions. See the :manual:`cmake-buildsystem(7)` -manual for more on defining buildsystem properties. +.. |command_name| replace:: ``target_include_directories`` +.. include:: GENEX_NOTE.txt Specified include directories may be absolute paths or relative paths. A relative path will be interpreted as relative to the current source @@ -74,3 +72,16 @@ Creating Relocatable Packages .. |INTERFACE_PROPERTY_LINK| replace:: :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` .. include:: /include/INTERFACE_INCLUDE_DIRECTORIES_WARNING.txt + +See Also +^^^^^^^^ + +* :command:`include_directories` +* :command:`target_compile_definitions` +* :command:`target_compile_features` +* :command:`target_compile_options` +* :command:`target_link_libraries` +* :command:`target_link_directories` +* :command:`target_link_options` +* :command:`target_precompile_headers` +* :command:`target_sources` diff --git a/Help/command/target_link_directories.rst b/Help/command/target_link_directories.rst index b72f746..2854c96 100644 --- a/Help/command/target_link_directories.rst +++ b/Help/command/target_link_directories.rst @@ -34,10 +34,8 @@ calls for the same ``<target>`` append items in the order called. If ``BEFORE`` is specified, the content will be prepended to the relevant property instead of being appended. -Arguments to ``target_link_directories`` may use "generator expressions" -with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` -manual for available expressions. See the :manual:`cmake-buildsystem(7)` -manual for more on defining buildsystem properties. +.. |command_name| replace:: ``target_link_directories`` +.. include:: GENEX_NOTE.txt .. note:: @@ -56,3 +54,16 @@ manual for more on defining buildsystem properties. that expect to be found via ``RPATH`` mechanisms, but some linkers are not able to fully decode those paths (e.g. due to the presence of things like ``$ORIGIN``). + +See Also +^^^^^^^^ + +* :command:`link_directories` +* :command:`target_compile_definitions` +* :command:`target_compile_features` +* :command:`target_compile_options` +* :command:`target_include_directories` +* :command:`target_link_libraries` +* :command:`target_link_options` +* :command:`target_precompile_headers` +* :command:`target_sources` diff --git a/Help/command/target_link_libraries.rst b/Help/command/target_link_libraries.rst index bb7b5cc..1d27660 100644 --- a/Help/command/target_link_libraries.rst +++ b/Help/command/target_link_libraries.rst @@ -293,8 +293,8 @@ will be included in the link too. .. _`Linking Object Libraries via $<TARGET_OBJECTS>`: -Linking Object Libraries via $<TARGET_OBJECTS> -"""""""""""""""""""""""""""""""""""""""""""""" +Linking Object Libraries via ``$<TARGET_OBJECTS>`` +"""""""""""""""""""""""""""""""""""""""""""""""""" .. versionadded:: 3.21 @@ -407,3 +407,15 @@ Creating Relocatable Packages .. |INTERFACE_PROPERTY_LINK| replace:: :prop_tgt:`INTERFACE_LINK_LIBRARIES` .. include:: /include/INTERFACE_LINK_LIBRARIES_WARNING.txt + +See Also +^^^^^^^^ + +* :command:`target_compile_definitions` +* :command:`target_compile_features` +* :command:`target_compile_options` +* :command:`target_include_directories` +* :command:`target_link_directories` +* :command:`target_link_options` +* :command:`target_precompile_headers` +* :command:`target_sources` diff --git a/Help/command/target_link_options.rst b/Help/command/target_link_options.rst index 3cd0e64..0d026f2 100644 --- a/Help/command/target_link_options.rst +++ b/Help/command/target_link_options.rst @@ -42,13 +42,23 @@ The following arguments specify link options. Repeated calls for the same .. note:: :ref:`IMPORTED targets <Imported Targets>` only support ``INTERFACE`` items. -Arguments to ``target_link_options`` may use "generator expressions" -with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` -manual for available expressions. See the :manual:`cmake-buildsystem(7)` -manual for more on defining buildsystem properties. +.. |command_name| replace:: ``target_link_options`` +.. include:: GENEX_NOTE.txt .. include:: DEVICE_LINK_OPTIONS.txt .. include:: OPTIONS_SHELL.txt .. include:: LINK_OPTIONS_LINKER.txt + +See Also +^^^^^^^^ + +* :command:`target_compile_definitions` +* :command:`target_compile_features` +* :command:`target_compile_options` +* :command:`target_include_directories` +* :command:`target_link_libraries` +* :command:`target_link_directories` +* :command:`target_precompile_headers` +* :command:`target_sources` diff --git a/Help/command/target_precompile_headers.rst b/Help/command/target_precompile_headers.rst index 84f5d12..8e5c0e9 100644 --- a/Help/command/target_precompile_headers.rst +++ b/Help/command/target_precompile_headers.rst @@ -70,17 +70,16 @@ included by absolute path. For example: <unordered_map> ) -Arguments to ``target_precompile_headers()`` may use "generator expressions" -with the syntax ``$<...>``. -See the :manual:`cmake-generator-expressions(7)` manual for available -expressions. -The :genex:`$<COMPILE_LANGUAGE:...>` generator expression is particularly -useful for specifying a language-specific header to precompile for -only one language (e.g. ``CXX`` and not ``C``). In this case, header -file names that are not explicitly in double quotes or angle brackets -must be specified by absolute path. Also, when specifying angle brackets -inside a generator expression, be sure to encode the closing ``>`` as -``$<ANGLE-R>``. For example: +.. |command_name| replace:: ``target_compile_features`` +.. |more_see_also| replace:: The :genex:`$<COMPILE_LANGUAGE:...>` generator + expression is particularly useful for specifying a language-specific header + to precompile for only one language (e.g. ``CXX`` and not ``C``). In this + case, header file names that are not explicitly in double quotes or angle + brackets must be specified by absolute path. Also, when specifying angle + brackets inside a generator expression, be sure to encode the closing + ``>`` as :genex:`$<ANGLE-R>`. For example: +.. include:: GENEX_NOTE.txt + :start-line: 1 .. code-block:: cmake @@ -118,8 +117,17 @@ the ``REUSE_FROM`` form is used. See Also ^^^^^^^^ -To disable precompile headers for specific targets, see the -:prop_tgt:`DISABLE_PRECOMPILE_HEADERS` target property. +* To disable precompile headers for specific targets, see the + :prop_tgt:`DISABLE_PRECOMPILE_HEADERS` target property. -To prevent precompile headers from being used when compiling a specific -source file, see the :prop_sf:`SKIP_PRECOMPILE_HEADERS` source file property. +* To prevent precompile headers from being used when compiling a specific + source file, see the :prop_sf:`SKIP_PRECOMPILE_HEADERS` source file property. + +* :command:`target_compile_definitions` +* :command:`target_compile_features` +* :command:`target_compile_options` +* :command:`target_include_directories` +* :command:`target_link_libraries` +* :command:`target_link_directories` +* :command:`target_link_options` +* :command:`target_sources` diff --git a/Help/command/target_sources.rst b/Help/command/target_sources.rst index 461175a..5d07f54 100644 --- a/Help/command/target_sources.rst +++ b/Help/command/target_sources.rst @@ -202,3 +202,17 @@ Target properties related to include directories are also modified by of the file set is ``INTERFACE`` or ``PUBLIC``, all of the ``BASE_DIRS`` of the file set are wrapped in :genex:`$<BUILD_INTERFACE>` and appended to this property. + +See Also +^^^^^^^^ + +* :command:`add_executable` +* :command:`add_library` +* :command:`target_compile_definitions` +* :command:`target_compile_features` +* :command:`target_compile_options` +* :command:`target_include_directories` +* :command:`target_link_libraries` +* :command:`target_link_directories` +* :command:`target_link_options` +* :command:`target_precompile_headers` diff --git a/Help/command/try_compile.rst b/Help/command/try_compile.rst index 9e9f39f..6ae245f 100644 --- a/Help/command/try_compile.rst +++ b/Help/command/try_compile.rst @@ -105,9 +105,9 @@ contain something like the following: CMake automatically generates, for each ``try_compile`` operation, a unique directory under ``${CMAKE_BINARY_DIR}/CMakeFiles/CMakeScratch`` with an unspecified name. These directories are cleaned automatically unless -:option:`--debug-trycompile <cmake --debug-trycompile>` is passed to ``cmake``. +:option:`--debug-trycompile <cmake --debug-trycompile>` is passed to :program:`cmake`. Such directories from previous runs are also unconditionally cleaned at the -beginning of any ``cmake`` execution. +beginning of any :program:`cmake` execution. This command also supports an alternate signature which was present in older versions of CMake: @@ -130,7 +130,7 @@ which was present in older versions of CMake: In this version, ``try_compile`` will use ``<bindir>/CMakeFiles/CMakeTmp`` for its operation, and all such files will be cleaned automatically. For debugging, :option:`--debug-trycompile <cmake --debug-trycompile>` can be -passed to ``cmake`` to avoid this clean. However, multiple sequential +passed to :program:`cmake` to avoid this clean. However, multiple sequential ``try_compile`` operations, if given the same ``<bindir>``, will reuse this single output directory, such that you can only debug one such ``try_compile`` call at a time. Use of the newer signature is recommended to simplify @@ -327,3 +327,8 @@ a build configuration. If :policy:`CMP0141` is set to ``NEW``, one can use :variable:`CMAKE_MSVC_DEBUG_INFORMATION_FORMAT` to specify the MSVC debug information format. + +See Also +^^^^^^^^ + +* :command:`try_run` diff --git a/Help/command/unset.rst b/Help/command/unset.rst index 7521052..1cd1398 100644 --- a/Help/command/unset.rst +++ b/Help/command/unset.rst @@ -39,3 +39,8 @@ Subsequent calls of ``$ENV{<variable>}`` will return the empty string. 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. + +See Also +^^^^^^^^ + +* :command:`set` diff --git a/Help/command/use_mangled_mesa.rst b/Help/command/use_mangled_mesa.rst index 5b0e2ee..bc84bb3 100644 --- a/Help/command/use_mangled_mesa.rst +++ b/Help/command/use_mangled_mesa.rst @@ -5,7 +5,7 @@ Disallowed since version 3.0. See CMake Policy :policy:`CMP0030`. Copy mesa headers for use in combination with system GL. -:: +.. code-block:: cmake use_mangled_mesa(PATH_TO_MESA OUTPUT_DIRECTORY) diff --git a/Help/command/utility_source.rst b/Help/command/utility_source.rst index 94d6a4e..3c2bf39 100644 --- a/Help/command/utility_source.rst +++ b/Help/command/utility_source.rst @@ -5,7 +5,7 @@ Disallowed since version 3.0. See CMake Policy :policy:`CMP0034`. Specify the source tree of a third-party utility. -:: +.. code-block:: cmake utility_source(cache_entry executable_name path_to_source [file1 file2 ...]) diff --git a/Help/command/variable_requires.rst b/Help/command/variable_requires.rst index 322b154..1dbb02d 100644 --- a/Help/command/variable_requires.rst +++ b/Help/command/variable_requires.rst @@ -7,7 +7,7 @@ Use the :command:`if` command instead. Assert satisfaction of an option's required variables. -:: +.. code-block:: cmake variable_requires(TEST_VARIABLE RESULT_VARIABLE REQUIRED_VARIABLE1 diff --git a/Help/command/while.rst b/Help/command/while.rst index 0bafae5..cb0fa2d 100644 --- a/Help/command/while.rst +++ b/Help/command/while.rst @@ -27,7 +27,7 @@ If used, it must be a verbatim repeat of the argument of the opening See Also ^^^^^^^^ - * :command:`break` - * :command:`continue` - * :command:`foreach` - * :command:`endwhile` +* :command:`break` +* :command:`continue` +* :command:`foreach` +* :command:`endwhile` diff --git a/Help/command/write_file.rst b/Help/command/write_file.rst index 4d476bd..4d0bc63 100644 --- a/Help/command/write_file.rst +++ b/Help/command/write_file.rst @@ -5,7 +5,7 @@ write_file Use the :command:`file(WRITE)` command instead. -:: +.. code-block:: cmake write_file(filename "message to write"... [APPEND]) diff --git a/Help/envvar/ASM_DIALECT.rst b/Help/envvar/ASM_DIALECT.rst index c89515e..11dbe5a 100644 --- a/Help/envvar/ASM_DIALECT.rst +++ b/Help/envvar/ASM_DIALECT.rst @@ -4,8 +4,14 @@ ASM<DIALECT> .. include:: ENV_VAR.txt Preferred executable for compiling a specific dialect of assembly language -files. ``ASM<DIALECT>`` can be ``ASM``, ``ASM_NASM`` (Netwide Assembler), -``ASM_MASM`` (Microsoft Assembler) or ``ASM-ATT`` (Assembler AT&T). +files. ``ASM<DIALECT>`` can be one of: + +* ``ASM`` +* ``ASM_NASM`` (Netwide Assembler) +* ``ASM_MASM`` (Microsoft Assembler) +* ``ASM_MARMASM`` (Microsoft ARM Assembler) +* ``ASM-ATT`` (Assembler AT&T) + Will only be used by CMake on the first configuration to determine ``ASM<DIALECT>`` compiler, after which the value for ``ASM<DIALECT>`` is stored in the cache as diff --git a/Help/envvar/ASM_DIALECTFLAGS.rst b/Help/envvar/ASM_DIALECTFLAGS.rst index 2af4b58..f13efbb 100644 --- a/Help/envvar/ASM_DIALECTFLAGS.rst +++ b/Help/envvar/ASM_DIALECTFLAGS.rst @@ -9,6 +9,7 @@ of an assembly language. ``ASM<DIALECT>FLAGS`` can be one of: * ``ASMFLAGS`` * ``ASM_NASMFLAGS`` * ``ASM_MASMFLAGS`` +* ``ASM_MARMASMFLAGS`` * ``ASM-ATTFLAGS`` .. |CMAKE_LANG_FLAGS| replace:: :variable:`CMAKE_ASM<DIALECT>_FLAGS <CMAKE_<LANG>_FLAGS>` diff --git a/Help/generator/Ninja Multi-Config.rst b/Help/generator/Ninja Multi-Config.rst index 2cf823a..f669ad4 100644 --- a/Help/generator/Ninja Multi-Config.rst +++ b/Help/generator/Ninja Multi-Config.rst @@ -106,14 +106,14 @@ If either ``OUTPUT`` or ``BYPRODUCTS`` names a path that is common to more than one configuration (e.g. it does not use any generator expressions), all arguments are evaluated in the command config by default. If all ``OUTPUT`` and ``BYPRODUCTS`` paths are unique to each configuration -(e.g. by using the ``$<CONFIG>`` generator expression), the first argument of +(e.g. by using the :genex:`$<CONFIG>` generator expression), the first argument of ``COMMAND`` is still evaluated in the command config by default, while all subsequent arguments, as well as the arguments to ``DEPENDS`` and ``WORKING_DIRECTORY``, are evaluated in the output config. These defaults can -be overridden with the ``$<OUTPUT_CONFIG:...>`` and ``$<COMMAND_CONFIG:...>`` +be overridden with the :genex:`$<OUTPUT_CONFIG:...>` and :genex:`$<COMMAND_CONFIG:...>` generator-expressions. Note that if a target is specified by its name in ``DEPENDS``, or as the first argument of ``COMMAND``, it is always evaluated -in the command config, even if it is wrapped in ``$<OUTPUT_CONFIG:...>`` +in the command config, even if it is wrapped in :genex:`$<OUTPUT_CONFIG:...>` (because its plain name is not a generator expression). As an example, consider the following: diff --git a/Help/guide/importing-exporting/index.rst b/Help/guide/importing-exporting/index.rst index dd3efb8..51a09c0 100644 --- a/Help/guide/importing-exporting/index.rst +++ b/Help/guide/importing-exporting/index.rst @@ -563,8 +563,7 @@ include directories should be specified as relative paths to the $<INSTALL_INTERFACE:include/TgtName> ) -The ``$<INSTALL_PREFIX>`` -:manual:`generator expression <cmake-generator-expressions(7)>` may be used as +The :genex:`$<INSTALL_PREFIX>` generator expression may be used as a placeholder for the install prefix without resulting in a non-relocatable package. This is necessary if complex generator expressions are used: diff --git a/Help/guide/tutorial/Adding Support for a Testing Dashboard.rst b/Help/guide/tutorial/Adding Support for a Testing Dashboard.rst index 45d5976..787e777 100644 --- a/Help/guide/tutorial/Adding Support for a Testing Dashboard.rst +++ b/Help/guide/tutorial/Adding Support for a Testing Dashboard.rst @@ -4,33 +4,40 @@ Step 6: Adding Support for a Testing Dashboard Adding support for submitting our test results to a dashboard is simple. We already defined a number of tests for our project in :ref:`Testing Support <Tutorial Testing Support>`. Now we just have to run -those tests and submit them to a dashboard. To include support for dashboards -we include the :module:`CTest` module in our top-level ``CMakeLists.txt``. +those tests and submit them to CDash. -Replace: -.. literalinclude:: Step6/CMakeLists.txt - :caption: CMakeLists.txt - :name: CMakeLists.txt-enable_testing-remove - :language: cmake - :start-after: # enable testing - :end-before: # does the application run +Exercise 1 - Send Results to a Testing Dashboard +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -With: +Goal +---- -.. literalinclude:: Step7/CMakeLists.txt - :caption: CMakeLists.txt - :name: CMakeLists.txt-include-CTest - :language: cmake - :start-after: # enable testing - :end-before: # does the application run +Display our CTest results with CDash. + +Helpful Resources +----------------- + +* :manual:`ctest(1)` +* :command:`include` +* :module:`CTest` + +Files to Edit +------------- -The :module:`CTest` module will automatically call ``enable_testing()``, so we -can remove it from our CMake files. +* ``CMakeLists.txt`` + +Getting Started +--------------- + +For this exercise, complete ``TODO 1`` in the top-level ``CMakeLists.txt`` by +including the :module:`CTest` module. This will enable testing with CTest as +well as dashboard submissions to CDash, so we can safely remove the call to +:command:`enable_testing`. We will also need to acquire a ``CTestConfig.cmake`` file to be placed in the -top-level directory where we can specify information to CTest about the -project. It contains: +top-level directory. When run, the :manual:`ctest <ctest(1)>` executable will +read this file to gather information about the testing dashboard. It contains: * The project name @@ -41,9 +48,10 @@ project. It contains: * The URL of the CDash instance where the submission's generated documents will be sent -One has been provided for you in this directory. It would normally be -downloaded from the ``Settings`` page of the project on the CDash -instance that will host and display the test results. Once downloaded from +For this tutorial, a public dashboard server is used and its corresponding +``CTestConfig.cmake`` file is provided for you in this step's root directory. +In practice, this file would be downloaded from a project's ``Settings`` page +on the CDash instance intended to host the test results. Once downloaded from CDash, the file should not be modified locally. .. literalinclude:: Step7/CTestConfig.cmake @@ -51,11 +59,16 @@ CDash, the file should not be modified locally. :name: CTestConfig.cmake :language: cmake -The :manual:`ctest <ctest(1)>` executable will read in this file when it runs. -To create a simple dashboard you can run the :manual:`cmake <cmake(1)>` -executable or the :manual:`cmake-gui <cmake-gui(1)>` to configure the project, -but do not build it yet. Instead, change directory to the binary tree, and then -run: + +Build and Run +------------- + +Note that as part of the CDash submission some information about your +development system (e.g. site name or full pathnames) may displayed publicly. + +To create a simple test dashboard, run the :manual:`cmake <cmake(1)>` +executable or the :manual:`cmake-gui <cmake-gui(1)>` to configure the project +but do not build it yet. Instead, navigate to the build directory and run: .. code-block:: console @@ -70,6 +83,28 @@ type must be specified: Or, from an IDE, build the ``Experimental`` target. -The :manual:`ctest <ctest(1)>` executable will build and test the project and -submit the results to Kitware's public dashboard: +The :manual:`ctest <ctest(1)>` executable will build the project, run any +tests, and submit the results to Kitware's public dashboard: https://my.cdash.org/index.php?project=CMakeTutorial. + +Solution +-------- + +The only CMake code changed needed in this step was to enable dashboard +submissions to CDash by including the :module:`CTest` module in our top-level +``CMakeLists.txt``: + +.. raw:: html + + <details><summary>TODO 1: Click to show/hide answer</summary> + +.. literalinclude:: Step7/CMakeLists.txt + :caption: TODO 1: CMakeLists.txt + :name: CMakeLists.txt-include-CTest + :language: cmake + :start-after: # enable testing + :end-before: # does the application run + +.. raw:: html + + </details> diff --git a/Help/guide/tutorial/Adding System Introspection.rst b/Help/guide/tutorial/Adding System Introspection.rst index ba91df4..b69abd2 100644 --- a/Help/guide/tutorial/Adding System Introspection.rst +++ b/Help/guide/tutorial/Adding System Introspection.rst @@ -7,53 +7,156 @@ depends on whether or not the target platform has the ``log`` and ``exp`` functions. Of course almost every platform has these functions but for this tutorial assume that they are not common. -If the platform has ``log`` and ``exp`` then we will use them to compute the -square root in the ``mysqrt`` function. We first test for the availability of -these functions using the :module:`CheckCXXSourceCompiles` module in +Exercise 1 - Assessing Dependency Availability +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Goal +---- + +Change implementation based on available system dependencies. + +Helpful Resources +----------------- + +* :module:`CheckCXXSourceCompiles` +* :command:`target_compile_definitions` + +Files to Edit +------------- + +* ``MathFunctions/CMakeLists.txt`` +* ``MathFunctions/mysqrt.cxx`` + +Getting Started +--------------- + +The starting source code is provided in the ``Step7`` directory. In this +exercise, complete ``TODO 1`` through ``TODO 5``. + +Start by editing ``MathFunctions/CMakeLists.txt``. Include the +:module:`CheckCXXSourceCompiles` module. Then, use +``check_cxx_source_compiles`` to determine whether ``log`` and ``exp`` are +available from ``cmath``. If they are available, use +:command:`target_compile_definitions` to specify ``HAVE_LOG`` and ``HAVE_EXP`` +as compile definitions. + +In the ``MathFunctions/mysqrt.cxx``, include ``cmath``. Then, if the system has +``log`` and ``exp``, use them to compute the square root. + +Build and Run +------------- + +Make a new directory called ``Step7_build``. Run the +:manual:`cmake <cmake(1)>` executable or the +:manual:`cmake-gui <cmake-gui(1)>` to configure the project and then build it +with your chosen build tool and run the ``Tutorial`` executable. + +This can look like the following: + +.. code-block:: console + + mkdir Step7_build + cd Step7_build + cmake ../Step7 + cmake --build . + +Which function gives better results now, ``sqrt`` or ``mysqrt``? + +Solution +-------- + +In this exercise we will use functions from the +:module:`CheckCXXSourceCompiles` module so first we must include it in ``MathFunctions/CMakeLists.txt``. -Add the checks for ``log`` and ``exp`` to ``MathFunctions/CMakeLists.txt``, -after the call to :command:`target_include_directories`: +.. raw:: html + + <details><summary>TODO 1: Click to show/hide answer</summary> .. literalinclude:: Step8/MathFunctions/CMakeLists.txt - :caption: MathFunctions/CMakeLists.txt + :caption: TODO 1: MathFunctions/CMakeLists.txt + :name: MathFunctions/CMakeLists.txt-include-check_cxx_source_compiles + :language: cmake + :start-after: # does this system provide the log and exp functions? + :end-before: check_cxx_source_compiles + +.. raw:: html + + </details> + +Then test for the availability of +``log`` and ``exp`` using ``check_cxx_compiles_source``. This function +lets us try compiling simple code with the required dependency prior to +the true source code compilation. The resulting variables ``HAVE_LOG`` +and ``HAVE_EXP`` represent whether those dependencies are available. + +.. raw:: html + + <details><summary>TODO 2: Click to show/hide answer</summary> + +.. literalinclude:: Step8/MathFunctions/CMakeLists.txt + :caption: TODO 2: MathFunctions/CMakeLists.txt :name: MathFunctions/CMakeLists.txt-check_cxx_source_compiles :language: cmake - :start-after: # to find MathFunctions.h, while we don't. + :start-after: include(CheckCXXSourceCompiles) :end-before: # add compile definitions -If available, use :command:`target_compile_definitions` to specify +.. raw:: html + + </details> + +Next, we need to pass these CMake variables to our source code. This way, +our source code can tell what resources are available. If both ``log`` and +``exp`` are available, use :command:`target_compile_definitions` to specify ``HAVE_LOG`` and ``HAVE_EXP`` as ``PRIVATE`` compile definitions. +.. raw:: html + + <details><summary>TODO 3: Click to show/hide answer</summary> + .. literalinclude:: Step8/MathFunctions/CMakeLists.txt - :caption: MathFunctions/CMakeLists.txt + :caption: TODO 3: MathFunctions/CMakeLists.txt :name: MathFunctions/CMakeLists.txt-target_compile_definitions :language: cmake :start-after: # add compile definitions :end-before: # install libs -If ``log`` and ``exp`` are available on the system, then we will use them to -compute the square root in the ``mysqrt`` function. Add the following code to -the ``mysqrt`` function in ``MathFunctions/mysqrt.cxx`` (don't forget the -``#endif`` before returning the result!): +.. raw:: html -.. literalinclude:: Step8/MathFunctions/mysqrt.cxx - :caption: MathFunctions/mysqrt.cxx - :name: MathFunctions/mysqrt.cxx-ifdef - :language: c++ - :start-after: // if we have both log and exp then use them - :end-before: // do ten iterations + </details> + +Since we may be using ``log`` and ``exp``, we need to modify +``mysqrt.cxx`` to include ``cmath``. + +.. raw:: html -We will also need to modify ``mysqrt.cxx`` to include ``cmath``. + <details><summary>TODO 4: Click to show/hide answer</summary> .. literalinclude:: Step8/MathFunctions/mysqrt.cxx - :caption: MathFunctions/mysqrt.cxx + :caption: TODO 4: MathFunctions/mysqrt.cxx :name: MathFunctions/mysqrt.cxx-include-cmath :language: c++ :end-before: #include <iostream> -Run the :manual:`cmake <cmake(1)>` executable or the -:manual:`cmake-gui <cmake-gui(1)>` to configure the project and then build it -with your chosen build tool and run the Tutorial executable. +.. raw:: html -Which function gives better results now, ``sqrt`` or ``mysqrt``? + </details> + +If ``log`` and ``exp`` are available on the system, then use them to +compute the square root in the ``mysqrt`` function. The ``mysqrt`` function in +``MathFunctions/mysqrt.cxx`` will look as follows: + +.. raw:: html + + <details><summary>TODO 5: Click to show/hide answer</summary> + +.. literalinclude:: Step8/MathFunctions/mysqrt.cxx + :caption: TODO 5: MathFunctions/mysqrt.cxx + :name: MathFunctions/mysqrt.cxx-ifdef + :language: c++ + :start-after: // if we have both log and exp then use them + :end-before: // do ten iterations + +.. raw:: html + + </details> diff --git a/Help/guide/tutorial/Installing and Testing.rst b/Help/guide/tutorial/Installing and Testing.rst index fa13040..aa3fb74 100644 --- a/Help/guide/tutorial/Installing and Testing.rst +++ b/Help/guide/tutorial/Installing and Testing.rst @@ -145,7 +145,7 @@ are similar. To the end of the top-level ``CMakeLists.txt`` we add: :name: TODO 3,4: CMakeLists.txt-install-TARGETS :language: cmake :start-after: # add the install targets - :end-before: # enable testing + :end-before: # TODO 1: Replace enable_testing() with include(CTest) .. raw:: html @@ -195,7 +195,7 @@ Build and Run ------------- Navigate to the build directory and rebuild the application. Then, run the -``ctest`` executable: :option:`ctest -N` and :option:`ctest -VV`. For +:program:`ctest` executable: :option:`ctest -N` and :option:`ctest -VV`. For multi-config generators (e.g. Visual Studio), the configuration type must be specified with the :option:`-C \<mode\> <ctest -C>` flag. For example, to run tests in Debug mode use ``ctest -C Debug -VV`` from the build directory diff --git a/Help/guide/tutorial/Step6/CMakeLists.txt b/Help/guide/tutorial/Step6/CMakeLists.txt index da9e852..c11e307 100644 --- a/Help/guide/tutorial/Step6/CMakeLists.txt +++ b/Help/guide/tutorial/Step6/CMakeLists.txt @@ -45,6 +45,7 @@ install(FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h" DESTINATION include ) +# TODO 1: Replace enable_testing() with include(CTest) # enable testing enable_testing() diff --git a/Help/guide/tutorial/Step7/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step7/MathFunctions/CMakeLists.txt index b4724c4..e5bdc4d 100644 --- a/Help/guide/tutorial/Step7/MathFunctions/CMakeLists.txt +++ b/Help/guide/tutorial/Step7/MathFunctions/CMakeLists.txt @@ -9,6 +9,26 @@ target_include_directories(MathFunctions # link our compiler flags interface library target_link_libraries(MathFunctions tutorial_compiler_flags) +# TODO 1: Include CheckCXXSourceCompiles + +# TODO 2: Use check_cxx_source_compiles with simple C++ code to verify +# availability of: +# * std::log +# * std::exp +# Store the results in HAVE_LOG and HAVE_EXP respectively. + +# Hint: Sample C++ code which uses log: +# #include <cmath> +# int main() { +# std::log(1.0); +# return 0; +# } + +# TODO 3: Conditionally on HAVE_LOG and HAVE_EXP, add private compile +# definitions "HAVE_LOG" and "HAVE_EXP" to the MathFunctions target. + +#Hint: Use target_compile_definitions() + # install libs set(installable_libs MathFunctions tutorial_compiler_flags) install(TARGETS ${installable_libs} DESTINATION lib) diff --git a/Help/guide/tutorial/Step7/MathFunctions/mysqrt.cxx b/Help/guide/tutorial/Step7/MathFunctions/mysqrt.cxx index abe767d..3d2492a 100644 --- a/Help/guide/tutorial/Step7/MathFunctions/mysqrt.cxx +++ b/Help/guide/tutorial/Step7/MathFunctions/mysqrt.cxx @@ -1,5 +1,6 @@ #include <iostream> +// TODO 4: include cmath #include "MathFunctions.h" // a hack square root calculation using simple operations @@ -9,6 +10,14 @@ double mysqrt(double x) return 0; } + // TODO 5: If both HAVE_LOG and HAVE_EXP are defined, use the following: + //// double result = std::exp(std::log(x) * 0.5); + //// std::cout << "Computing sqrt of " << x << " to be " << result + //// << " using log and exp" << std::endl; + // else, use the existing logic. + + // Hint: Don't forget the #endif before returning the result! + double result = x; // do ten iterations @@ -20,5 +29,6 @@ double mysqrt(double x) result = result + 0.5 * delta / result; std::cout << "Computing sqrt of " << x << " to be " << result << std::endl; } + return result; } diff --git a/Help/manual/ccmake.1.rst b/Help/manual/ccmake.1.rst index cd66d51..a09857b 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 :program:`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 b14160c..07e55cf 100644 --- a/Help/manual/cmake-buildsystem.7.rst +++ b/Help/manual/cmake-buildsystem.7.rst @@ -119,7 +119,7 @@ Object Libraries The ``OBJECT`` library type defines a non-archival collection of object files resulting from compiling the given source files. The object files collection may be used as source inputs to other targets by using the syntax -``$<TARGET_OBJECTS:name>``. This is a +:genex:`$<TARGET_OBJECTS:name>`. This is a :manual:`generator expression <cmake-generator-expressions(7)>` that can be used to supply the ``OBJECT`` library content to other targets: @@ -854,7 +854,7 @@ the generator used. For example: In the presence of :prop_tgt:`IMPORTED` targets, the content of :prop_tgt:`MAP_IMPORTED_CONFIG_DEBUG <MAP_IMPORTED_CONFIG_<CONFIG>>` is also -accounted for by the above ``$<CONFIG:Debug>`` expression. +accounted for by the above :genex:`$<CONFIG:Debug>` expression. Case Sensitivity @@ -862,7 +862,7 @@ Case Sensitivity :variable:`CMAKE_BUILD_TYPE` and :variable:`CMAKE_CONFIGURATION_TYPES` are just like other variables in that any string comparisons made with their -values will be case-sensitive. The ``$<CONFIG>`` generator expression also +values will be case-sensitive. The :genex:`$<CONFIG>` generator expression also preserves the casing of the configuration as set by the user or CMake defaults. For example: @@ -887,7 +887,7 @@ For example: In contrast, CMake treats the configuration type case-insensitively when using it internally in places that modify behavior based on the configuration. -For example, the ``$<CONFIG:Debug>`` generator expression will evaluate to 1 +For example, the :genex:`$<CONFIG:Debug>` generator expression will evaluate to 1 for a configuration of not only ``Debug``, but also ``DEBUG``, ``debug`` or even ``DeBuG``. Therefore, you can specify configuration types in :variable:`CMAKE_BUILD_TYPE` and :variable:`CMAKE_CONFIGURATION_TYPES` with diff --git a/Help/manual/cmake-developer.7.rst b/Help/manual/cmake-developer.7.rst index 0f3c30a..a09bd14 100644 --- a/Help/manual/cmake-developer.7.rst +++ b/Help/manual/cmake-developer.7.rst @@ -560,7 +560,7 @@ The ``RELEASE`` variant should be listed first in the property so that the variant is chosen if the user uses a configuration which is not an exact match for any listed ``IMPORTED_CONFIGURATIONS``. -Most of the cache variables should be hidden in the ``ccmake`` interface unless +Most of the cache variables should be hidden in the :program:`ccmake` interface unless the user explicitly asks to edit them. .. code-block:: cmake diff --git a/Help/manual/cmake-file-api.7.rst b/Help/manual/cmake-file-api.7.rst index 4b8ac65..65c5239 100644 --- a/Help/manual/cmake-file-api.7.rst +++ b/Help/manual/cmake-file-api.7.rst @@ -258,8 +258,8 @@ The members are: ``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, + It has members for :program:`cmake`, :program:`ctest`, and :program:`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`). @@ -425,7 +425,7 @@ Version 1 does not exist to avoid confusion with that from { "kind": "codemodel", - "version": { "major": 2, "minor": 4 }, + "version": { "major": 2, "minor": 5 }, "paths": { "source": "/path/to/top-level-source-dir", "build": "/path/to/top-level-build-dir" @@ -1071,6 +1071,27 @@ with members: available. The value is an unsigned integer 0-based index into the ``backtraceGraph`` member's ``nodes`` array. +``fileSets`` + A JSON array of entries corresponding to the target's file sets. Each entry + is a JSON object with members: + + ``name`` + A string specifying the name of the file set. + + ``type`` + A string specifying the type of the file set. See + :command:`target_sources` supported file set types. + + ``visibility`` + A string specifying the visibility of the file set; one of ``PUBLIC``, + ``PRIVATE``, or ``INTERFACE``. + + ``baseDirectories`` + A JSON array of strings specifying the base directories containing sources + in the file set. + + This field was added in codemodel version 2.5. + ``sources`` A JSON array of entries corresponding to the target's source files. Each entry is a JSON object with members: @@ -1096,6 +1117,13 @@ with members: Optional member that is present with boolean value ``true`` if the source is :prop_sf:`GENERATED`. + ``fileSetIndex`` + Optional member that is present when the source is part of a file set. + The value is an unsigned integer 0-based index into the ``fileSets`` + array. + + This field was added in codemodel version 2.5. + ``backtrace`` Optional member that is present when a CMake language backtrace to the :command:`target_sources`, :command:`add_executable`, diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst index 69e3f20..faa793f 100644 --- a/Help/manual/cmake-generator-expressions.7.rst +++ b/Help/manual/cmake-generator-expressions.7.rst @@ -142,9 +142,9 @@ to generate debug messages is to add a custom target: add_custom_target(genexdebug COMMAND ${CMAKE_COMMAND} -E echo "$<...>") -After running ``cmake``, you can then build the ``genexdebug`` target to print +After running :program:`cmake`, you can then build the ``genexdebug`` target to print the result of the ``$<...>`` expression (i.e. run the command -``cmake --build ... --target genexdebug``). +:option:`cmake --build ... --target genexdebug <cmake--build --target>`). Another way is to write debug messages to a file with :command:`file(GENERATE)`: diff --git a/Help/manual/cmake-gui.1.rst b/Help/manual/cmake-gui.1.rst index dd0eeca..cdb860f 100644 --- a/Help/manual/cmake-gui.1.rst +++ b/Help/manual/cmake-gui.1.rst @@ -16,7 +16,7 @@ Synopsis Description =========== -The **cmake-gui** executable is the CMake GUI. Project configuration +The :program:`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. diff --git a/Help/manual/cmake-language.7.rst b/Help/manual/cmake-language.7.rst index 0bd561f..a0d872f 100644 --- a/Help/manual/cmake-language.7.rst +++ b/Help/manual/cmake-language.7.rst @@ -37,10 +37,10 @@ Scripts An individual ``<script>.cmake`` source file may be processed in *script mode* by using the :manual:`cmake(1)` command-line tool -with the ``-P`` option. Script mode simply runs the commands in -the given CMake Language source file and does not generate a -build system. It does not allow CMake commands that define build -targets or actions. +with the :option:`-P <cmake -P>` option. Script mode simply runs +the commands in the given CMake Language source file and does not +generate a build system. It does not allow CMake commands that +define build targets or actions. Modules ------- @@ -206,7 +206,7 @@ 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. -.. No code-block syntax highlighting in the following example +.. ATTENTION No code-block syntax highlighting in the following example (long string literal not supported by our cmake.py) For example:: @@ -254,7 +254,7 @@ 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 +.. ATTENTION No code-block syntax highlighting in the following example (escape \" not supported by our cmake.py) For example: @@ -268,7 +268,7 @@ For example: It does end in an unescaped double quote. ") -.. No code-block syntax highlighting in the following example +.. ATTENTION 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 @@ -542,8 +542,8 @@ Directory Scope bindings. Before processing the ``CMakeLists.txt`` file for a directory, CMake copies all variable bindings currently defined in the parent directory, if any, to initialize the new directory - scope. CMake `Scripts`_, when processed with ``cmake -P``, bind - variables in one "directory" scope. + scope. CMake `Scripts`_, when processed with :option:`cmake -P`, + bind variables in one "directory" scope. A variable "set" or "unset" not inside a function call binds to the current directory scope. @@ -597,11 +597,11 @@ Initialization Changed values are not written back to the calling process, and they are not seen by subsequent build or test processes. - See the :ref:`cmake -E env <Run a Command-Line Tool>` command-line + See the :option:`cmake -E env <cmake-E env>` command-line tool to run a command in a modified environment. Inspection - See the :ref:`cmake -E environment <Run a Command-Line Tool>` command-line + See the :option:`cmake -E environment <cmake-E environment>` command-line tool to display all current environment variables. The :manual:`cmake-env-variables(7)` manual documents environment diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst index d6a30ff..22e9eb2 100644 --- a/Help/manual/cmake-policies.7.rst +++ b/Help/manual/cmake-policies.7.rst @@ -51,6 +51,13 @@ 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.26 +================================= + +.. toctree:: + :maxdepth: 1 + + CMP0143: USE_FOLDERS global property is treated as ON by default. </policy/CMP0143> Policies Introduced by CMake 3.25 ================================= diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst index b31ad11..dc51383 100644 --- a/Help/manual/cmake.1.rst +++ b/Help/manual/cmake.1.rst @@ -39,20 +39,20 @@ Synopsis Description =========== -The **cmake** executable is the command-line interface of the cross-platform +The :program:`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`_, `Install a Project`_ or just -run the corresponding build tool (e.g. ``make``) directly. **cmake** can also +Optionally use :program:`cmake` to `Build a Project`_, `Install a Project`_ or just +run the corresponding build tool (e.g. ``make``) directly. :program:`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**, +For graphical user interfaces that may be used in place of :program:`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)>`. @@ -193,7 +193,7 @@ build tool to build the project. For example, after using the $ make $ make install -Alternatively, one may use **cmake** to `Build a Project`_ by +Alternatively, one may use :program:`cmake` to `Build a Project`_ by automatically choosing and invoking the appropriate native build tool. .. _`CMake Options`: @@ -362,9 +362,8 @@ Options separated by a newline ( ``\n`` ). It is guaranteed that no newline characters will be present inside a JSON document. - JSON trace format: - .. code-block:: json + :caption: JSON trace format { "file": "/full/path/to/the/CMake/file.txt", @@ -417,9 +416,8 @@ Options Additionally, the first JSON document outputted contains the ``version`` key for the current major and minor version of the - JSON trace format: - .. code-block:: json + :caption: JSON version format { "version": { @@ -850,17 +848,21 @@ Available commands are: .. program:: cmake-E -.. option:: copy <file>... <destination> +.. option:: copy <file>... <destination>, copy -t <destination> <file>... Copy files to ``<destination>`` (either file or directory). - If multiple files are specified, the ``<destination>`` must be - directory and it must exist. Wildcards are not supported. - ``copy`` does follow symlinks. That means it does not copy symlinks, - but the files or directories it point to. + If multiple files are specified, or if ``-t`` is specified, the + ``<destination>`` must be directory and it must exist. If ``-t`` is not + specified, the last argument is assumed to be the ``<destination>``. + Wildcards are not supported. ``copy`` does follow symlinks. That means it + does not copy symlinks, but the files or directories it point to. .. versionadded:: 3.5 Support for multiple input files. + .. versionadded:: 3.26 + Support for ``-t`` argument. + .. option:: copy_directory <dir>... <destination> Copy content of ``<dir>...`` directories to ``<destination>`` directory. @@ -939,7 +941,7 @@ Available commands are: The ``NAME=VALUE`` and ``--unset=NAME`` options are equivalent to ``--modify NAME=set:VALUE`` and ``--modify NAME=unset:``, respectively. Note that ``--modify NAME=reset:`` resets ``NAME`` to the value it had - when ``cmake`` launched (or unsets it), not to the most recent + when :program:`cmake` launched (or unsets it), not to the most recent ``NAME=VALUE`` option. .. option:: -- @@ -1319,7 +1321,7 @@ To view the presets available for a project, use Return Value (Exit Code) ======================== -Upon regular termination, the ``cmake`` executable returns the exit code ``0``. +Upon regular termination, the :program:`cmake` executable returns the exit code ``0``. If termination is caused by the command :command:`message(FATAL_ERROR)`, or another error condition, then a non-zero exit code is returned. diff --git a/Help/manual/cpack.1.rst b/Help/manual/cpack.1.rst index 3f26d72..1a101a4 100644 --- a/Help/manual/cpack.1.rst +++ b/Help/manual/cpack.1.rst @@ -13,10 +13,10 @@ Synopsis Description =========== -The **cpack** executable is the CMake packaging program. It generates +The :program:`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, +For each installer or package format, :program:`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 @@ -28,7 +28,7 @@ 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 :option:`-G <cpack -G>`. -The **cpack** program is steered by a configuration file written in the +The :program:`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 :option:`--config <cpack --config>`, the file ``CPackConfig.cmake`` in the current directory is used. @@ -45,7 +45,7 @@ Options .. option:: -G <generators> ``<generators>`` is a :ref:`semicolon-separated list <CMake Language Lists>` - of generator names. ``cpack`` will iterate through this list and produce + of generator names. :program:`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. If this option is not given, the :variable:`CPACK_GENERATOR` variable determines the default set of @@ -58,30 +58,30 @@ Options :ref:`semicolon-separated list <CMake Language Lists>`. When the CMake project uses a multi-configuration generator such as Xcode or Visual Studio, this option is needed to tell - ``cpack`` which built executables to include in the package. + :program:`cpack` which built executables to include in the package. The user is responsible for ensuring that the configuration(s) listed - have already been built before invoking ``cpack``. + have already been built before invoking :program:`cpack`. .. option:: -D <var>=<value> Set a CPack variable. This will override any value set for ``<var>`` in the - input file read by ``cpack``. + input file read by :program:`cpack`. .. option:: --config <configFile> - Specify the configuration file read by ``cpack`` to provide the packaging + Specify the configuration file read by :program:`cpack` to provide the packaging details. By default, ``CPackConfig.cmake`` in the current directory will be used. .. option:: -V, --verbose - Run ``cpack`` with verbose output. This can be used to show more details + Run :program:`cpack` with verbose output. This can be used to show more details from the package generation tools and is suitable for project developers. .. option:: --debug - Run ``cpack`` with debug output. This option is intended mainly for the - developers of ``cpack`` itself and is not normally needed by project + Run :program:`cpack` with debug output. This option is intended mainly for the + developers of :program:`cpack` itself and is not normally needed by project developers. .. option:: --trace diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst index 3497a9f..30a9eae 100644 --- a/Help/manual/ctest.1.rst +++ b/Help/manual/ctest.1.rst @@ -32,7 +32,7 @@ Synopsis Description =========== -The **ctest** executable is the CMake test driver program. +The :program:`ctest` executable is the CMake test driver program. CMake-generated build trees created for projects that use the :command:`enable_testing` and :command:`add_test` commands have testing support. This program will run the tests and report results. @@ -69,7 +69,7 @@ Run Tests Enable short progress output from tests. - When the output of **ctest** is being sent directly to a terminal, the + When the output of :program:`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. @@ -137,7 +137,7 @@ Run Tests :ref:`resource specification file <ctest-resource-specification-file>` specified in ``<file>``. - When ``ctest`` is run as a `Dashboard Client`_ this sets the + When :program:`ctest` is run as a `Dashboard Client`_ this sets the ``ResourceSpecFile`` option of the `CTest Test Step`_. .. option:: --test-load <level> @@ -146,7 +146,7 @@ Run Tests not to start tests when they may cause the CPU load to pass above a given threshold. - When ``ctest`` is run as a `Dashboard Client`_ this sets the + When :program:`ctest` is run as a `Dashboard Client`_ this sets the ``TestLoad`` option of the `CTest Test Step`_. .. option:: -Q, --quiet @@ -473,7 +473,7 @@ with the following labels: * *test4* has label *wednesday* * *test5* has labels *friday* and *test* -Running ``ctest`` with ``-L tuesday -L test`` will select *test2*, which has +Running :program:`ctest` with ``-L tuesday -L test`` will select *test2*, which has both labels. Running CTest with ``-L test`` will select *test2* and *test5*, because both of them have a label that matches that regular expression. @@ -832,7 +832,7 @@ Dashboard Client via CTest Command-Line --------------------------------------- CTest can perform testing on an already-generated build tree. -Run the ``ctest`` command with the current working directory set +Run the :program:`ctest` command with the current working directory set to the build tree and use one of these signatures:: ctest -D <mode>[<step>] @@ -865,7 +865,7 @@ Dashboard Client via CTest Script CTest can perform testing driven by a :manual:`cmake-language(7)` script that creates and maintains the source and build tree as -well as performing the testing steps. Run the ``ctest`` command +well as performing the testing steps. Run the :program:`ctest` command with the current working directory set outside of any build tree and use one of these signatures:: @@ -1142,7 +1142,7 @@ Configuration settings include: When the build system to be launched allows build-time selection of the configuration (e.g. ``Debug``, ``Release``), this specifies the default configuration to be built when no :option:`-C <ctest -C>` - option is given to the ``ctest`` command. The value will be substituted + option is given to the :program:`ctest` command. The value will be substituted into the value of ``MakeCommand`` to replace the literal string ``${CTEST_CONFIGURATION_TYPE}`` if it appears. @@ -1624,7 +1624,7 @@ resource allocation feature. Tests should check the resource allocation is activated. This variable will always (and only) be defined if resource allocation is activated. If resource allocation is not activated, then the ``CTEST_RESOURCE_GROUP_COUNT`` variable will not exist, -even if it exists for the parent ``ctest`` process. If a test absolutely must +even if it exists for the parent :program:`ctest` process. If a test absolutely must have resource allocation, then it can return a failing exit code or use the :prop_test:`SKIP_RETURN_CODE` or :prop_test:`SKIP_REGULAR_EXPRESSION` properties to indicate a skipped test. diff --git a/Help/policy/CMP0143.rst b/Help/policy/CMP0143.rst new file mode 100644 index 0000000..7a7aee7 --- /dev/null +++ b/Help/policy/CMP0143.rst @@ -0,0 +1,30 @@ +CMP0143 +------- + +.. versionadded:: 3.26 + +:prop_gbl:`USE_FOLDERS` global property is treated as ``ON`` by default. + +When using CMake 3.25 and below, :prop_gbl:`USE_FOLDERS` is treated +as ``OFF`` by default unless projects enable the feature. For example: + +.. code-block:: cmake + + cmake_minimum_required(VERSION 3.25) + project(foobar LANGUAGES CXX) + set_property(GLOBAL PROPERTY USE_FOLDERS ON) + +CMake 3.26 and later prefer to enable the feature by default. + +This policy provides compatibility with projects that have not been updated +to expect enabling of folders. Enabling folders causes projects to appear +differently in IDEs. + +This policy was introduced in CMake version 3.26. Use the +:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly. +Unlike many policies, CMake version |release| does *not* warn +when this policy is not set and simply uses ``OLD`` behavior. +The policy setting must be in scope at the end of the top-level +``CMakeLists.txt`` file of the project and has global effect. + +.. include:: DEPRECATED.txt diff --git a/Help/prop_gbl/USE_FOLDERS.rst b/Help/prop_gbl/USE_FOLDERS.rst index 5919723..965b5d6 100644 --- a/Help/prop_gbl/USE_FOLDERS.rst +++ b/Help/prop_gbl/USE_FOLDERS.rst @@ -4,7 +4,16 @@ USE_FOLDERS Use the :prop_tgt:`FOLDER` target property to organize targets into folders. -If not set, CMake treats this property as ``OFF`` by default. CMake -generators that are capable of organizing into a hierarchy of folders +.. versionchanged:: 3.26 + + CMake treats this property as ``ON`` by default. + See policy :policy:`CMP0143`. + +CMake generators that are capable of organizing into a hierarchy of folders use the values of the :prop_tgt:`FOLDER` target property to name those -folders. See also the documentation for the :prop_tgt:`FOLDER` target property. +folders. (i.e.: Visual Studio / XCode) + +IDE's can also take advantage of this property to organize CMake targets. +Regardless of generator support. + +See also the documentation for the :prop_tgt:`FOLDER` target property. diff --git a/Help/prop_test/LABELS.rst b/Help/prop_test/LABELS.rst index d827adc..02e2fae 100644 --- a/Help/prop_test/LABELS.rst +++ b/Help/prop_test/LABELS.rst @@ -2,7 +2,7 @@ LABELS ------ Specify a list of text labels associated with a test. The labels are -reported in both the ``ctest`` output summary and in dashboard submissions. +reported in both the :program:`ctest` output summary and in dashboard submissions. They can also be used to filter the set of tests to be executed (see the :option:`ctest -L` and :option:`ctest -LE` options). diff --git a/Help/prop_tgt/COMMON_LANGUAGE_RUNTIME.rst b/Help/prop_tgt/COMMON_LANGUAGE_RUNTIME.rst index adfa6f7..7ce0023 100644 --- a/Help/prop_tgt/COMMON_LANGUAGE_RUNTIME.rst +++ b/Help/prop_tgt/COMMON_LANGUAGE_RUNTIME.rst @@ -7,13 +7,30 @@ By setting this target property, the target is configured to build with ``C++/CLI`` support. The Visual Studio generator defines the ``clr`` parameter depending on -the value of ``COMMON_LANGUAGE_RUNTIME``: +the value of the ``COMMON_LANGUAGE_RUNTIME`` target property: -* property not set: native C++ (i.e. default) -* property set but empty: mixed unmanaged/managed C++ -* property set to any non empty value: managed C++ +Not Set (default) -Supported values: ``""``, ``"pure"``, ``"safe"`` + Native C++. + +``""`` (set but empty) + + Mixed unmanaged/managed C++ using .NET Framework. + +``netcore`` + .. versionadded:: 3.26 + + Mixed unmanaged/managed C++ using .NET Core. + + This required VS 2019's v142 toolset or higher. + +``pure`` + + Managed C++. + +``safe`` + + Managed C++. This property is only evaluated :ref:`Visual Studio Generators` for VS 2010 and above. diff --git a/Help/prop_tgt/INTERFACE_COMPILE_DEFINITIONS.rst b/Help/prop_tgt/INTERFACE_COMPILE_DEFINITIONS.rst index c74a319..9cc12a1 100644 --- a/Help/prop_tgt/INTERFACE_COMPILE_DEFINITIONS.rst +++ b/Help/prop_tgt/INTERFACE_COMPILE_DEFINITIONS.rst @@ -5,5 +5,4 @@ INTERFACE_COMPILE_DEFINITIONS .. |command_name| replace:: :command:`target_compile_definitions` .. |PROPERTY_INTERFACE_NAME| replace:: ``INTERFACE_COMPILE_DEFINITIONS`` .. |PROPERTY_LINK| replace:: :prop_tgt:`COMPILE_DEFINITIONS` -.. |PROPERTY_GENEX| replace:: ``$<TARGET_PROPERTY:foo,INTERFACE_COMPILE_DEFINITIONS>`` .. include:: INTERFACE_BUILD_PROPERTY.txt diff --git a/Help/prop_tgt/INTERFACE_COMPILE_FEATURES.rst b/Help/prop_tgt/INTERFACE_COMPILE_FEATURES.rst index 0db3b0c..50d6161 100644 --- a/Help/prop_tgt/INTERFACE_COMPILE_FEATURES.rst +++ b/Help/prop_tgt/INTERFACE_COMPILE_FEATURES.rst @@ -7,7 +7,6 @@ INTERFACE_COMPILE_FEATURES .. |command_name| replace:: :command:`target_compile_features` .. |PROPERTY_INTERFACE_NAME| replace:: ``INTERFACE_COMPILE_FEATURES`` .. |PROPERTY_LINK| replace:: :prop_tgt:`COMPILE_FEATURES` -.. |PROPERTY_GENEX| replace:: ``$<TARGET_PROPERTY:foo,INTERFACE_COMPILE_FEATURES>`` .. include:: INTERFACE_BUILD_PROPERTY.txt See the :manual:`cmake-compile-features(7)` manual for information on compile diff --git a/Help/prop_tgt/INTERFACE_COMPILE_OPTIONS.rst b/Help/prop_tgt/INTERFACE_COMPILE_OPTIONS.rst index 7f0b385..2af7a99 100644 --- a/Help/prop_tgt/INTERFACE_COMPILE_OPTIONS.rst +++ b/Help/prop_tgt/INTERFACE_COMPILE_OPTIONS.rst @@ -5,5 +5,4 @@ INTERFACE_COMPILE_OPTIONS .. |command_name| replace:: :command:`target_compile_options` .. |PROPERTY_INTERFACE_NAME| replace:: ``INTERFACE_COMPILE_OPTIONS`` .. |PROPERTY_LINK| replace:: :prop_tgt:`COMPILE_OPTIONS` -.. |PROPERTY_GENEX| replace:: ``$<TARGET_PROPERTY:foo,INTERFACE_COMPILE_OPTIONS>`` .. include:: INTERFACE_BUILD_PROPERTY.txt diff --git a/Help/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.rst b/Help/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.rst index b1c40b2..8795c80 100644 --- a/Help/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.rst +++ b/Help/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.rst @@ -5,7 +5,6 @@ INTERFACE_INCLUDE_DIRECTORIES .. |command_name| replace:: :command:`target_include_directories` .. |PROPERTY_INTERFACE_NAME| replace:: ``INTERFACE_INCLUDE_DIRECTORIES`` .. |PROPERTY_LINK| replace:: :prop_tgt:`INCLUDE_DIRECTORIES` -.. |PROPERTY_GENEX| replace:: ``$<TARGET_PROPERTY:foo,INTERFACE_INCLUDE_DIRECTORIES>`` .. include:: INTERFACE_BUILD_PROPERTY.txt Include directories usage requirements commonly differ between the build-tree diff --git a/Help/prop_tgt/INTERFACE_LINK_DIRECTORIES.rst b/Help/prop_tgt/INTERFACE_LINK_DIRECTORIES.rst index de1dabb..45b3225 100644 --- a/Help/prop_tgt/INTERFACE_LINK_DIRECTORIES.rst +++ b/Help/prop_tgt/INTERFACE_LINK_DIRECTORIES.rst @@ -7,5 +7,4 @@ INTERFACE_LINK_DIRECTORIES .. |command_name| replace:: :command:`target_link_directories` .. |PROPERTY_INTERFACE_NAME| replace:: ``INTERFACE_LINK_DIRECTORIES`` .. |PROPERTY_LINK| replace:: :prop_tgt:`LINK_DIRECTORIES` -.. |PROPERTY_GENEX| replace:: ``$<TARGET_PROPERTY:foo,INTERFACE_LINK_DIRECTORIES>`` .. include:: INTERFACE_BUILD_PROPERTY.txt diff --git a/Help/prop_tgt/INTERFACE_LINK_OPTIONS.rst b/Help/prop_tgt/INTERFACE_LINK_OPTIONS.rst index 4245fe9..785b17c 100644 --- a/Help/prop_tgt/INTERFACE_LINK_OPTIONS.rst +++ b/Help/prop_tgt/INTERFACE_LINK_OPTIONS.rst @@ -7,5 +7,4 @@ INTERFACE_LINK_OPTIONS .. |command_name| replace:: :command:`target_link_options` .. |PROPERTY_INTERFACE_NAME| replace:: ``INTERFACE_LINK_OPTIONS`` .. |PROPERTY_LINK| replace:: :prop_tgt:`LINK_OPTIONS` -.. |PROPERTY_GENEX| replace:: ``$<TARGET_PROPERTY:foo,INTERFACE_LINK_OPTIONS>`` .. include:: INTERFACE_BUILD_PROPERTY.txt diff --git a/Help/prop_tgt/LINK_OPTIONS.rst b/Help/prop_tgt/LINK_OPTIONS.rst index 27eadf9..7c37122 100644 --- a/Help/prop_tgt/LINK_OPTIONS.rst +++ b/Help/prop_tgt/LINK_OPTIONS.rst @@ -9,8 +9,8 @@ libraries need to use the :prop_tgt:`STATIC_LIBRARY_OPTIONS` target property. These options are used for both normal linking and device linking (see policy :policy:`CMP0105`). To control link options for normal and device -link steps, ``$<HOST_LINK>`` and ``$<DEVICE_LINK>`` -:manual:`generator expressions <cmake-generator-expressions(7)>` can be used. +link steps, :genex:`$<HOST_LINK>` and ::genex:`$<DEVICE_LINK>` generator +expressions can be used. This property holds a :ref:`semicolon-separated list <CMake Language Lists>` of options specified so far for its target. Use the :command:`target_link_options` diff --git a/Help/release/3.15.rst b/Help/release/3.15.rst index 6b1a800..de3ced0 100644 --- a/Help/release/3.15.rst +++ b/Help/release/3.15.rst @@ -243,46 +243,42 @@ Modules Generator Expressions --------------------- -* The :manual:`generator expressions <cmake-generator-expressions(7)>` - ``C_COMPILER_ID``, ``CXX_COMPILER_ID``, ``CUDA_COMPILER_ID``, - ``Fortran_COMPILER_ID``, ``COMPILE_LANGUAGE``, ``COMPILE_LANG_AND_ID``, and - ``PLATFORM_ID`` learned to support matching one value from a comma-separated - list. +* The generator expressions :genex:`$<C_COMPILER_ID>`, + :genex:`$<CXX_COMPILER_ID>`, :genex:`$<CUDA_COMPILER_ID>`, + :genex:`$<Fortran_COMPILER_ID>`, :genex:`$<COMPILE_LANGUAGE>`, + :genex:`$<COMPILE_LANG_AND_ID>`, and :genex:`$<PLATFORM_ID>` learned to + support matching one value from a comma-separated list. -* The ``$<CUDA_COMPILER_ID:...>`` and ``$<CUDA_COMPILER_VERSION:...>`` - :manual:`generator expressions <cmake-generator-expressions(7)>` were added. +* The :genex:`$<CUDA_COMPILER_ID:...>` and :genex:`$<CUDA_COMPILER_VERSION:...>` + generator expressions were added. -* The ``$<COMPILE_LANG_AND_ID:...>`` generator expression was introduced to +* The :genex:`$<COMPILE_LANG_AND_ID:...>` generator expression was introduced to allow specification of compile options for target files based on the :variable:`CMAKE_<LANG>_COMPILER_ID` and :prop_sf:`LANGUAGE` of each source file. -* A ``$<FILTER:list,INCLUDE|EXCLUDE,regex>`` - :manual:`generator expression <cmake-generator-expressions(7)>` - has been added. +* A :genex:`$<FILTER:list,INCLUDE|EXCLUDE,regex>` generator expression has + been added. -* A ``$<REMOVE_DUPLICATES:list>`` - :manual:`generator expression <cmake-generator-expressions(7)>` - has been added. +* A :genex:`$<REMOVE_DUPLICATES:list>` generator expression has been added. -* The ``$<SHELL_PATH:...>`` :manual:`generator expression - <cmake-generator-expressions(7)>` gained support for a list of paths. +* The :genex:`$<SHELL_PATH:...>` generator expression gained support for a + list of paths. * New ``$<TARGET_FILE*>`` :manual:`generator expressions <cmake-generator-expressions(7)>` were added to retrieve the prefix, base name, and suffix of the file names of various artifacts: - * ``$<TARGET_FILE_PREFIX:...>`` - * ``$<TARGET_FILE_BASE_NAME:...>`` - * ``$<TARGET_FILE_SUFFIX:...>`` - * ``$<TARGET_LINKER_FILE_PREFIX:...>`` - * ``$<TARGET_LINKER_FILE_BASE_NAME:...>`` - * ``$<TARGET_LINKER_FILE_SUFFIX:...>`` - * ``$<TARGET_PDB_FILE_BASE_NAME:...>`` - -* The ``$<TARGET_OBJECTS:...>`` :manual:`generator expression - <cmake-generator-expressions(7)>` is now supported on ``SHARED``, - ``STATIC``, ``MODULE`` libraries and executables. + * :genex:`$<TARGET_FILE_PREFIX:...>` + * :genex:`$<TARGET_FILE_BASE_NAME:...>` + * :genex:`$<TARGET_FILE_SUFFIX:...>` + * :genex:`$<TARGET_LINKER_FILE_PREFIX:...>` + * :genex:`$<TARGET_LINKER_FILE_BASE_NAME:...>` + * :genex:`$<TARGET_LINKER_FILE_SUFFIX:...>` + * :genex:`$<TARGET_PDB_FILE_BASE_NAME:...>` + +* The :genex:`$<TARGET_OBJECTS:...>` generator expression is now supported + on ``SHARED``, ``STATIC``, ``MODULE`` libraries and executables. CTest ----- diff --git a/Help/release/3.17.rst b/Help/release/3.17.rst index 1aa475f..a27d638 100644 --- a/Help/release/3.17.rst +++ b/Help/release/3.17.rst @@ -140,7 +140,7 @@ Properties * The :prop_tgt:`INSTALL_NAME_DIR` target property now supports :manual:`generator expressions <cmake-generator-expressions(7)>`. - In particular, the ``$<INSTALL_PREFIX>`` generator expression can + In particular, the :genex:`$<INSTALL_PREFIX>` generator expression can be used to set the directory relative to the install-time prefix. * Target properties :prop_tgt:`MACHO_COMPATIBILITY_VERSION` and diff --git a/Help/release/3.18.rst b/Help/release/3.18.rst index f97e4df..c120b9f 100644 --- a/Help/release/3.18.rst +++ b/Help/release/3.18.rst @@ -211,12 +211,11 @@ Modules Generator Expressions --------------------- -* The ``$<DEVICE_LINK:...>`` and ``$<HOST_LINK:...>`` - :manual:`generator expressions <cmake-generator-expressions(7)>` were added - to manage device and host link steps. +* The :genex:`$<DEVICE_LINK:...>` and :genex:`$<HOST_LINK:...>` + generator expressions were added to manage device and host link steps. -* The ``$<LINK_LANGUAGE:...>`` and ``$<LINK_LANG_AND_ID:...>`` - :manual:`generator expressions <cmake-generator-expressions(7)>` were added. +* The :genex:`$<LINK_LANGUAGE:...>` and :genex:`$<LINK_LANG_AND_ID:...>` + generator expressions were added. CTest ----- diff --git a/Help/release/3.20.rst b/Help/release/3.20.rst index 40cac41..ebd0f91 100644 --- a/Help/release/3.20.rst +++ b/Help/release/3.20.rst @@ -86,8 +86,8 @@ Commands in their ``OUTPUT`` and ``BYPRODUCTS`` options. Their ``COMMAND``, ``WORKING_DIRECTORY``, and ``DEPENDS`` options gained - support for new generator expressions ``$<COMMAND_CONFIG:...>`` and - ``$<OUTPUT_CONFIG:...>`` that control cross-config handling when using + support for new generator expressions :genex:`$<COMMAND_CONFIG:...>` and + :genex:`$<OUTPUT_CONFIG:...>` that control cross-config handling when using the :generator:`Ninja Multi-Config` generator. * The :command:`add_custom_command` command gained ``DEPFILE`` support on diff --git a/Help/release/3.23.rst b/Help/release/3.23.rst index 6376d77..5d85777 100644 --- a/Help/release/3.23.rst +++ b/Help/release/3.23.rst @@ -274,8 +274,8 @@ Other Changes * tries to detect invalid architectures and issue an error. * ``CUDA`` with Clang now implements policy :policy:`CMP0105` and - the ``$<DEVICE_LINK:...>`` and ``$<HOST_LINK:...>`` - :manual:`generator expressions <cmake-generator-expressions(7)>`. + the :genex:`$<DEVICE_LINK:...>` and :genex:`$<HOST_LINK:...>` + generator expressions. * The :command:`define_property` command's ``BRIEF_DOCS`` and ``FULL_DOCS`` arguments are now optional. diff --git a/Help/release/3.9.rst b/Help/release/3.9.rst index 89da627..09e4ea6 100644 --- a/Help/release/3.9.rst +++ b/Help/release/3.9.rst @@ -256,11 +256,11 @@ Other :command:`file(GENERATE)` commands. * Two new informational generator expressions to retrieve Apple Bundle - directories have been added. The first one ``$<TARGET_BUNDLE_DIR:tgt>`` + directories have been added. The first one :genex:`$<TARGET_BUNDLE_DIR:tgt>` outputs the full path to the Bundle directory, the other one - ``$<TARGET_BUNDLE_CONTENT_DIR:tgt>`` outputs the full path to the + :genex:`$<TARGET_BUNDLE_CONTENT_DIR:tgt>` outputs the full path to the ``Contents`` directory of macOS Bundles and App Bundles. For all other - bundle types and SDKs it is identical with ``$<TARGET_BUNDLE_DIR:tgt>``. + bundle types and SDKs it is identical with :genex:`$<TARGET_BUNDLE_DIR:tgt>`. The new expressions are helpful to query Bundle locations independent of the different Bundle types and layouts on macOS and iOS. diff --git a/Help/release/dev/0-sample-topic.rst b/Help/release/dev/0-sample-topic.rst new file mode 100644 index 0000000..e4cc01e --- /dev/null +++ b/Help/release/dev/0-sample-topic.rst @@ -0,0 +1,7 @@ +0-sample-topic +-------------- + +* This is a sample release note for the change in a topic. + Developers should add similar notes for each topic branch + making a noteworthy change. Each document should be named + and titled to match the topic name to avoid merge conflicts. diff --git a/Help/release/dev/ExternalProject-INSTALL_BYPRODUCTS.rst b/Help/release/dev/ExternalProject-INSTALL_BYPRODUCTS.rst new file mode 100644 index 0000000..233596f --- /dev/null +++ b/Help/release/dev/ExternalProject-INSTALL_BYPRODUCTS.rst @@ -0,0 +1,6 @@ +ExternalProject-INSTALL_BYPRODUCTS +---------------------------------- + +* The :module:`ExternalProject` module :command:`ExternalProject_Add` command + gained an ``INSTALL_BYPRODUCTS`` option to specify files generated by the + "install" step. diff --git a/Help/release/dev/UseSWIG-perl5.rst b/Help/release/dev/UseSWIG-perl5.rst new file mode 100644 index 0000000..67d4161 --- /dev/null +++ b/Help/release/dev/UseSWIG-perl5.rst @@ -0,0 +1,4 @@ +UseSWIG-perl5 +------------- + +* The :module:`UseSWIG` module gained the support of ``perl5`` language. diff --git a/Help/release/dev/cmake-E-copy-t-arg.rst b/Help/release/dev/cmake-E-copy-t-arg.rst new file mode 100644 index 0000000..ca897d3 --- /dev/null +++ b/Help/release/dev/cmake-E-copy-t-arg.rst @@ -0,0 +1,4 @@ +cmake-E-copy-t-arg +------------------ + +* The :option:`cmake -E copy <cmake-E copy>` argument now supports a ``-t`` argument. diff --git a/Help/release/dev/compile-commands-output-field.rst b/Help/release/dev/compile-commands-output-field.rst new file mode 100644 index 0000000..110fd4e --- /dev/null +++ b/Help/release/dev/compile-commands-output-field.rst @@ -0,0 +1,7 @@ +compile-commands-output-field +----------------------------- + +* The :prop_tgt:`EXPORT_COMPILE_COMMANDS` target property will now have the + ``output`` field in the compile commands objects. This allows multi-config + generators (namely :generator:`Ninja Multi-Config` generator) to contain the + compile commands for all configurations. diff --git a/Help/release/dev/file-api-file-sets.rst b/Help/release/dev/file-api-file-sets.rst new file mode 100644 index 0000000..8a8b8d3 --- /dev/null +++ b/Help/release/dev/file-api-file-sets.rst @@ -0,0 +1,9 @@ +file-api-file-sets +------------------ + +* The :manual:`cmake-file-api(7)` "codemodel" version 2 ``version`` field has + been updated to 2.5. + +* The :manual:`cmake-file-api(7)` "codemodel" version 2 "target" object + gained a new ``fileSets`` field and associated ``fileSetIndex`` + field to ``sources`` objects. diff --git a/Help/release/dev/marmasm-language.rst b/Help/release/dev/marmasm-language.rst new file mode 100644 index 0000000..2101e6c --- /dev/null +++ b/Help/release/dev/marmasm-language.rst @@ -0,0 +1,4 @@ +marmasm-language +---------------- + +* The ``ASM_MARMASM`` language was added to support the Microsoft ARM assembler language. diff --git a/Help/release/dev/timestamp-timezone.rst b/Help/release/dev/timestamp-timezone.rst new file mode 100644 index 0000000..178fa9a --- /dev/null +++ b/Help/release/dev/timestamp-timezone.rst @@ -0,0 +1,5 @@ +timestamp-timezone +------------------ + +* The :command:`string(TIMESTAMP)` and :command:`file(TIMESTAMP)` commands + now support the ``%z`` and ``%Z`` specifiers for the time zone. diff --git a/Help/release/dev/top-level-command-order.rst b/Help/release/dev/top-level-command-order.rst new file mode 100644 index 0000000..07f87fb --- /dev/null +++ b/Help/release/dev/top-level-command-order.rst @@ -0,0 +1,6 @@ +top-level-command-order +----------------------- + +* The top-level :command:`project` call will now emit an author warning if the + documented command order in relation to :command:`cmake_minimum_required` is + not respected. diff --git a/Help/release/dev/trace-try_compile.rst b/Help/release/dev/trace-try_compile.rst new file mode 100644 index 0000000..886aaad --- /dev/null +++ b/Help/release/dev/trace-try_compile.rst @@ -0,0 +1,5 @@ +trace-try_compile +----------------- + +* The :option:`cmake --trace` option now follows :command:`try_compile` and + :command:`try_run` invocations. diff --git a/Help/release/dev/use-folder-on-by-default.rst b/Help/release/dev/use-folder-on-by-default.rst new file mode 100644 index 0000000..4e91c2e --- /dev/null +++ b/Help/release/dev/use-folder-on-by-default.rst @@ -0,0 +1,5 @@ +use-folder-on-by-default +------------------------ + +* Global property :prop_gbl:`USE_FOLDERS` is treated as ``ON`` by default. + See policy :policy:`CMP0143`. diff --git a/Help/release/index.rst b/Help/release/index.rst index b6ecf7b..50e06bb 100644 --- a/Help/release/index.rst +++ b/Help/release/index.rst @@ -7,6 +7,8 @@ CMake Release Notes This file should include the adjacent "dev.txt" file in development versions but not in release versions. +.. include:: dev.txt + Releases ======== diff --git a/Help/variable/CMAKE_DEPENDS_USE_COMPILER.rst b/Help/variable/CMAKE_DEPENDS_USE_COMPILER.rst index bdad59e..ada4ba6 100644 --- a/Help/variable/CMAKE_DEPENDS_USE_COMPILER.rst +++ b/Help/variable/CMAKE_DEPENDS_USE_COMPILER.rst @@ -6,4 +6,4 @@ CMAKE_DEPENDS_USE_COMPILER For the :ref:`Makefile Generators`, source dependencies are now, for a selection of compilers, generated by the compiler itself. By defining this variable with value ``FALSE``, you can restore the legacy behavior (i.e. using -``CMake`` for dependencies discovery). +CMake for dependencies discovery). diff --git a/Help/variable/LINK_LIBRARY_PREDEFINED_FEATURES.txt b/Help/variable/LINK_LIBRARY_PREDEFINED_FEATURES.txt index aea1be8..9158631 100644 --- a/Help/variable/LINK_LIBRARY_PREDEFINED_FEATURES.txt +++ b/Help/variable/LINK_LIBRARY_PREDEFINED_FEATURES.txt @@ -49,14 +49,14 @@ * ``[/path/to/]FwName.framework/Versions/*/FwName[suffix]`` Note that CMake recognizes and automatically handles framework targets, - even without using the ``$<LINK_LIBRARY:FRAMEWORK,...>`` expression. + even without using the :genex:`$<LINK_LIBRARY:FRAMEWORK,...>` expression. The generator expression can still be used with a CMake target if the project wants to be explicit about it, but it is not required to do so. The linker command line may have some differences between using the generator expression or not, but the final result should be the same. On the other hand, if a file path is given, CMake will recognize some paths automatically, but not all cases. The project may want to use - ``$<LINK_LIBRARY:FRAMEWORK,...>`` for file paths so that the expected + :genex:`$<LINK_LIBRARY:FRAMEWORK,...>` for file paths so that the expected behavior is clear. .. versionadded:: 3.25 |