Commit Graph

1121 Commits

Author SHA1 Message Date
Robert Maynard
42f7e39789 Find: Support per call disabling of CMAKE_INSTALL_PREFIX
Fixes #23359
2022-04-15 09:33:55 -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