Commit Graph

1331 Commits

Author SHA1 Message Date
Craig Scott
4f7a0c25d2 Help: Document BYPASS_PROVIDER keyword for find_package()
Fixes: #23669
2022-07-23 21:43:49 +10:00
Brad King
66998035c1 Merge topic 'try_run_split_output'
a2cd0687db try_run: Add RUN_OUTPUT_STDOUT_VARIABLE and RUN_OUTPUT_STDERR_VARIABLE.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7453
2022-07-22 10:14:34 -04:00
Brad King
4ea33b41d7 Merge topic 'doc-execute_process'
70c26a65b7 Help: Clarify execute_process OS-specific command-line encoding

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7492
2022-07-20 12:39:44 -04:00
Brad King
70c26a65b7 Help: Clarify execute_process OS-specific command-line encoding
Issue: #23557
2022-07-20 11:46:23 -04:00
Brad King
12192e7f94 Merge topic 'doc_command_links'
033c066543 Help: Add see-also refs for flow control commands

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7467
2022-07-20 09:27:55 -04:00
Brad King
e077d0b351 Merge topic 'doc-example-target-sources'
c7c5a50b97 Help: Add missing PRIVATE keyword to target_sources() example

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7490
2022-07-20 08:45:54 -04:00
Craig Scott
c7c5a50b97 Help: Add missing PRIVATE keyword to target_sources() example
Fixes: #23746
2022-07-20 20:19:37 +10:00
Markus Ferrell
033c066543 Help: Add see-also refs for flow control commands 2022-07-19 13:06:25 -04:00
Patrick Northon
a2cd0687db try_run: Add RUN_OUTPUT_STDOUT_VARIABLE and RUN_OUTPUT_STDERR_VARIABLE. 2022-07-08 15:49:02 -04:00
Brad King
983a5b1a7e Merge topic 'install-destination-docs'
52164be691 Help: Clarify behavior of install(TARGETS) for DLLs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7457
2022-07-08 09:05:51 -04:00
Kyle Edwards
52164be691 Help: Clarify behavior of install(TARGETS) for DLLs
Fixes: #23695
2022-07-06 12:03:53 -04:00
Ben Boeckel
fe44cbe9e7 exports: support CXX_MODULES_DIRECTORY
This directory will be used to store build-discovered information about
targets such as the modules provided by the files in the relevant
`FILE_SET` types.

A directory is used because basing the name on a `<FILE_NAME>-*.cmake`
pattern makes it end up being globbed in the configuration-dependent
information mechanism. Since old modules and targets may be around,
unconditionally including them may refer to targets that do not actually
exist.
2022-07-06 10:15:23 -04:00
Ben Boeckel
29118091dc install: support CXX_MODULES_BMI installation bits 2022-07-06 10:15:23 -04:00
Ben Boeckel
f3cfde394a cmTargetSourcesCommand: allow INTERFACE C++ modules when imported
`PUBLIC` filesets become `INTERFACE` upon installation. Allow
`INTERFACE` scopes for C++ modules when the target is imported.
2022-07-06 10:15:23 -04:00
Brad King
b80ccea686 Merge topic 'enable_language-deduplicate'
e3c8012ccd Help: Document enable_language accepting multiple languages
b4fd385c9b cmMakefile: Dedupe languages when enabling them
66bfe14309 cmMakefile: Refactor parameter and variable names for EnableLanguage

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7426
2022-07-06 09:16:34 -04:00
Brad King
c3f53b8280 Merge topic 'docopt'
ee6b429498 Help: Clarify that option() is a boolean

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7434
2022-07-05 17:31:06 -04:00
Michael Hirsch
ee6b429498 Help: Clarify that option() is a boolean
Also describe `option()` behavior in project vs. script mode.
2022-07-05 11:05:54 -04:00
friendlyanon
e3c8012ccd Help: Document enable_language accepting multiple languages 2022-06-30 23:37:15 +02:00
Alexandru Croitor
23bbac941a Add cmake_language(GET_MESSAGE_LOG_LEVEL) sub command
The new sub-command writes a string representation of the
current log level to the output variable given to the
sub-command.

Given that the log-level might be set either via the --log-level
command line option or via the CMAKE_MESSAGE_LOG_LEVEL
cache / regular variables, the priority for each of the log level
sources is as follows, with the first one being the highest:
1) --log-level
2) CMAKE_MESSAGE_LOG_LEVEL regular variable
3) CMAKE_MESSAGE_LOG_LEVEL cache variable
4) default log level (STATUS)

Fixes: #23572
2022-06-28 16:03:22 +02:00
Brad King
d94e09ec88 Merge topic 'cpp-named-module-file-sets'
07bc3b07ec gitlab-ci: test C++ modules using GCC
1b2270aa4e ci: add a Docker image to test out C++ modules with GCC
8c5a53096a Tests/RunCMake/CXXModules: add module-using examples
4151547e2f cmGlobalNinjaGenerator: use `cmModuleMapper` implementation
b43bdaff3c cmCxxModuleMapper: implement support for GCC's module map format
02d0f0e752 cmCxxModuleMapper: add source to handle module mapper contents
a046a45aad cmGlobalNinjaGenerator: add a TODO for header units
386465bf83 cmTarget: add support for C++ module fileset types
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7369
2022-06-17 11:35:12 -04:00
Ben Boeckel
386465bf83 cmTarget: add support for C++ module fileset types
C++ modules have two variants which are of importance to CMake:

  - `CXX_MODULES`: interface modules (those using `export module M;`,
    `export module M:part;`, or `module M:internal_part;`)
  - `CXX_MODULE_HEADER_UNITS`: importable header units

