Commit Graph
9691 Commits
Author SHA1 Message Date
Brad King f890d7a75f Merge topic 'math-increment-decrement'
8cf21478ac math(): Add INCREMENT and DECREMENT modes

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !12280
2026-07-17 10:34:48 -04:00
Brad King 7991e0dc19 Merge topic 'alias-transparency-install'
77156c92eb ALIAS: Add support for install and export commands

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12260
2026-07-17 10:23:26 -04:00
Brad King a79eb9dcc4 Merge topic 'instrumentation-interrupt-ctest'
d5d2741414 Instrumentation: Write ctest snippet on interrupted test run

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12272
2026-07-17 10:21:51 -04:00
Kyle Edwards 8cf21478ac math(): Add INCREMENT and DECREMENT modes 2026-07-15 11:40:07 -04:00
Daksh Mamodiya d5d2741414 Instrumentation: Write ctest snippet on interrupted test run
Extend the interrupt-flush mechanism already used for cmakeBuild and
cmakeInstall to ctest, so that a user interrupt (e.g. Ctrl+C) still writes
the overall ctest instrumentation snippet, marked with interruptSignal,
before exiting.

On interrupt CTest stops scheduling further tests at every launch site,
skips the postCTest hook, forces a non-zero exit status, and preserves the
checkpoint file so that a later 'ctest -F' can resume the interrupted test
set.

Issue: #27859
2026-07-14 20:40:09 +02:00
Brad King 06942468dd Merge topic 'print_targets'
45623dd5f6 cmake_language: Add PRINT_TARGETS operation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12225
2026-07-14 09:23:12 -04:00
Arha Gatram 77156c92eb ALIAS: Add support for install and export commands
The install({TARGETS, EXPORT}) versions of the command now accept ALIAS
targets. The behavior is identical to what would happen if the name of
the target that the ALIAS references were put instead. The
export(TARGETS) command also has the same support and behavior for ALIAS
targets now.

Closes: #20979
2026-07-10 17:01:49 -07:00
Matthew Woehlke cc94d43f52 CPS: Add release note for file set import/export 2026-07-09 16:08:47 -04:00
Tom Osika 45623dd5f6 cmake_language: Add PRINT_TARGETS operation
Print CMake targets in human-readable form for debugging.

Issue: #27513
2026-07-09 16:02:12 -04:00
Brad King 0d9a4242e4 Merge topic 'alias-transparency'
17094eb572 ALIAS: Add test for generator expressions with ALIAS targets
5f8cc64695 ALIAS: Add support for add_dependencies for ALIAS targets
79e421b053 ALIAS: Add support for target_* commands
3b327695aa ALIASED_TARGET: Make property read-only
a121419908 ALIAS: Add support for set_property and set_target_properties commands

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12207
2026-07-09 10:06:32 -04:00
Arha Gatram 5f8cc64695 ALIAS: Add support for add_dependencies for ALIAS targets
The add_dependencies command currently accepts ALIAS targets for
<target-dependencies> which resolve to the referenced target. This further
relaxes the command to accept an ALIAS <target> where the command will
add the dependencies to the target which the alias references.
2026-07-08 11:51:51 -04:00
Arha Gatram 79e421b053 ALIAS: Add support for target_* commands
Now that set_property and set_target_properties support ALIAS targets,
we need to extend support to all the target_* type commands that modify
target properties.

Relaxes target_compile_definitions, target_compile_features,
target_compile_options, target_include_directories,
target_link_directories, target_link_libraries, target_link_options,
target_precompile_headers, and target_sources to now accept ALIAS
targets. These commands set properties on the target which the alias
references.
2026-07-08 11:51:50 -04:00
Brad King be81b4e20b Merge topic 'instrumentation-interrupt-install'
63e4a989e0 Instrumentation: Write cmakeInstall snippet on interrupted install

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12250
2026-07-08 10:54:09 -04:00
Brad King ccfef28ee4 Merge topic 'ctest-launch-signal-passthrough'
899e7231ab CTest: Report failure when a launched command is killed by a signal

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12248
2026-07-08 10:41:17 -04:00
Brad King e55cf93295 Merge topic 'remove-vs14-generator'
5b0aee4961 Drop Visual Studio 14 2015 generator

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12245
2026-07-08 09:29:06 -04:00
Brad King abbf8adfd5 Merge topic 'doc-component-indent'
273c414ece Help: Dedent multiple install `--component`s note

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12244
2026-07-07 10:47:45 -04:00
Arha Gatram 3b327695aa ALIASED_TARGET: Make property read-only
The ALIAS_GLOBAL property is read-only, so ALIASED_TARGET should be as
well. Even when set, there is no way to read the property value, so this
change gives an explicit error for users.
2026-07-07 07:32:35 -07:00
Arha Gatram a121419908 ALIAS: Add support for set_property and set_target_properties commands
Currently, getting properties from an ALIAS target retrieves the property
from the target which the alias references while setting properties results
in an error. This relaxes set_property and set_target_properties to
accept ALIAS targets and act on the referenced target, mirroring the get
behavior.

