diff options
Diffstat (limited to 'Help')
-rw-r--r-- | Help/command/add_custom_command.rst | 6 | ||||
-rw-r--r-- | Help/command/add_custom_target.rst | 6 | ||||
-rw-r--r-- | Help/command/target_precompile_headers.rst | 35 | ||||
-rw-r--r-- | Help/cpack_gen/wix.rst | 4 | ||||
-rw-r--r-- | Help/manual/cmake-properties.7.rst | 2 | ||||
-rw-r--r-- | Help/manual/cmake-variables.7.rst | 1 | ||||
-rw-r--r-- | Help/manual/cmake.1.rst | 18 | ||||
-rw-r--r-- | Help/prop_tgt/AUTOMOC_PATH_PREFIX.rst | 32 | ||||
-rw-r--r-- | Help/prop_tgt/PRECOMPILE_HEADERS_REUSE_FROM.rst | 7 | ||||
-rw-r--r-- | Help/release/dev/FindGnuTLS-target.rst | 4 | ||||
-rw-r--r-- | Help/release/dev/automoc_path_prefix.rst | 13 | ||||
-rw-r--r-- | Help/release/dev/windows-auto-export-incremental-build.rst | 6 | ||||
-rw-r--r-- | Help/variable/CMAKE_AUTOMOC_PATH_PREFIX.rst | 11 | ||||
-rw-r--r-- | Help/variable/MSVC_TOOLSET_VERSION.rst | 1 |
14 files changed, 128 insertions, 18 deletions
diff --git a/Help/command/add_custom_command.rst b/Help/command/add_custom_command.rst index ed321fc..ab2a023 100644 --- a/Help/command/add_custom_command.rst +++ b/Help/command/add_custom_command.rst @@ -68,9 +68,6 @@ The options are: order-only dependencies to ensure the byproducts will be available before their dependents build. - The ``BYPRODUCTS`` option is ignored on non-Ninja generators - except to mark byproducts ``GENERATED``. - ``COMMAND`` Specify the command-line(s) to execute at build time. If more than one ``COMMAND`` is specified they will be executed in order, @@ -111,6 +108,9 @@ The options are: an ``OUTPUT`` of another custom command in the same directory (``CMakeLists.txt`` file) CMake automatically brings the other custom command into the target in which this command is built. + A target-level dependency is added if any dependency is listed as + ``BYPRODUCTS`` of a target or any of its build events in the same + directory to ensure the byproducts will be available. If ``DEPENDS`` is not specified the command will run whenever the ``OUTPUT`` is missing; if the command does not actually create the ``OUTPUT`` then the rule will always run. diff --git a/Help/command/add_custom_target.rst b/Help/command/add_custom_target.rst index 08b9516..e74960c 100644 --- a/Help/command/add_custom_target.rst +++ b/Help/command/add_custom_target.rst @@ -49,9 +49,6 @@ The options are: order-only dependencies to ensure the byproducts will be available before their dependents build. - The ``BYPRODUCTS`` option is ignored on non-Ninja generators - except to mark byproducts ``GENERATED``. - ``COMMAND`` Specify the command-line(s) to execute at build time. If more than one ``COMMAND`` is specified they will be executed in order, @@ -86,6 +83,9 @@ The options are: :command:`add_custom_command` command calls in the same directory (``CMakeLists.txt`` file). They will be brought up to date when the target is built. + A target-level dependency is added if any dependency is a byproduct + of a target or any of its build events in the same directory to ensure + the byproducts will be available before this target is built. Use the :command:`add_dependencies` command to add dependencies on other targets. diff --git a/Help/command/target_precompile_headers.rst b/Help/command/target_precompile_headers.rst index 3e28265..3a32f41 100644 --- a/Help/command/target_precompile_headers.rst +++ b/Help/command/target_precompile_headers.rst @@ -9,9 +9,23 @@ Add a list of header files to precompile. <INTERFACE|PUBLIC|PRIVATE> [header1...] [<INTERFACE|PUBLIC|PRIVATE> [header2...] ...]) + target_precompile_headers(<target> REUSE_FROM <other_target>) + Adds header files to :prop_tgt:`PRECOMPILE_HEADERS` or :prop_tgt:`INTERFACE_PRECOMPILE_HEADERS` target properties. +The second signature will reuse an already precompiled header file artefact +from another target. This is done by setting the +:prop_tgt:`PRECOMPILE_HEADERS_REUSE_FROM` to ``<other_target>`` value. +The ``<other_target>`` will become a dependency of ``<target>``. + +.. note:: + + The second signature will require the same set of compiler options, + compiler flags, compiler definitions for both ``<target>``, and + ``<other_target>``. Compilers (e.g. GCC) will issue a warning if the + precompiled header file cannot be used (``-Winvalid-pch``). + Precompiling header files can speed up compilation by creating a partially processed version of some header files, and then using that version during compilations rather than repeatedly parsing the original headers. @@ -34,17 +48,32 @@ 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. +Usage +^^^^^ + .. code-block:: cmake target_precompile_headers(<target> PUBLIC - "project_header.h" + project_header.h PRIVATE + [["other_header.h"]] <unordered_map> ) -Header files will be double quoted if they are not specified with double -quotes or angle brackets. +The list of header files is used to generate a header file named +``cmake_pch.h|xx`` which is used to generate the precompiled header file +(``.pch``, ``.gch``, ``.pchi``) artifact. The ``cmake_pch.h|xx`` header +file will be force included (``-include`` for GCC, ``/FI`` for MSVC) to +all source files, so sources do not need to have ``#include "pch.h"``. + +Header file names specified with angle brackets (e.g. ``<unordered_map>``) or +explicit double quotes (escaped for the :manual:`cmake-language(7)`, +e.g. ``[["other_header.h"]]``) will be treated as is, and include directories +must be available for the compiler to find them. Other header file names +(e.g. ``project_header.h``) are interpreted as being relative to the current +source directory (e.g. :variable:`CMAKE_CURRENT_SOURCE_DIR`) and will be +included by absolute path. See Also ^^^^^^^^ diff --git a/Help/cpack_gen/wix.rst b/Help/cpack_gen/wix.rst index dde4943..7fb5a12 100644 --- a/Help/cpack_gen/wix.rst +++ b/Help/cpack_gen/wix.rst @@ -95,6 +95,10 @@ Windows using WiX. If this variable is not set, it will be initialized with CPACK_PACKAGE_NAME + If this variable is set to ``.``, then application shortcuts will be + created directly in the start menu and the uninstaller shortcut will be + omitted. + .. variable:: CPACK_WIX_CULTURES Language(s) of the installer diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst index 19afb7d..8f8cb33 100644 --- a/Help/manual/cmake-properties.7.rst +++ b/Help/manual/cmake-properties.7.rst @@ -134,6 +134,7 @@ Properties on Targets /prop_tgt/AUTOMOC_EXECUTABLE /prop_tgt/AUTOMOC_MACRO_NAMES /prop_tgt/AUTOMOC_MOC_OPTIONS + /prop_tgt/AUTOMOC_PATH_PREFIX /prop_tgt/AUTOMOC /prop_tgt/AUTOUIC /prop_tgt/AUTOUIC_EXECUTABLE @@ -298,6 +299,7 @@ Properties on Targets /prop_tgt/PDB_OUTPUT_DIRECTORY /prop_tgt/POSITION_INDEPENDENT_CODE /prop_tgt/PRECOMPILE_HEADERS + /prop_tgt/PRECOMPILE_HEADERS_REUSE_FROM /prop_tgt/PREFIX /prop_tgt/PRIVATE_HEADER /prop_tgt/PROJECT_LABEL diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index 2d473d8..def63e4 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -342,6 +342,7 @@ Variables that Control the Build /variable/CMAKE_AUTOMOC_DEPEND_FILTERS /variable/CMAKE_AUTOMOC_MACRO_NAMES /variable/CMAKE_AUTOMOC_MOC_OPTIONS + /variable/CMAKE_AUTOMOC_PATH_PREFIX /variable/CMAKE_AUTORCC /variable/CMAKE_AUTORCC_OPTIONS /variable/CMAKE_AUTOUIC diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst index 2576cde..754f14b 100644 --- a/Help/manual/cmake.1.rst +++ b/Help/manual/cmake.1.rst @@ -473,6 +473,12 @@ Available commands are: directory and it must exist. ``copy_if_different`` does follow symlinks. +``create_symlink <old> <new>`` + Create a symbolic link ``<new>`` naming ``<old>``. + + .. note:: + Path to where ``<new>`` symbolic link will be created has to exist beforehand. + ``echo [<string>...]`` Displays arguments as text. @@ -485,6 +491,9 @@ Available commands are: ``environment`` Display the current environment variables. +``false`` + Do nothing, with an exit code of 1. + ``make_directory <dir>...`` Create ``<dir>`` directories. If necessary, create parent directories too. If a directory already exists it will be @@ -602,18 +611,9 @@ Available commands are: Touch a file if it exists but do not create it. If a file does not exist it will be silently ignored. -``create_symlink <old> <new>`` - Create a symbolic link ``<new>`` naming ``<old>``. - -.. note:: - Path to where ``<new>`` symbolic link will be created has to exist beforehand. - ``true`` Do nothing, with an exit code of 0. -``false`` - Do nothing, with an exit code of 1. - Windows-specific Command-Line Tools ----------------------------------- diff --git a/Help/prop_tgt/AUTOMOC_PATH_PREFIX.rst b/Help/prop_tgt/AUTOMOC_PATH_PREFIX.rst new file mode 100644 index 0000000..e2ebb3f --- /dev/null +++ b/Help/prop_tgt/AUTOMOC_PATH_PREFIX.rst @@ -0,0 +1,32 @@ +AUTOMOC_PATH_PREFIX +------------------- + +When this property is ``ON``, CMake will generate the ``-p`` path prefix +option for ``moc`` on :prop_tgt:`AUTOMOC` enabled Qt targets. + +To generate the path prefix, CMake tests if the header compiled by ``moc`` +is in any of the target +:command:`include directories <target_include_directories>`. If so, CMake will +compute the relative path accordingly. If the header is not in the +:command:`include directories <target_include_directories>`, CMake will omit +the ``-p`` path prefix option. ``moc`` usually generates a +relative include path in that case. + +:prop_tgt:`AUTOMOC_PATH_PREFIX` is initialized from the variable +:variable:`CMAKE_AUTOMOC_PATH_PREFIX`, which is ``ON`` by default. + +See the :manual:`cmake-qt(7)` manual for more information on using CMake +with Qt. + +Reproducible builds +^^^^^^^^^^^^^^^^^^^ + +For reproducible builds is is recommended to keep headers that are ``moc`` +compiled in one of the target +:command:`include directories <target_include_directories>` and set +:prop_tgt:`AUTOMOC_PATH_PREFIX` to ``ON`` (which is the default). This ensures +that + +- ``moc`` output files are identical on different build setups, +- ``moc`` output files will compile correctly when the source and/or + build directory is a symbolic link. diff --git a/Help/prop_tgt/PRECOMPILE_HEADERS_REUSE_FROM.rst b/Help/prop_tgt/PRECOMPILE_HEADERS_REUSE_FROM.rst new file mode 100644 index 0000000..d740303 --- /dev/null +++ b/Help/prop_tgt/PRECOMPILE_HEADERS_REUSE_FROM.rst @@ -0,0 +1,7 @@ +PRECOMPILE_HEADERS_REUSE_FROM +----------------------------- + +Target from which to reuse the precomipled headers build artifact. + +See the second signature of :command:`target_precompile_headers` command +for more detailed information. diff --git a/Help/release/dev/FindGnuTLS-target.rst b/Help/release/dev/FindGnuTLS-target.rst new file mode 100644 index 0000000..671a7b7 --- /dev/null +++ b/Help/release/dev/FindGnuTLS-target.rst @@ -0,0 +1,4 @@ +FindGnuTLS-target +----------------- + +* The :module:`FindGnuTLS` module now provides an imported target. diff --git a/Help/release/dev/automoc_path_prefix.rst b/Help/release/dev/automoc_path_prefix.rst new file mode 100644 index 0000000..bee1b32 --- /dev/null +++ b/Help/release/dev/automoc_path_prefix.rst @@ -0,0 +1,13 @@ +automoc_path_prefix +------------------- + +* When using :prop_tgt:`AUTOMOC`, CMake now generates the ``-p`` path prefix + option for ``moc``. This ensures that ``moc`` output files are identical + on different build setups (given, that the headers compiled by ``moc`` are + in an :command:`include directory <target_include_directories>`). + Also it ensures that ``moc`` output files will compile correctly when the + source and/or build directory is a symbolic link. + + The ``moc`` path prefix generation behavior can be configured by setting + the new :variable:`CMAKE_AUTOMOC_PATH_PREFIX` variable and/or + :prop_tgt:`AUTOMOC_PATH_PREFIX` target property. diff --git a/Help/release/dev/windows-auto-export-incremental-build.rst b/Help/release/dev/windows-auto-export-incremental-build.rst new file mode 100644 index 0000000..3126329 --- /dev/null +++ b/Help/release/dev/windows-auto-export-incremental-build.rst @@ -0,0 +1,6 @@ +windows-auto-export-incremental-build +------------------------------------- + +* On Windows, existing auto generated exports are now only updated if the + modified time stamp of the exports is not newer than any modified time stamp + of the input files. diff --git a/Help/variable/CMAKE_AUTOMOC_PATH_PREFIX.rst b/Help/variable/CMAKE_AUTOMOC_PATH_PREFIX.rst new file mode 100644 index 0000000..dca0b06 --- /dev/null +++ b/Help/variable/CMAKE_AUTOMOC_PATH_PREFIX.rst @@ -0,0 +1,11 @@ +CMAKE_AUTOMOC_PATH_PREFIX +------------------------- + +Whether to generate the ``-p`` path prefix option for ``moc`` on +:prop_tgt:`AUTOMOC` enabled Qt targets. + +This variable is used to initialize the :prop_tgt:`AUTOMOC_PATH_PREFIX` +property on all the targets. See that target property for additional +information. + +The default value is ``ON``. diff --git a/Help/variable/MSVC_TOOLSET_VERSION.rst b/Help/variable/MSVC_TOOLSET_VERSION.rst index 77e1ea9..f4a33e2 100644 --- a/Help/variable/MSVC_TOOLSET_VERSION.rst +++ b/Help/variable/MSVC_TOOLSET_VERSION.rst @@ -14,6 +14,7 @@ Known toolset version numbers are:: 120 = VS 2013 (12.0) 140 = VS 2015 (14.0) 141 = VS 2017 (15.0) + 142 = VS 2019 (16.0) Compiler versions newer than those known to CMake will be reported as the latest known toolset version. |