Creating C++ modules or partitions are *not* supported in any other
source listing. This is because the source files must be installed (so
their scope matters), but not part of usage requirements (what it means
for a module source to be injected into a consumer is not clear at this
moment). Due to the way `FILE_SET` works with scopes, they are a perfect
fit as long as `INTERFACE` is not allowed (which it is not).
2022-06-16 10:28:34 -04:00
Marc Chevrier
f3b5a7d6df find_(program,library,file,path): add validation function
Fixes: #23603
2022-06-14 16:17:46 -04:00
Brad King
9f16821ea5 Merge topic 'fetchcontent-global-targets'
f19b48e0b8 FetchContent: Honor CMAKE_FIND_PACKAGE_TARGETS_GLOBAL
1305bade56 Help: Add missing version directive for find_package() GLOBAL keyword

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7347
2022-06-11 06:13:58 -04:00
Brad King
012eb49263 Merge topic 'fetchcontent-global-targets' into release-3.24
f19b48e0b8 FetchContent: Honor CMAKE_FIND_PACKAGE_TARGETS_GLOBAL
1305bade56 Help: Add missing version directive for find_package() GLOBAL keyword

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7347
2022-06-11 06:13:57 -04:00
Craig Scott
1305bade56 Help: Add missing version directive for find_package() GLOBAL keyword 2022-06-10 18:08:36 +10:00
Brad King
ea65362f98 Merge topic 'doc-using-deps-guide'
92e93f5c9e Help: Overhaul and expand the Using Dependencies Guide

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Alex <leha-bot@yandex.ru>
Merge-request: !7332
2022-06-09 09:03:14 -04:00
Brad King
9d43059132 Merge topic 'doc-using-deps-guide' into release-3.24
92e93f5c9e Help: Overhaul and expand the Using Dependencies Guide

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Alex <leha-bot@yandex.ru>
Merge-request: !7332
2022-06-09 09:03:13 -04:00
Craig Scott
92e93f5c9e Help: Overhaul and expand the Using Dependencies Guide
The guide previously only focused on the find_package() command,
with a bias towards libraries. FetchContent was not mentioned at all.
Reorganise and update the existing content. Add new sections to cover
providing dependencies with FetchContent and dependency providers.
Improve discoverability of the guide by mentioning it at the beginning
of the find_package(), FetchContent and dependency provider docs.
2022-06-09 22:55:11 +10:00
Brad King
ab1edff492 Merge topic 'if-command-PATH_EQUAL'
be4b9e10af if command: Add PATH_EQUAL operator

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7321
2022-06-06 09:47:45 -04:00
Craig Scott
afcf275cc9 Help: Fix formatting and missing cross-reference for find_package()
Amends 42f7e39789 (Find: Support per call disabling of
CMAKE_INSTALL_PREFIX, 2022-03-21)
2022-06-05 17:55:50 +10:00
Craig Scott
8cf8f4d13b Help: State behavior for add_custom_command(TARGET) without event type
Projects should always have specified one of PRE_BUILD, PRE_LINK or
POST_BUILD, and the documentation has always shown that one must
be given. But the argument parsing logic was such that if none was given,
POST_BUILD would be used and no error or warning would be raised.
Projects may be relying on this behavior, so document it as formally
supported, but not recommended.

Fixes: #23488
2022-06-04 18:35:37 +10:00
Marc Chevrier
be4b9e10af if command: Add PATH_EQUAL operator 2022-06-03 19:31:36 +02:00
Marc Chevrier
4d1883df11 Genex-PATH_EQUAL: path comparison
To complete issue #23498
2022-06-01 15:28:54 +02:00
Marc Chevrier
f11e66670b Genex-PATH: path handling
Fixes: #23498
2022-05-31 15:39:51 +02:00
Brad King
5dcf505f63 Merge topic 'dependency-providers'
2aa83fa15b Dependency providers: Add find_package and FetchContent support
8a28368feb FetchContent: Don't discard non-empty SOURCE_DIR and BINARY_DIR
8ce9bb8a0c FetchContent: Don't leak internal variables
74a6ddc339 cmFindPackageCommand: Handle Makefile variable definitions more robustly

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Gerhard Olsson <gerhard.nospam@gmail.com>
Merge-request: !7276
2022-05-25 07:24:48 -04:00
Craig Scott
2aa83fa15b Dependency providers: Add find_package and FetchContent support
Fixes: #22619
2022-05-25 08:46:18 +10:00
Marc Chevrier
98af010b5c Help: Avoid duplicating registry query syntax in multiple find_* commands
In commit 8d7e80cf3d (find_* commands: add control over Windows registry
views, 2022-04-16) we added documentation that is repeated by multiple
find commands.  Move it to a dedicated manual section to avoid duplication.
2022-05-18 12:43:58 -04:00
Brad King
a7cd15a61c Merge topic 'try_compile-project-platform-vars'
a6562ff579 try_compile: Add option to skip passing platform variables
4843a37676 try_compile: Propagate platform variables in project-mode too

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7265
2022-05-17 08:57:55 -04:00
Brad King
a6562ff579 try_compile: Add option to skip passing platform variables
Add a `CMAKE_TRY_COMPILE_NO_PLATFORM_VARIABLES` variable to tell
`try_compile` not to pass platform variables to the test project.

Issue: #23219
2022-05-16 10:47:21 -04:00
Brad King
4843a37676 try_compile: Propagate platform variables in project-mode too
Add policy CMP0137 to propagate both our builtin variables and those
listed by `CMAKE_TRY_COMPILE_PLATFORM_VARIABLES` to `try_compile`
whole-project builds.

Inspired-by: Alexander Neumann <Alexander.Neumann@hamburg.de>
Fixes: #23219
2022-05-16 10:39:42 -04:00
Brad King
c4ed5341c4 Merge topic 'CMAKE_PROJECT_TOP_LEVEL_INCLUDES'
a6c34b0353 project(): Add new CMAKE_PROJECT_TOP_LEVEL_INCLUDES file injection point
8aa29a1793 CMakeDetermineSystem: Remove unreachable code

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7250
2022-05-16 09:26:59 -04:00
Brad King
392e73e01a Merge topic 'doc-install-example-components'
308b698f5d Help: Make install() example component names more consistent

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7240
2022-05-13 08:46:58 -04:00
Craig Scott
a6c34b0353 project(): Add new CMAKE_PROJECT_TOP_LEVEL_INCLUDES file injection point
Fixes: #22685
2022-05-13 18:03:36 +10:00
Jean-Christophe Fillion-Robin
308b698f5d Help: Make install() example component names more consistent
This commit updates the documentation so that the component examples are
specified using title case to match convention used in both the existing
`Installing Exports` section and in the "Mastering CMake" book.
2022-05-12 10:15:42 -04:00
Cameron Cawley
33da5824ac OpenWatcom: Allow specifying the runtime library
Add a `CMAKE_WATCOM_RUNTIME_LIBRARY` variable to control the
runtime library selection.  Add policy CMP0136 to switch to
in place of the old hard-coded default flags.

Fixes: #23178
2022-05-06 10:40:58 -04:00
Craig Scott
c5dff5ace2 Merge topic 'FetchContent_find_package_integration'
29e31e2825 Packages: Integrate FetchContent and find_package()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: huangqinjin <huangqinjin@gmail.com>
Merge-request: !5688
2022-05-06 08:33:38 -04:00
Brad King
8a40680524 Merge topic 'HelpExit'
0aea13d20b Help: for message(FATAL_ERROR), document nonzero exit code
cc97725137 Help: document exit code of command cmake(1)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7175
2022-05-05 12:51:47 -04:00
Brad King
213f391715 Merge topic 'HelpEnv'
a693da21f3 Help: from command:if, link to environment variables
ab2bdbaf31 Help: Cross-reference ENV operator from cmake-language(7) manual
ee4e728a69 Help: From Environment Variables section, link to cmake -E env etc

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7239
2022-05-05 12:50:53 -04:00
Joachim Wuttke (h)
0aea13d20b Help: for message(FATAL_ERROR), document nonzero exit code 2022-05-05 09:43:39 -04:00
Joachim Wuttke (h)
a693da21f3 Help: from command:if, link to environment variables 2022-05-05 09:37:20 -04:00
Brad King
bdaa4b8459 Merge topic 'chsi-windows_registry-updates'
0c33f12a39 cmake_host_system_information(WINDOWS_REGISTRY) updates

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7229
2022-05-04 11:10:12 -04:00
Craig Scott
29e31e2825 Packages: Integrate FetchContent and find_package()
Allow FetchContent_MakeAvailable() to try a call to
find_package() first, or redirect a find_package() call to
FetchContent_MakeAvailable(). The user can set variables
to control which of these are allowed or tried by default.