An error is raised when setting ALIAS_GLOBAL or ALIASED_TARGET on an ALIAS
target.

Closes: #19445
2026-07-07 07:32:27 -07:00
Daksh Mamodiya 899e7231ab CTest: Report failure when a launched command is killed by a signal
cmCTestLaunch, which backs ctest --launch and ctest --instrument,
derived its exit code from the child's SpawnResult and ExitStatus but
ignored TermSignal.  On POSIX a command killed by a signal reports
ExitStatus 0 and TermSignal N, so the launcher reported success for a
crashed or killed command, masking failed compile/link/custom rules on
the dashboard and in instrumentation snippets.

Classify the child with the ordered triple SpawnResult, TermSignal,
ExitStatus, mapping a signal-killed child to a non-zero exit code.
Native Windows is unaffected: abnormal termination already arrives as a
non-zero exit code there.

Fixes: #27921
2026-07-06 15:46:37 +02:00
Daksh Mamodiya 63e4a989e0 Instrumentation: Write cmakeInstall snippet on interrupted install
With instrumentation enabled, interrupting `cmake --install` (Ctrl+C)
terminated the process before its overall `cmakeInstall` envelope
snippet was written, orphaning the per-script `install` snippets.

Extend the `cmake --build` interrupt handling to the install site: wrap
the `cmakeInstall` command in `HandleInterrupt`, skip the post-install
hook, and re-raise so the exit status reflects the signal.  Add
cooperative cancellation so the command unwinds -- serial-loop and
parallel `queueScripts` guards stop launching further scripts, and the
parallel failure aggregation is scoped to dispatched runners so
un-launched scripts are not counted as failed.  Force a non-zero result
on interrupt (Windows cannot re-raise), and write the envelope
atomically so a second Ctrl+C cannot truncate it.

Issue: #27859
2026-07-06 15:17:58 +02:00
Brad King 5b0aee4961 Drop Visual Studio 14 2015 generator
This generator has been deprecated since CMake 4.2.  Remove it.
2026-07-03 11:53:32 -04:00
Tyler Yankee 273c414ece Help: Dedent multiple install --components note 2026-07-03 09:09:59 -04:00
Brad King 1fde7f4599 Merge topic 'install-exit-code-fidelity'
ae5f506906 Install: Exit non-zero when an install script fails

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12227
2026-07-01 09:54:52 -04:00
Brad King 9883f84e8f Merge topic 'genex-list-sort-comparator'
4d86ef5e86 GenEx: add $<LIST:SORT,...,COMPARATOR,body> comparator
c418a3dc85 GenEx: factor out reusable SORT comparator and option-parsing helpers
e335872625 GenEx: generalize bound operands to a frame and add $<_1>

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12228
2026-07-01 09:46:35 -04:00
Brad King 28ce1b8bc3 Merge topic 'test-out-of-date'
e11b5827c3 ctest: Add --out-of-date option for running out of date tests

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12180
2026-07-01 09:45:18 -04:00
Brad King c954e11ade Merge topic 'Target-file_set-introspection-properties'
08855d03c2 Add target properties to discover target's file set information

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12224
2026-07-01 09:40:58 -04:00
Daksh Mamodiya ae5f506906 Install: Exit non-zero when an install script fails
`cmake --install` did not propagate per-script failures into its
process exit code.

In parallel mode, cmInstallScriptHandler::Install spawned each install
script as a child process but never inspected the child exit status or
termination signal, and always returned 0.  It now reads each child's
status after the event loop, prints the failing script's exit code or
signal, and returns non-zero if any script failed.  A failed parallel
install also no longer writes the combined install_manifest.txt, so a
partial manifest is not mistaken for a complete install.

