Commit Graph

32126 Commits

Author SHA1 Message Date
Brad King 25b9fb0b1a Merge topic 'link-interface-direct'
cf312a2e54 LINK_LIBRARIES: Add support for LINK_ONLY genex
41a6b4a53b INTERFACE_LINK_LIBRARIES_DIRECT: Honor link dependencies through LINK_ONLY
73337cb383 LINK_LIBRARIES: Evaluate separately for linking and usage requirements

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7107
2022-03-25 09:12:39 -04:00
Brad King 96420a4afd Merge topic 'cmake-fresh'
9f1471739d cmake: Add --fresh option to clear the cache and start from scratch

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !7099
2022-03-25 09:09:56 -04:00
Brad King b11d789ef7 Merge topic 'cmake-E-tar-touch'
0b7fd783f8 cmake -E tar: Add --touch option
f692cba34b Tests: Add test for 'cmake -E tar --mtime' option

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7061
2022-03-25 09:05:41 -04:00
Kitware Robot 2328843450 CMake Nightly Date Stamp 2022-03-25 00:01:08 -04:00
Brad King cf312a2e54 LINK_LIBRARIES: Add support for LINK_ONLY genex
Previously we always used content guarded by `$<LINK_ONLY:...>`
in `LINK_LIBRARIES`, even when evaluating for non-linking usage
requirements.  Add a policy to honor `LINK_ONLY` in `LINK_LIBRARIES`
the same way we already do in `INTERFACE_LINK_LIBRARIES`.
2022-03-24 08:23:55 -04:00
Kitware Robot 289ac21a46 CMake Nightly Date Stamp 2022-03-24 00:01:24 -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
Kitware Robot 7936fc65dc CMake Nightly Date Stamp 2022-03-23 00:01:46 -04:00
Brad King 41a6b4a53b INTERFACE_LINK_LIBRARIES_DIRECT: Honor link dependencies through LINK_ONLY
In commit f3ad061858 (Add usage requirements to update direct link
dependencies, 2022-01-12, v3.23.0-rc1~44^2), we evaluated the transitive
closure of `INTERFACE_LINK_LIBRARIES` as a non-linking usage requirement.
That left out `INTERFACE_LINK_LIBRARIES_DIRECT` link dependencies that
appear behind private dependencies of a static library, guarded by the
`$<LINK_ONLY:...>` generator expression.  At the time, that decision was
intentional, in order to prevent arbitrary usage requirements from
leaking out of `PRIVATE` dependencies.

Since then, we've revised evaluation of `LINK_LIBRARIES` to distinguish
between collecting link dependencies and other usage requirements.  Use
that information when following `INTERFACE_LINK_LIBRARIES` to collect
the matching kind of requirements from `INTERFACE_LINK_LIBRARIES_DIRECT`.

Fixes: #22496
2022-03-22 11:57:48 -04:00
Brad King 73337cb383 LINK_LIBRARIES: Evaluate separately for linking and usage requirements
We evaluate `LINK_LIBRARIES` and `INTERFACE_LINK_LIBRARIES` for two purposes:

* Constructing the link line.
* Collecting usage requirements.

We evaluate `INTERFACE_LINK_LIBRARIES` separately for each purpose in
order to support the `$<LINK_ONLY:...>` generator expression used to
express private link dependencies of a static library.  Previously we
only evaluated `LINK_LIBRARIES` for linking, and used that result for
collecting usage requirements too.  Therefore `$<LINK_ONLY:...>` does
not work in `LINK_LIBRARIES`.

With the introduction of `INTERFACE_LINK_LIBRARIES_DIRECT`, evaluation
of `LINK_LIBRARIES` now needs to distinguish these two cases in order to
honor link dependencies encountered through `$<LINK_ONLY:...>` without
also exposing other usage requirements through private dependencies of a
static library.  Revise internal infrastructure to distinguish the two
cases when evaluating `LINK_LIBRARIES`.  Make the information available
in code paths for `INTERFACE_LINK_LIBRARIES_DIRECT` and `LINK_ONLY`.
Defer actually using the information to later commits.

Issue: #22496
2022-03-22 11:57:48 -04:00
Brad King 2aad4cef97 Merge topic 'revert-link-interface-direct-for-3.23' into release-3.23
687a91967f Revert INTERFACE_LINK_LIBRARIES_DIRECT feature for 3.23 branch

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7098
2022-03-22 11:56:43 -04:00
Brad King 9f1471739d cmake: Add --fresh option to clear the cache and start from scratch
Simplify the workflow to re-run CMake from scratch as if a build tree
were never before processed, regardless of whether it has been.