Fixes: #21687
2022-05-03 16:48:11 +10:00
Marc Chevrier
0c33f12a39 cmake_host_system_information(WINDOWS_REGISTRY) updates
* add a cross-reference in 'get_filename_component()' documentation
* rework tests for better 32bit systems support
2022-05-01 12:57:24 +02:00
Marc Chevrier
8d7e80cf3d find_* commands: add control over Windows registry views
Fixes: #22775
2022-04-29 22:00:02 +02:00
Brad King
1bd85e8f3f Merge topic 'NO_CMAKE_INSTALL_PREFIX'
42f7e39789 Find: Support per call disabling of CMAKE_INSTALL_PREFIX

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7163
2022-04-22 08:59:09 -04:00
Brad King
a0601e346b Merge topic 'find_package_document_global_in_full_signature'
b3e1fcf20a Help: Clarify that find_package GLOBAL argument is supported in full signature

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7180
2022-04-21 11:51:39 -04:00
Robert Maynard
b3e1fcf20a Help: Clarify that find_package GLOBAL argument is supported in full signature
This was accidentally left out of the docs by commit 2f1ffa003c
(find_package: Add support for default GLOBAL imported targets,
2022-03-10).
2022-04-20 12:38:56 -04:00
Robert Maynard
42f7e39789 Find: Support per call disabling of CMAKE_INSTALL_PREFIX
Fixes #23359
2022-04-15 09:33:55 -04:00
Brad King
1cf59d5267 Merge topic 'file-set-generated-dependency'
d0d09aa29f FILE_SET: Make INTERFACE libraries with HEADER_SETS participate in buildsystem

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Acked-by: Gabriel Nützi <gnuetzi@gmail.com>
Merge-request: !7173
2022-04-15 08:23:57 -04:00
Kyle Edwards
d0d09aa29f FILE_SET: Make INTERFACE libraries with HEADER_SETS participate in buildsystem
If an INTERFACE library has HEADER_SETS, and its header sets contain
files generated by a custom command, the library needs to participate in
the buildsystem so that the files will be generated.

Fixes: #23422
2022-04-14 09:17:54 -04:00
Marc Chevrier
17ff86547e cmake_host_system_information: query windows registry
Fixes: #21240, #23367
2022-04-13 08:59:08 -04:00
Brad King
9a7d8394b1 Merge topic 'header-sets-no-framework'
f779f8c0ad FILE_SET: Forbid adding header sets to Apple FRAMEWORK libraries

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kyle Edwards <kyle.edwards@kitware.com>
Merge-request: !7149
2022-04-07 10:54:30 -04:00
Kyle Edwards
f779f8c0ad FILE_SET: Forbid adding header sets to Apple FRAMEWORK libraries
The feature needs a specialized implementation to place headers
in the right place inside frameworks.  To avoid silently doing
the wrong thing, make this case an error for the 3.23 series.

Issue: #23386
2022-04-07 09:26:58 -04:00
Craig Scott
ce121e486c Merge topic 'doc-install-typo'
7431759ebc Help: Fix typo in install command documentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7140
2022-04-04 07:46:55 -04:00
Eugene Shalygin
7431759ebc Help: Fix typo in install command documentation 2022-04-04 07:38:29 +10:00
Brad King
025b86cc17 Merge topic 'help-json-length-empty-index'
2f0a3d43e1 Help: Fix string(JSON ... LENGTH ...) signature

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7126
2022-03-31 08:48:18 -04:00
Tobias Nießen
2f0a3d43e1 Help: Fix string(JSON ... LENGTH ...) signature
The list of indices and/or member names is optional, i.e., can be
empty. For example, string(JSON foo LENGTH "[0,0,0]") sets foo to 3.
2022-03-30 09:14:13 -04:00
Kasper Laudrup
0b7fd783f8 cmake -E tar: Add --touch option
Similar to GNU tar add a --touch option to the tar extract command to
skip extracting the timestamps from the files in the archive
effectively touching them as if they were just created.

Issue: #22746
2022-03-23 14:41:34 +01:00
Brad King
00563063c0 Merge topic 'initialize-property-name'
26caa97057 define_property(): Change constraints of INITIALIZE_FROM_VARIABLE

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7103
2022-03-23 09:32:11 -04:00
Kyle Edwards
26caa97057 define_property(): Change constraints of INITIALIZE_FROM_VARIABLE
Remove the requirement that the variable name have a prefix while
keeping the suffix requirement. Require that the property name
contains an underscore. Update docs and tests accordingly.

Fixes: #23340
2022-03-23 16:39:32 +11:00
Brad King
bbfc6215aa Merge topic 'cleanup-define_property'
87c3b5e421 define_property(): Only test prefix if INITIALIZE_FROM_VARIABLE is given
9b50f221f6 Help: Update the main purpose of define_property()
e993e2c52c Help: Clean up INITIALIZE_FROM_VARIABLE define_property() option

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: Kyle Edwards <kyle.edwards@kitware.com>
Merge-request: !7090
2022-03-22 08:55:15 -04:00
Brad King
2f3cf60711 Merge topic 'cleanup-define_property' into release-3.23
87c3b5e421 define_property(): Only test prefix if INITIALIZE_FROM_VARIABLE is given
9b50f221f6 Help: Update the main purpose of define_property()
e993e2c52c Help: Clean up INITIALIZE_FROM_VARIABLE define_property() option

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: Kyle Edwards <kyle.edwards@kitware.com>
Merge-request: !7090
2022-03-22 08:55:14 -04:00
Brad King
67ce80ac71 Merge topic 'doc-test-property-genex'
78e0204e81 Help: Clarify when add_test and test properties support generator expressions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7101
2022-03-22 08:52:12 -04:00
Brad King
78e0204e81 Help: Clarify when add_test and test properties support generator expressions
Issue: #23329
2022-03-21 15:46:50 -04:00
Craig Scott
9b50f221f6 Help: Update the main purpose of define_property()
The BRIEF_DOCS and FULL_DOCS are remnants from before the
Sphinx-based documentation when CMake's internal structures
for defining properties included fields for their documentation.
They are no longer mandatory for define_property() and haven't
been in practical use for some time. The main use of the command
has evolved to now be more about how to initialize and inherit
properties, so update the docs to reflect that change in focus.