In serial mode, GetScripts() returns the top-level cmake_install.cmake
once per component and per configuration, so multiple scripts run only
when installing several components or configurations at once.  The loop
overwrote its result on every iteration, so an earlier script that
failed via cmake_language(EXIT) was masked by a later one that
succeeded.  The loop now stops at the first failure.  This is a no-op
for a single component and configuration; it changes only installs of
multiple components or configurations, which now stop at the first
failed script and report it instead of attempting the rest.

Fixes: #27906
2026-06-30 18:06:50 +02:00
Martin Duffy e11b5827c3 ctest: Add --out-of-date option for running out of date tests
Add an --out-of-date option to ctest which runs only those tests with
recorded build dependencies whose timestamps are newer than the timestamp
at which the test last finished.

Fixes: #27614
2026-06-30 11:31:35 -04:00
Mickaël Germain 4d86ef5e86 GenEx: add $<LIST:SORT,...,COMPARATOR,body> comparator
Add a COMPARATOR form to $<LIST:SORT> that orders the list by a caller-defined
rule: a <body> evaluated per comparison with the two elements bound to $<_0>
and $<_1>, yielding "1" when the first should sort before the second.  This
brings the custom ordering of list(SORT ... COMPARATOR) to generate time, so
elements can be ordered by target properties or any other generator expression.
CASE: and ORDER: still apply, while COMPARE: is rejected because the body
defines the ordering.

Fixes: #27892
2026-06-30 08:19:41 -07:00
Marc Chevrier 08855d03c2 Add target properties to discover target's file set information
Currently, target properties related to file sets are specific to file set
type (for example "SOURCE_SETS"). This raises some concerns:
1. For each new file set type, 6 new properties are created which need a lot
   off documentation update
2. there is no "generic" way to discover file sets information

The new target properties (FILE_SET_TYPES, FILE_SETS_<TYPE>,
and INTERFACE_FILE_SETS_<TYPE>), in conjunction with the file sets
properties, enable a complete generic file sets information discovery.
2026-06-30 16:03:32 +02:00
Brad King 4933a2de10 Merge topic 'testprep-makefile-generators'
503bdb9777 Makefile: Generate test_prep targets for CMAKE_TEST_BUILD_DEPENDS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12214
2026-06-29 11:59:57 -04:00
Brad King 5e6410b97e Merge topic 'genex-list-filter-transform-predicate'
0b5a172c22 Help: hyperlink $<_0> and configure-time commands in $<LIST> docs
092edb6860 GenEx: add $<LIST:FILTER> PREDICATE filter and REGEX keyword
d2ad140ef9 GenEx: add PREDICATE selector to $<LIST:TRANSFORM>
6024f624b0 GenEx: factor TRANSFORM action descriptor lookup

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12213
2026-06-29 11:46:22 -04:00
Brad King cdcc758ff5 Merge topic 'SOURCE_GROUP-property'
faeeac60e8 Add SOURCE_GROUP properties for file set and source file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12215
2026-06-25 11:25:08 -04:00
Mickaël Germain 0b5a172c22 Help: hyperlink $<_0> and configure-time commands in $<LIST> docs
Several $<LIST> doc references appeared as plain literal text: the bound
operand $<_0>, the configure-time list(TRANSFORM ... APPLY) command (the
TRANSFORM APPLY action title and prose), and the $<LIST:TRANSFORM,...,APPLY,body>
example in the $<_0> definition.  Use the :genex: and :command: roles so they
hyperlink to their definitions, matching the sibling canned actions and the
rest of the manual.

Issue: #27892
2026-06-25 11:20:52 -04:00
Brad King 944ff5e7aa Merge topic 'freebsd-get-runtime-dependencies'
ad0dfd51ba Tests: Enable some Linux cases on FreeBSD
144021a43b file(GET_RUNTIME_DEPENDENCIES): Implement command for FreeBSD

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12192
2026-06-25 07:33:06 -04:00
Brad King 1521c231c2 Merge topic 'FindDoxygen-USES_TERMINAL'
89de655356 FindDoxygen: Add USES_TERMINAL option to doxygen_add_docs()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12184
2026-06-25 07:31:24 -04:00
Gleb Popov 144021a43b file(GET_RUNTIME_DEPENDENCIES): Implement command for FreeBSD
Closes: #25305
2026-06-24 18:49:51 +03:00
Daksh Mamodiya 503bdb9777 Makefile: Generate test_prep targets for CMAKE_TEST_BUILD_DEPENDS
Extend the test_prep/<test> and test_prep/all build targets, generated
from add_test(BUILD_DEPENDS) when CMAKE_TEST_BUILD_DEPENDS is enabled, to
the Makefile generators.  Previously only the Ninja and FASTBuild
generators provided them.