Fixes: #23119
2022-03-22 09:27:47 -04: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 a20424e737 Merge topic 'productbuild-rootVolumeOnly'
2a8df7e7db productbuild: Don't write rootVolumeOnly attribute if writing domains
95eb8cbcfc CPack: Avoid space / tab mix in productbuild distribution.xml template
28fdc3a536 productbuild: Simplify internal CPACK_PRODUCTBUILD_DOMAINS usage

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7092
2022-03-22 08:51:02 -04:00
Kitware Robot e4039a8e34 CMake Nightly Date Stamp 2022-03-22 00:01:18 -04:00
Brad King 7e642a6fa0 Merge topic 'ghs_predefined_targets'
399e73b89a GHS: release note
829e946c69 GHS: Update tests for updated binary layout
93c1acd8ff GHS: List predefined targets before user targets in GUI
bdb213819c GHS: Do not include WindowsPaths
b3e9c72901 GHS: use INSTALL target
a645287784 GHS: update build command
724b5491ef GHS: Rearrange project files in binary directory
edff0f6a1d GHS: Use Custom Target for ALL_BUILD
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7079
2022-03-21 14:36:42 -04:00
Brad King 687a91967f Revert INTERFACE_LINK_LIBRARIES_DIRECT feature for 3.23 branch
Revert commit f3ad061858 (Add usage requirements to update direct link
dependencies, 2022-01-12, v3.23.0-rc1~44^2) and the property storage
updates in its predecessor commit 193a999cd5 (cmTarget: Add
INTERFACE_LINK_LIBRARIES_DIRECT{,_EXCLUDE} backtrace storage,
2022-01-06, v3.23.0-rc1~44^2~1) from the 3.23 release branch.

After initial experience using the feature in practice, additional
design considerations have been raised for discussion in the original
issue.  To avoid rushing this for the 3.23 series, we've decided to
revert the feature for now so it can be revised for a future release.

Issue: #22496
2022-03-21 13:17:32 -04:00
Craig Scott 2a8df7e7db productbuild: Don't write rootVolumeOnly attribute if writing domains
The rootVolumeOnly attribute is deprecated. Apple docs say to use
domains instead.

Fixes: #23343
2022-03-21 15:43:46 +11:00
Kitware Robot baad545eb8 CMake Nightly Date Stamp 2022-03-21 00:01:13 -04:00
Craig Scott 28fdc3a536 productbuild: Simplify internal CPACK_PRODUCTBUILD_DOMAINS usage
There's no benefit to storing the CPACK_PRODUCTBUILD_DOMAINS
prefix in a variable and appending to it in the C++ code. It has the
disadvantage of making it harder to find usages of the variables with
a suffix appended to that string. Expand out the strings at the places
they are used so that they are easier to spot.
2022-03-21 13:36:48 +11:00
Kitware Robot 2e80562b66 CMake Nightly Date Stamp 2022-03-20 00:01:08 -04:00
Craig Scott 87c3b5e421 define_property(): Only test prefix if INITIALIZE_FROM_VARIABLE is given 2022-03-19 17:33:45 +11:00
Kitware Robot 6657551482 CMake Nightly Date Stamp 2022-03-19 00:01:23 -04:00
Brad King 66ba460810 CMake 3.23.0-rc4 2022-03-18 08:26:30 -04:00
Brad King 5dbd068827 Merge topic 'cmake-P-args'
36056ff5a3 cmake: Improve acceptance of arbitrary arguments in -P script mode

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7083
2022-03-18 07:20:24 -04:00
Brad King 32e40f7f53 Merge topic 'always_prefer_last_source_dir'
b44ad7992a cmake: Always prefer the last source directory provided

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7084
2022-03-18 07:16:24 -04:00
Brad King b782d9e124 Merge topic 'always_prefer_last_source_dir' into release-3.23
b44ad7992a cmake: Always prefer the last source directory provided

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7084
2022-03-18 07:16:23 -04:00
Kitware Robot fafaca5fee CMake Nightly Date Stamp 2022-03-18 00:01:16 -04:00
Fred Baksik 93c1acd8ff GHS: List predefined targets before user targets in GUI 2022-03-17 19:11:47 -04:00
Fred Baksik b3e9c72901 GHS: use INSTALL target
For consistancy use upper case install for pre-defined targets.
2022-03-17 19:11:45 -04:00
Fred Baksik a645287784 GHS: update build command
* Remove unecessary logic for selecting gbuild
  -- CMake defaults to the Cache entry