Issue: #20698
2022-03-19 17:33:45 +11:00
Craig Scott
e993e2c52c Help: Clean up INITIALIZE_FROM_VARIABLE define_property() option
INITIALIZE_FROM_VARIABLE is new in CMake 3.23, but the
versionadded note was missing in the original commit. The docs
also failed to mention that the new option only applies to target
properties.

Amends fce24e4f10 (define_property(): Add INITIALIZE_FROM_VARIABLE
argument, 2022-01-13)
2022-03-19 17:33:45 +11:00
Brad King
cffc2b6942 Merge topic 'doc-ignore-prefix-paths'
5cb0a730c9 Help: Clarify behavior of search ignore-related variables

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7056
2022-03-15 12:48:42 -04:00
Craig Scott
5cb0a730c9 Help: Clarify behavior of search ignore-related variables
Not all the behaviors of CMake variables for ignoring search
locations by find_...() commands were fully documented.
Add the missing effects, clarify the wording and restructure the
way the details are assembled to reduce duplication.

Also improve the cross-referencing to ensure all the related
variables are more discoverable.

Issue: #20878
2022-03-13 14:29:05 +11:00
John Parent
2f1ffa003c find_package: Add support for default GLOBAL imported targets
Allow find package to promote scope of imported targets by specifying
an argument to `find_package` or by specifying a CMake variable.
    * Add support for CMAKE_GLOBAL_IMPORT_SCOPE variable
    * Add support for GLOBAL argument to find_package

Additionally add testing for above features.
2022-03-10 12:44:36 -05:00
Brad King
cbd36eac23 Merge topic 'ctest_truncate'
140704d443 ctest: add option for output truncation
359e5b17d8 presets: bump version to v5
4634de335b cmCTestTestHandler: refactor CleanTestOutput method

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6993
2022-03-09 12:17:44 -05:00
Brad King
363a0d6010 Merge topic 'doc-file-sets'
4286b72240 Help: Update install() docs to better reflect preference for file sets
ab1b573f41 Help: Reorganise FILE_SETS and related properties

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7031
2022-03-09 12:07:58 -05:00
Frank Winklmeier
140704d443 ctest: add option for output truncation
Add `--test-output-truncation` to `ctest`. This option can be used to
customize which part of the test output is being truncated. Currently
supported values are `tail`, `middle` and `head`.

Also add equivalent `CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION` variable.

Fixes: #23206
2022-03-08 08:18:02 -05:00
Craig Scott
4286b72240 Help: Update install() docs to better reflect preference for file sets
Previously, headers would typically be installed as bare files or
as whole directories. File sets offer a better abstraction and
associate headers with a target, installing them as part of the
target. Add notes and update examples to draw the reader's
attention to the advantages of file sets for headers.
2022-03-08 19:38:56 +11:00
Craig Scott
ab1b573f41 Help: Reorganise FILE_SETS and related properties
Reduce duplication and make the docs for target_sources() focus
on the functionality rather than the properties it modifies.
The properties are a lower level quantity, so put the relevant
details for them in the property documentation. The target_sources()
command only needs to reference the properties, not reproduce
the property documentation.

Improve the cross-referencing between the HEADER_... property
docs. This helps build the mental picture of how they relate to
each other.
2022-03-05 17:33:36 +11:00
Brad King
89457cb8f0 Merge topic 'file-set-name-requirements'
b357d334fc target_sources(): Enforce stricter requirements for FILE_SET name

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7037
2022-03-04 09:09:33 -05:00
Brad King
65da32c924 Merge topic 'file-set-name-requirements' into release-3.23
b357d334fc target_sources(): Enforce stricter requirements for FILE_SET name

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7037
2022-03-04 09:09:31 -05:00
Brad King
0d8bb14344 Merge topic 'file-set-multiple-names'
8c23ecbd93 target_sources(): Process multiple FILE_SET arguments per block

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7040
2022-03-04 09:07:04 -05:00
Kyle Edwards
8c23ecbd93 target_sources(): Process multiple FILE_SET arguments per block
Fixes: #23287
2022-03-03 14:31:54 -05:00
Kyle Edwards
b357d334fc target_sources(): Enforce stricter requirements for FILE_SET name
Fixes: #23286
2022-03-03 10:17:10 -05:00
Brad King
1ed1edbfd1 Merge topic 'file-set-no-custom-targets'
ad41c9cd11 target_sources(): Prohibit FILE_SET on custom targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7027
2022-03-02 07:45:58 -05:00
Kyle Edwards
ad41c9cd11 target_sources(): Prohibit FILE_SET on custom targets
Fixes: #23262
2022-02-28 17:21:04 -05:00
m.klimenko
231872ddb0 file(DOWNLOAD): Add options to download a range 2022-02-15 22:08:06 +03:00
Brad King
19b273b729 Help: Organize and clarify export() command documentation
Add section headers for each signature, and a synopsis linking to them.
Re-order sections to introduce the main `export(TARGETS)` functionality
before mentioning the `export(EXPORT)` shorthand, which may be confused
with `install(EXPORT)`.

Fixes: #23221
2022-02-14 12:16:50 -05:00
Brad King
41adfc6b04 Help: Clarify precedence of AND and OR in 'if' conditions
The wording update in commit b74819e4fe (Help: Format 'if' command
documentation, 2013-12-18, v3.0.0-rc1~227^2~1) incorrectly implied that
`AND` has higher precedence than `OR`.  Although this is common in many
languages, it has never been true in CMake's implementation.  Revise
the wording to clarify the precedence.

Add a test case demonstrating the order.

Fixes: #23207
2022-02-09 14:24:43 -05:00
Brad King
ec29a6a1a9 Help: Clarify documentation on SYSTEM include directories
Mention that system include directories are searched after normal
include directories.

Document that `IMPORTED_NO_SYSTEM` and `NO_SYSTEM_FROM_IMPORTED`
do not affect `INTERFACE_SYSTEM_INCLUDE_DIRECTORIES`.
2022-02-03 06:21:37 -05:00
Brad King
983df681c8 Merge topic 'help-try-compile-result-var'
34d263270e Help: Drop incorrect versionadded for try_compile result variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6923
2022-02-01 09:50:41 -05:00
friendlyanon
34d263270e Help: Drop incorrect versionadded for try_compile result variable
In commit c705279bae (Help: Add `.. versionadded` directives to commands
documentation, 2020-11-08, v3.20.0-rc1~508^2) we accidentally added
``versionadded`` markup suggesting that the first argument to
`try_compile` was fixed as `RESULT_VAR` prior to CMake 3.14.  This was
probably due to misinterpreting the change from commit 7975edeac5 (Help:
User-provided variable names for try_* commands, 2019-02-24,
v3.14.0-rc3~16^2~3).