Resolve each test's dependencies in a shared layer so all command-line
generators consume one result.  cmTestGenerator now filters target
dependencies to build-system targets and records, for each file
dependency, the single target that produces it as a primary
custom-command output (cmGlobalGenerator::FindOutputOwningTarget).  The
Makefile generators emit phony rules in CMakeFiles/Makefile2 depending on
<target>.dir/all, with top-level forwarding rules.  Sharing the
resolution also stops Ninja and FASTBuild from emitting a dead test_prep
edge for a non-buildable (e.g. INTERFACE) BUILD_DEPENDS target.

On the Makefile generators a file dependency that no single target
produces, and a test whose name contains ':', cannot be expressed as a
recursive-make rule and are reported with a warning and skipped.

Fixes: #27879
2026-06-24 17:24:54 +02:00
Marc Chevrier faeeac60e8 Add SOURCE_GROUP properties for file set and source file
Fixes: #27627
2026-06-24 16:01:23 +02:00
Brad King 23c5b40924 Merge topic 'fastbuild-test-deps'
2d417b9371 FASTBuild: Generate test_prep/ targets for test build dependencies

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12183
2026-06-24 09:54:39 -04:00
Brad King 4073b18ab7 Merge topic 'source_group-FILE_SET-support'
6043014d1d source_group(): Add file set support
44fd6ec551 source_group: use cmArgumentParser

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12195
2026-06-24 09:49:49 -04:00
Mickaël Germain 092edb6860 GenEx: add $<LIST:FILTER> PREDICATE filter and REGEX keyword
Let $<LIST:FILTER> select elements by an arbitrary condition: PREDICATE keeps or
drops each element according to a <body> evaluated with $<_0> bound,
complementing the existing regular-expression form.  Also accept an explicit
REGEX keyword before the pattern so the regex and predicate forms read
symmetrically; the bare pattern keeps working.

Issue: #27892
2026-06-23 21:31:49 -07:00
Mickaël Germain d2ad140ef9 GenEx: add PREDICATE selector to $<LIST:TRANSFORM>
Add a PREDICATE selector to $<LIST:TRANSFORM> that chooses which elements to
transform by evaluating a <body> per element (with $<_0> bound) and acting on
those for which it yields "1".  This selects by computed condition instead of
the fixed AT/FOR/REGEX positions, so any generator expression -- including
target queries -- can decide where an action applies.  It works with both the
canned actions and APPLY.

Issue: #27892
2026-06-23 21:31:20 -07:00
James Miro 89de655356 FindDoxygen: Add USES_TERMINAL option to doxygen_add_docs()
Forward it to `add_custom_target()` and `add_custom_command()`
so that doxygen has access to the terminal when possible.

Fixes: #25359
2026-06-23 16:26:12 -04:00
Martin Duffy 2d417b9371 FASTBuild: Generate test_prep/ targets for test build dependencies
Issue: #27879
2026-06-23 12:20:49 -04:00
Brad King cd5a8dfa8e Merge topic 'genex-list-transform-apply'
0f6e8ded1d GenEx: add $<LIST:TRANSFORM,...,APPLY,body> action
c0a0b7fdd9 GenEx: add bound-operand binding mechanism and $<_0>
caa51f5689 GenEx: factor TRANSFORM selector parsing and selection

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12203
2026-06-23 10:17:50 -04:00
Marc Chevrier 6043014d1d source_group(): Add file set support 2026-06-23 14:55:26 +02:00
Brad King dfd1cf8d87 Merge topic 'import-std-refactor'
42d2d63235 c++modules: Copy props from BMI consumers more correctly
6d3e9d8220 c++modules: single import std target

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Reviewed-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !12193
2026-06-22 18:21:02 -04:00
Brad King 344c4ed360 Merge topic 'import-std-refactor' into release-4.4
42d2d63235 c++modules: Copy props from BMI consumers more correctly
6d3e9d8220 c++modules: single import std target

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Reviewed-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !12193
2026-06-22 18:21:00 -04:00
Brad King 5ffed8c938 Merge topic 'tutorial-typos'
abee191e93 Help/tutorial: reword Installation Commands intro
15bd933fc4 Help/tutorial: fix minor typos

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Vito Gamberini <vito.gamberini@kitware.com>
Acked-by: Betsy McPhail <betsy.mcphail@kitware.com>
Merge-request: !12199
2026-06-22 18:19:11 -04:00