* Support building multiple targets

* Fix error when ctest passes in a vector potentially containing
  an empty string.
  -- At minimum build the ALL_BUILD project, never just the Top Project.

* Add verbose support

* There can only be one top-level project per directory because the
  project() command can only be used once per directory. Multiple calls
  of project() only use the last invocation.
2022-03-17 19:11:44 -04:00
Fred Baksik 724b5491ef GHS: Rearrange project files in binary directory
The top level project and the target projects are all in the same
directory so they are easier to find and looks nicer in the GUI.

All of the ancillary project files are located in the target
subdirectory.
2022-03-17 19:11:44 -04:00
Fred Baksik edff0f6a1d GHS: Use Custom Target for ALL_BUILD
Use a Custom Target for ALL_BUILD instead of special code.

This also changes the name from <project>.ALL_BUILD.tgt to
ALL_BUILD.tgt.  The name change is part of standardizing the
CMakePredefinedTargets names.
2022-03-17 19:11:43 -04:00
Fred Baksik ad426aa697 GHS: Create RERUN_CMAKE Custom Target
Create a Custom Target that will re-run CMake on user demand if any of
the CMake input files have changed.
2022-03-17 19:11:42 -04:00
Fred Baksik 2f2e88900e GHS: Fix gbuild job control
gbuild command line is "-parallel[=n]".

Fixes: #23252
2022-03-17 16:56:51 -04:00
Robert Maynard b44ad7992a cmake: Always prefer the last source directory provided
Fixes: #23334
2022-03-17 15:23:01 -04:00
Brad King 36056ff5a3 cmake: Improve acceptance of arbitrary arguments in -P script mode
The fix in commit e4f1b301fe (cmake: Allow arbitrary args passed to
CMake script, 2020-05-04, v3.18.0-rc1~211^2) only applied to "cache"
arguments like `-DFOO`.  Extend the fix to allow arbitrary arguments
that collide with other CMake arguments like `-S` and `-B`.
2022-03-17 13:50:12 -04:00
Brad King e56afbca89 Merge topic 'tll-genex-concat'
add64399c5 target_link_libraries: Restore LINK_ONLY for multiple static lib dependencies

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7078
2022-03-17 09:13:47 -04:00
Kitware Robot c4f4981306 CMake Nightly Date Stamp 2022-03-17 00:01:18 -04:00
Brad King 4e54f56ebd Merge topic 'cm_cxx_filesystem.cxx-revert-erroneous-change'
10689e564f cm_cxx_filesystem.cxx: revert erroneous change

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7072
2022-03-16 11:22:09 -04:00
Brad King add64399c5 target_link_libraries: Restore LINK_ONLY for multiple static lib dependencies
Since commit c1e812ad4f (target_link_libraries: Improve tolerance of
unquoted generator expressions, 2022-02-15, v3.23.0-rc2~11^2) we
accumulate consecutive non-keyword arguments to recover an unquoted
generator expression as a single entry.  When given multiple consecutive
non-genex library names, the grouping breaks our logic that expects each
entry is either a raw target name or a genex.  Revise the logic to only
accumulate multiple arguments when they end inside a partial genex.

This bug caused `target_link_libraries` to stop wrapping static library
private dependencies in `$<LINK_ONLY:...>` for `INTERFACE_LINK_LIBRARIES`
when multiple consecutive library names are given.  Add a test case
covering that behavior.

Fixes: #23302
2022-03-16 10:47:32 -04:00
Kitware Robot ef0cdcf050 CMake Nightly Date Stamp 2022-03-16 00:01:16 -04:00
Brad King 03a2b524d3 Merge topic 'find_package-global-imported'
f5bca247ee cmMakefile: Add missing initializer for recently added member

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7073
2022-03-15 12:43:12 -04:00
Brad King f5bca247ee cmMakefile: Add missing initializer for recently added member
In commit 2f1ffa003c (find_package: Add support for default GLOBAL
imported targets, 2022-03-10) we added a field without an initializer.
This was exposed by a few failures in nightly testing.  Previously it
worked only by chance that the member's memory had suitable values.
2022-03-15 11:23:32 -04:00
Marc Chevrier 10689e564f cm_cxx_filesystem.cxx: revert erroneous change
Revert erroneous change introduced by commit 0a81ea1.
2022-03-15 15:38:09 +01:00
Kitware Robot 486e87331a CMake Nightly Date Stamp 2022-03-15 00:01:18 -04:00
Kitware Robot 1422ff20aa CMake Nightly Date Stamp 2022-03-14 00:01:23 -04:00