The result variable has never been fixed.  Drop the incorrect markup.
2022-01-31 10:59:56 -05:00
Craig Scott
3efa3251e9 Help: Clarify relative path handling for target_include_directories()
Fixes: #22853
2022-01-31 16:24:07 +11:00
Peter Würth
c050d6a01e string(TIMESTAMP): add %f specifier for microseconds
The %f specified extends the string(TIMESTAMP) and file(TIMESTAMP)
commands to output the timestamp with a microsecond resolution.
This convention is offered by python's datetime module.
Before, the precision was limited to seconds.

The implementation is done by extending existing cmTimestamp methods
with a `microseconds` parameter. This parameter is optional in order to
be backwards compatible. The timestamps are now received in a
cross-platform manner using libuv, since the standard C functions like
time() don't allow for sub-second precision.

This requires libuv 1.28 or higher.  We already require higher than
that on Windows, so update the required version for other platforms.

Implements: #19335
2022-01-28 06:23:57 -05:00
Kyle Edwards
b7cd51d18a Help: Note the version in which define_property() arguments became optional 2022-01-21 09:24:15 -05:00
Kyle Edwards
fce24e4f10 define_property(): Add INITIALIZE_FROM_VARIABLE argument
Fixes: #20698
2022-01-20 09:05:35 -05:00
Brad King
196243d668 Merge topic 'define-property-optional-args'
edb5059216 define_property(): Make BRIEF_DOCS and FULL_DOCS optional
7d26baff46 cmDefinePropertyCommand: Refactor to use cmArgumentParser

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !6875
2022-01-19 09:06:58 -05:00
Kyle Edwards
edb5059216 define_property(): Make BRIEF_DOCS and FULL_DOCS optional
Issue: #20698
2022-01-18 15:52:01 -05:00
Marc Chevrier
e04a352cca Depfile parsing: enhance compatibility with GNU Make 2022-01-16 14:05:59 +01:00
Marc Chevrier
8a3aac990e Help: add_custom_command: describes depfile format 2022-01-11 12:51:11 +01:00
Craig Scott
6b170578b8 Help: Non-zero floating point numbers are true in if() expressions
Fixes: #22991
2022-01-04 08:45:23 +11:00
Adriaan de Groot
b151db01f9 Help: mention non-existent case for list(PREPEND) 2021-12-21 10:55:43 -05:00
Adriaan de Groot
b3a249c2cb Help: clarify range for list(INSERT), mention nonexistent / empty case 2021-12-21 10:55:35 -05:00
Adriaan de Groot
b6fdcb3df0 Help: clarify description of list(INSERT)
Since the argument is called 'index', use that in the description.
2021-12-21 10:55:32 -05:00
Adriaan de Groot
e55f473ea9 Help: clarify that list(APPEND) on a non-existent list creates it
This is hinted-at in the introduction, which mentions creating
a new variable value in the current scope, but let's make it
explicit.

Fixes: #22910
2021-12-21 10:55:22 -05:00
Craig Scott
a45e922768 Help: Clarify behavior of if(DEFINED) for cache and non-cache variables
Fixes: #23023
2021-12-20 19:27:39 +11:00
Brad King
1c77801636 Merge topic 'doc-if-basic-expressions'
294581a443 Help: Be more explicit about the behavior of if(<string>)
3a9695557d Help: Explicitly state that if(ENV{some_var}) is always false

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6768
2021-12-01 09:37:41 -05:00
Craig Scott
294581a443 Help: Be more explicit about the behavior of if(<string>) 2021-12-01 18:59:23 +11:00
Craig Scott
3a9695557d Help: Explicitly state that if(ENV{some_var}) is always false 2021-12-01 18:30:26 +11:00
Brad King
39624cc911 Merge topic 'doc-tests-labels-dynamic'
250acbb099 Help: Improve cross-referencing of test LABELS and related features
a77bdefa3e Help: Add missing version details for Additional Test Measurements

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6726
2021-11-15 09:24:42 -05:00
Craig Scott
250acbb099 Help: Improve cross-referencing of test LABELS and related features 2021-11-13 20:45:05 +11:00
Craig Scott
a77bdefa3e Help: Add missing version details for Additional Test Measurements 2021-11-13 20:44:05 +11:00
Brad King
e0a66059d4 Help: Fix target_sources FILE_SET signature summary
The `FILE_SET <set>` argument is required to activate this signature.
2021-11-05 10:24:12 -04:00
Brad King
79d379fba6 Help: Add versionadded markup to target_sources FILE_SET feature
This was accidentally left out of commit 4b0ee4e338 (Help: Add
documentation for target_sources(FILE_SET) and associated properties,
2021-07-02).
2021-11-05 10:19:10 -04:00
Brad King
5ca6b724d3 Merge topic 'doc-SOURCES-genex'
9fac18a4a6 Help: Clarify target_sources path conversion w.r.t generator expressions
9abd63dd3a Help: Explain how target SOURCES are interpreted

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Michael Hirsch <michael@scivision.dev>
Merge-request: !6692
2021-11-05 10:04:44 -04:00
Brad King
fc3f20a40f Merge topic 'doc-TARGET_RUNTIME_DLLS'
001870d451 Help: Clarify TARGET_RUNTIME_DLLS behavior on imported targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robertjmaynard@gmail.com>
Merge-request: !6700
2021-11-04 09:07:48 -04:00
Brad King
85771bbf00 Merge topic 'doc-TARGET_RUNTIME_DLLS' into release-3.22
001870d451 Help: Clarify TARGET_RUNTIME_DLLS behavior on imported targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robertjmaynard@gmail.com>
Merge-request: !6700
2021-11-04 09:07:47 -04:00
Arcturus Arcturus
9fac18a4a6 Help: Clarify target_sources path conversion w.r.t generator expressions
With some of the content expanded, reorder a few paragraphs
and tweak some of the wording to improve the flow.

Co-Authored-By: Craig Scott <craig.scott@crascit.com>
2021-11-04 20:24:19 +11:00
Brad King
001870d451 Help: Clarify TARGET_RUNTIME_DLLS behavior on imported targets
This generator expression does not report the locations of `.dll`
files on imported targets with the `UNKNWON` type, since their
`IMPORTED_LOCATION` refers to the import library and not the DLL.

Fixes: #22845
2021-11-03 16:17:17 -04:00
Brad King
22ab2488c9 Merge topic 'doc-configure_file-creates-directories'
fa47e9c8f9 Help: Document that configure_file can create directories

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6675
2021-10-29 08:51:24 -04:00
Marc Aldorasi
fa47e9c8f9 Help: Document that configure_file can create directories 2021-10-28 12:48:25 -04:00
Kyle Edwards
4b0ee4e338 Help: Add documentation for target_sources(FILE_SET) and associated properties 2021-10-27 15:17:23 -04:00
Arcturus Arcturus
1560265e7d Help: Fix file(INSTALL) docs w.r.t. CMAKE_INSTALL_MESSAGE
In commit c9568de52c (install: Add CMAKE_INSTALL_MESSAGE variable
(#13761), 2014-06-24, v3.1.0-rc1~370^2~1) we incorrectly documented
that `CMAKE_INSTALL_MESSAGE` controls the status message for
`file(INSTALL)`.  Revert that.

Fixes: #17162
2021-10-20 12:48:04 -04:00
Robert Maynard
67f8d20a8e Help: clarify list(POP_* <in_out> <in_out>) behavior 2021-10-14 08:53:17 +11:00
Craig Scott
96937438b7 Help: Clean up how TLS and NETRC variables are discussed
Mention of the fallback of the command options to the CMAKE_...
variables was repeated in places. The wording was also a bit
unclear about whether the fallback only occurred when neither
TLS or neither NETRC option was given to the command. Move
the fallback details directly to each relevant option instead.

Also use cross-referencing to the variables where it was not
linked previously.
2021-10-04 22:03:32 +11:00
Craig Scott
2a82bd85b6 Help: Add documentation for CMAKE_TLS_CAINFO 2021-10-04 21:48:00 +11:00
Craig Scott
84e02be51c Help: Restructure the find_package() docs
The explanation of the basic and full signatures was interwoven tightly
with that of the Module and Config search modes. Config mode is
supported by both signatures, which made the structure of the
command documentation a bit confusing.

Add a section at the start which unambiguously describes the two
modes, including the fallback functionality between them. Move the
text about this out of the basic signature section, leaving just a
description of the basic syntax with a note that it is supported by both
search modes. This makes the basic signature section more focused.

Drop the Module and Config mode parts of the titles for the basic and
full signature sections. Those are now more precisely covered by the
new opening section, so the Basic Signature and Full Signature sections
are now clearer in what they cover.

Swap the order of the Search Procedure and Version Selection sections
to improve the logical flow. Also add  "Config Mode" to their titles to
make it clearer what they apply to. Add a note at the start of both
sections to highlight their relationship to the basic and full signatures.
2021-09-23 21:56:33 +10:00
Craig Scott
dadb7a2ba5 Merge topic 'document_find_package_version_restrictions'
563139e5e9 Help: find_package document version only supports numeric components

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6510
2021-09-11 04:39:10 -04:00
Brad King
a4fccf74af Merge topic 'ctest-memcheck-generate-test.xml'
ce44c2cec3 ctest_memcheck: generate `DynamicAnalysis-Test.xml` as well

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6491
2021-09-10 09:29:42 -04:00
Robert Maynard
563139e5e9 Help: find_package document version only supports numeric components 2021-09-09 15:02:30 -04:00
Ben Boeckel
ce44c2cec3 ctest_memcheck: generate DynamicAnalysis-Test.xml as well
This is useful so that memcheck results also show up as test results on
CDash. It will be submitted with the other `MemCheck` parts.

Fixes: #22190
2021-09-08 21:04:46 -04:00
Johel Ernesto Guerrero Peña
c6a6c008f4 Help: Fix terminology for regular expression in if(MATCHES)
This was wrongly changed in commit ba90611225 (Help: Make synopsis of
if command more compact; add section headers, 2018-10-05).
2021-08-28 13:58:25 +10:00
Brad King
b0a24db270 Merge topic 'find-package-note'
d7e521bcd3 Help: find_package: Tweak change description

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6477
2021-08-25 09:19:04 -04:00
Brad King
cf90aa5595 Merge topic 'host-distro-info'
b9698f89df cmake_host_system_information: Make it available for all systems
5469c71a82 Refactor: Simplify `GetValue()` function calls
6c92f80f2e cmake_host_system_information: Also set `USED_FALLBACK_SCRIPT`
efe139d1b8 cmake_host_system_information: Can run fallback scripts
1e65e4a6e5 cmake_host_system_information: Can read `/etc/os-release` file
e808cbb1dd Testing: Convert `cmake_host_system_information` tests into `RunCMake`
9e831284e5 Documentation: Use definition list instead of tables
346f3de005 Refactor: Deduplicate code for `VS_nn_DIR` keys processing
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6410
2021-08-24 10:04:15 -04:00
FeRD (Frank Dana)
d7e521bcd3 Help: find_package: Tweak change description 2021-08-23 20:02:08 -04:00
FeRD (Frank Dana)
0c0ba17493 Help: get/set_property: Fix SOURCE grammars 2021-08-23 18:38:13 -04:00
Alex Turbov
b9698f89df cmake_host_system_information: Make it available for all systems
Before it was Linux only.
2021-08-20 09:35:12 -04:00
Alex Turbov
efe139d1b8 cmake_host_system_information: Can run fallback scripts 2021-08-20 09:35:12 -04:00
Alex Turbov
1e65e4a6e5 cmake_host_system_information: Can read /etc/os-release file 2021-08-20 09:35:09 -04:00
Brad King
8706f7a617 Merge topic 'symlinks-rebase-master'
58d10cf6f1 Alternative symlink-creating mode for file(INSTALL ...)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !6396
2021-08-10 09:25:15 -04:00
Craig Scott
ff687c07bf Merge topic 'doc-find_package-components'
b7d4567769 Help: Clarify find_package() component handling

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Brad King <brad.king@kitware.com>
Acked-by: Michael Hirsch <michael@scivision.dev>
Acked-by: Alex <leha-bot@yandex.ru>
Merge-request: !6436
2021-08-09 18:03:12 -04:00
Brad King
185e9d1619 Merge topic 'help_cmake_path'
bb19af546b Help: cmake_path: add missing parameter

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6431
2021-08-09 09:37:58 -04:00
Craig Scott
b7d4567769 Help: Clarify find_package() component handling
Fixes: #22513
2021-08-09 08:01:47 +10:00
Michael Hirsch
bb19af546b Help: cmake_path: add missing parameter
for cmake_path(`CONVERT` ... [NORMALIZE]) was missing in top summary
2021-08-06 11:55:53 -04:00
Brad King
70daea512d Merge topic 'string-TIMESTAMP-specifier-V'
aafa392c12 string(TIMESTAMP): Add %V specifier for ISO 8601 week number
a915f691ad Help: Format string(TIMESTAMP) format specifiers as a definition list

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6374
2021-08-03 11:08:34 -04:00
Brad King
cf49b5fb6b Merge topic 'help-get_filename_path-fix-version-changed'
8b28fe5670 Help: get_filename_component: fix version info for cmake_path

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6423
2021-08-03 10:57:44 -04:00
Felix Lelchuk
58d10cf6f1 Alternative symlink-creating mode for file(INSTALL ...)
An new environment variable 'CMAKE_INSTALL_MODE' is introduced,
which can be used to ask CMake to create symbolic links
instead of copying files during a file(INSTALL ...).

The operation is at the file level only, directory trees are
still created using actual directories, not links.

Signed-off-by: Felix Lelchuk <felix.lelchuk@gmx.de>
2021-08-02 19:42:26 +02:00
Antons Jeļkins
aafa392c12 string(TIMESTAMP): Add %V specifier for ISO 8601 week number
In ISO 8601 weeks begin with Monday. The first week of
the year is the week which contains the first Thursday
of the year.
2021-08-02 16:31:53 +02:00
Marc Chevrier
8b28fe5670 Help: get_filename_component: fix version info for cmake_path
Fixes: #22505
2021-08-02 11:12:46 +02:00
Alex Turbov
9e831284e5 Documentation: Use definition list instead of tables
Transform tables into definition list for `cmake_host_system_information`
command manual.
2021-07-30 03:40:13 +03:00
Brad King
0079f24f45 Merge topic 'doc-custom-command-depfiles' into release-3.21
f6e5743d0e Help: Clarify and correct wording around DEPFILE option

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6387
2021-07-26 09:39:55 -04:00
Brad King
2cc59a80b8 Merge topic 'doc-custom-command-depfiles'
f6e5743d0e Help: Clarify and correct wording around DEPFILE option

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6387
2021-07-26 09:39:55 -04:00
Craig Scott
18259fa689 Merge topic 'doc-ctest-output'
ba6d1947b6 Help: Add cross-references between test output size ctest variables
cdde9e5a10 Help: Improve wording and cross-referencing for ctest JUnit output

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6389
2021-07-26 07:48:02 -04:00
Craig Scott
cdde9e5a10 Help: Improve wording and cross-referencing for ctest JUnit output 2021-07-25 21:37:29 +10:00
Craig Scott
f6e5743d0e Help: Clarify and correct wording around DEPFILE option
The previous wording contradicted itself regarding whether
Visual Studio generators were supported, and about when
generator expressions could be used. Restructure the paragraphs
and max it clearer what support was added in which CMake
versions.
2021-07-24 15:08:21 +10:00
Brad King
a915f691ad Help: Format string(TIMESTAMP) format specifiers as a definition list
Also fix the version that added `%A` and `%B`.
2021-07-23 12:03:25 -04:00
Craig Scott
3f3179aad1 Merge topic 'doc-cleanups-3.21' into release-3.21
8d1944c675 Help: Expand details for file(COPY_FILE)
c8ea886123 Help: Re-order file() sub-commands in Filesystem section
b5a96716eb Help: Clarify which project() call PROJECT_IS_TOP_LEVEL is for
8be7694d97 Help: Fix trivial typo

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6361
2021-07-20 07:54:58 -04:00
Craig Scott
4e5d871e74 Merge topic 'doc-cleanups-3.21'
8d1944c675 Help: Expand details for file(COPY_FILE)
c8ea886123 Help: Re-order file() sub-commands in Filesystem section
b5a96716eb Help: Clarify which project() call PROJECT_IS_TOP_LEVEL is for
8be7694d97 Help: Fix trivial typo

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6361
2021-07-20 07:54:58 -04:00
Craig Scott
8d1944c675 Help: Expand details for file(COPY_FILE) 2021-07-20 08:49:04 +10:00
Craig Scott
c8ea886123 Help: Re-order file() sub-commands in Filesystem section
The file(COPY_FILE) sub-command is closely related to the
file(COPY) sub-command. Move the former to just before the
latter for improved continuity. The file(RENAME) sub-command is
also somewhat related to file(COPY_FILE), so it was also moved to
keep it just before file(COPY_FILE).

The file(MAKE_DIRECTORY) sub-command was also moved to just
before the file(REMOVE) and file(REMOVE_RECURSE) sub-commands
to keep them together and improve logical flow of operations.
2021-07-20 08:39:34 +10:00
Brad King
1f1f952e46 Merge topic 'Help-ctest_memcheck-shared-args'
85e740312f Help/ctest_test: add a comment to also update `ctest_memcheck`
731cfd45fd Help/ctest_memcheck: mention `ctest_test` arguments

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6351
2021-07-19 12:46:14 -04:00
Ben Boeckel
85e740312f Help/ctest_test: add a comment to also update ctest_memcheck
Since these commands share a common argument parser, the documentation
should be kept synchronized.
2021-07-19 12:45:17 -04:00
Craig Scott
8be7694d97 Help: Fix trivial typo 2021-07-18 15:57:06 +10:00
Ben Boeckel
731cfd45fd Help/ctest_memcheck: mention ctest_test arguments
These are handled internally by inheriting `ctest_test`'s argument
bindings. Synchronize the documentation.
2021-07-14 15:23:48 -04:00
Eugene Shalygin
a2e9fe38e4 find_package: Add variable to make package REQUIRED
Add a `CMAKE_REQUIRE_FIND_PACKAGE_<PackageName>` variable is complement
to `CMAKE_DISABLE_FIND_PACKAGE_<PackageName>` with just the opposite
behaviour: it turns non-required find_package call into the required one.

While optional package dependencies usually result in simple and clean
build logic, sometimes people want to be sure those optional
dependencies will be found and used. Examples are reproducible builds
and build instructions for 3rd parties. People choose to make
find_package calls REQUIRED and put them behind an option(). Such
workarounds blend build logic with build environment management and do
not look elegant.
2021-07-08 08:03:38 -04:00
Craig Scott
c97823b9b7 Merge topic 'doc-3.21-release'
24b76eaa93 Help: Improve readability and accuracy of runtime deps-related content
308e5b30c9 Help: Tighten install(SCRIPT) wording for ALL_COMPONENTS option
52dec01729 Help: Add missing versionadded 3.21 for file(RENAME) options

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6302
2021-07-05 20:02:28 -04:00
Craig Scott
24b76eaa93 Help: Improve readability and accuracy of runtime deps-related content
Duplicated textual patterns are factored out to make the text
more readable. The POST_INCLUDE_FILES and POST_EXCLUDE_FILES
were also previously missing from the main syntax block for
install(RUNTIME_DEPENDENCY_SET).
2021-07-04 17:37:29 +10:00
Craig Scott
308e5b30c9 Help: Tighten install(SCRIPT) wording for ALL_COMPONENTS option
In particular, mention the mutually exclusive nature with the
COMPONENT option. Fix the inconsistent way the versionadded
details were added for that text too.
2021-07-03 17:10:09 +10:00
Craig Scott
52dec01729 Help: Add missing versionadded 3.21 for file(RENAME) options 2021-07-03 17:10:09 +10:00
Zack Galbreath
0962cbf21d help: update ctest attached file example
Clarify that multiple files can be attached to a given test at runtime
2021-07-01 15:16:29 -04:00
Zack Galbreath
5489ce74b3 ctest: support <CTestMeasurement> for runtime measurements
Teach CTest to parse output for <CTestMeasurement> in addition to
<DartMeasurement> for measurements defined at runtime.

Use a new class (cmCTestTestMeasurementXMLParser) derived from cmXMLParser
to parse the data and attributes these XML elements. This is an improvement
over our previous approach of using a series of regular expressions.

As part of this commit we also rename some member variables and methods
to make their purpose more clear.

DartStuff                        -> AllTestMeasurementsRegex
DartStuff1                       -> SingleTestMeasurementRegex
DartString                       -> TestMeasurementsOutput
GenerateDartOutput()             -> GenerateCTestXML()
GenerateRegressionImages()       -> RecordCustomTestMeasurements()
cmCTestRunTest::DartProcessing() -> ParseOutputForMeasurements()
2021-07-01 15:16:23 -04:00
Heiko Thiel
0106842af4 Help: Clarify condition of tree command from source_group. 2021-06-23 17:24:09 +02:00
Brad King
9612034cac Merge topic 'doc-source_group-scope'
2abce79409 Help: Clarify the usage scope of source_group

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6246
2021-06-21 09:58:04 -04:00
Heiko Thiel
2abce79409 Help: Clarify the usage scope of source_group
Fixes: #18856
2021-06-18 12:52:43 -04:00
Zack Galbreath
bd38749fd4 ctest: allow test output to add labels
Parse test output for <CTestLabel>...</CTestLabel>.
If found, add this value to the list of labels associated with this test.
2021-06-17 14:09:01 -04:00
Marc Chevrier
4665d1e69a Help: cmake_path: fix erroneous example for IS_PREFIX
Fixes: #22302
2021-06-12 11:23:47 +02:00
Marc Chevrier
e49cbf1d44 Help: cmake_path: fix erroneous example for IS_PREFIX 2021-06-12 11:22:40 +02:00
Brad King
5fd68d3ef7 Merge topic 'vs-custom-depfile'
526e2ef71c VS: Add support for add_custom_command DEPFILE
794ad78abb Help: Generalize release note filename for add_custom_command DEPFILE
7291f31254 cmTransformDepfile: Add support for MSBuild AdditionalInputs format
a6de8ec51b cmTransformDepfile: Make directory for transformed depfile automatically

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6206
2021-06-10 08:23:45 -04:00
Brad King
526e2ef71c VS: Add support for add_custom_command DEPFILE
Transform the depfile into MSBuild `AdditionalInputs` content.  Add
MSBuild Targets to update `AdditionalInputs` and the `.tlog` files for
future builds without actually modifying the `.vcxproj` file.

Fixes: #20286
2021-06-09 10:09:58 -04:00
Zack Galbreath
02f1271bdf ctest: allow test output to override the 'details' field
Parse test output for <CTestDetails>...</CTestDetails>.
If found, use this value to override the default 'Details' string reported
to CDash.
2021-06-09 08:31:32 -04:00
Brad King
5c18c8a178 Merge topic 'ctest_measurement_file'
cbcb92d1cb ctest: add support for attaching files to tests at run time

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6192
2021-06-09 08:04:23 -04:00
Brad King
7aad9e8685 Merge topic 'add_hip_language'
8514ee9b31 HIP: analyze output of `hipcc` to determine default GPU architecture
20d086f1a2 HIP: All HIP tests now run on CMake's current AMD hardware
2e86e50c2f HIP: Add HIP to all the Check* modules
947dbed0aa HIP: Automatically inject the `hip::device` runtime target
b50bfc8913 HIP: Add language to CMake
ff0d2858e1 HIP: Extract clang compiler details from hipcc
bd844387df ROCMClang: Add the ROCm toolkit derived clang compiler to CMake
590553f322 Compilers: protect use of  __has_include
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Zack Galbreath <zack.galbreath@kitware.com>
Reviewed-by: Raul Tambre <raul@tambre.ee>
Acked-by: Axel Huebl <axel.huebl@plasma.ninja>
Merge-request: !6121
2021-06-09 07:53:32 -04:00
Zack Galbreath
cbcb92d1cb ctest: add support for attaching files to tests at run time
Allow tests to specify files to upload at runtime. Previously this was
only possible to specify at configure time with the ATTACHED_FILES
test properties.

This commit also fixes a bug in how our test data tarballs were generated
by CTest. Previously, if you tried to attach a file outside of the binary
directory, CTest would generate a tar file with a relative path, and tar
would not allow you to extract it. We resolve this problem by creating
tar files with a flat directory structure instead.

Fixes: #22284
2021-06-08 09:27:19 -04:00
Robert Maynard
b50bfc8913 HIP: Add language to CMake 2021-06-07 19:25:33 +00:00
Kyle Edwards
72f2448e82 Help: Add documentation for runtime dependency installation 2021-06-04 15:25:18 -04:00
Brad King
9c33ff4dda Merge topic 'find_item-NO_CACHE'
87b71eec62 find_*: Add support for option NO_CACHE

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !6181
2021-06-03 08:11:04 -04:00
Brad King
e6bcd5e45a Merge topic 'doc_regex'
0d210b92fa Help: links to CMake regex syntax

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6179
2021-06-03 08:09:34 -04:00
Marc Chevrier
87b71eec62 find_*: Add support for option NO_CACHE
Request that find result is stored in a normal variable rather than a
cache entry.

Fixes: #20687
Issue: #20743
2021-06-02 14:55:00 -04:00
Michael Hirsch
0d210b92fa Help: links to CMake regex syntax 2021-06-02 10:30:21 -04:00
Brad King
cf470d8dac Merge topic 'command_target'
1cb4f592a0 add_custom_command: Target-dependent generator expression support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6176
2021-06-02 07:39:44 -04:00
Brad King
399a321a64 Merge topic 'get-runtime-dependencies-file-filter'
a12639e658 file(GET_RUNTIME_DEPENDENCIES): Add POST_{IN,EX}CLUDE_FILES arguments

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6170
2021-06-02 07:38:17 -04:00
Kyle Edwards
a12639e658 file(GET_RUNTIME_DEPENDENCIES): Add POST_{IN,EX}CLUDE_FILES arguments 2021-06-01 09:02:33 -04:00
Brad King
02957bb589 Merge topic 'install-imported-runtime-artifacts'
f7ba3a0589 FileAPI: Populate information for IMPORTED_RUNTIME_ARTIFACTS
df7040a271 install(): Add IMPORTED_RUNTIME_ARTIFACTS mode
60e752ced8 Refactor: Move common methods into cmInstallGenerator

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6162
2021-06-01 08:42:16 -04:00
Kyle Edwards
df7040a271 install(): Add IMPORTED_RUNTIME_ARTIFACTS mode 2021-05-31 09:02:45 -04:00
Raul Tambre
1cb4f592a0 add_custom_command: Target-dependent generator expression support
OUTPUT variant with a TARGET given to allow resolving target-based generator
expressions wouldn't work because OUTPUT is resolved before generator targets
are created, i.e. FindGeneratorTargetToUse() returns nullptr.
This is a known limitation, see #21364.

Implements #21336.
2021-05-31 10:39:58 +03:00