Commit Graph
3137 Commits
Author SHA1 Message Date
Tyler Yankee c707fde0f2 Help: Move general FILE_SET info to cmake-buildsystem(7)
File sets have evolved to be more ubiquitous throughout a CMake build,
outside the scope of simply the target_sources command. Move general
information to the `cmake-buildsystem(7)` manual and keep only
reference information specific to the syntax of target_sources in its
command page. Sprinkle some more cross-references to the new location.

Fixes: #27900

Suggested-By: Marc Chevrier <marc.chevrier@gmail.com>
2026-07-27 09:01:37 -04:00
Brad King 5868009096 Merge topic 'ctest-windows-jobserver-client'
79331d5865 CTest: Add Windows job server client

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12297
2026-07-22 11:23:38 -04:00
Brad King 697df9a12a Merge topic 'vs-clangcl-modules'
027b962a81 VS: Avoid unsupported ScanSourceForModuleDependencies under ClangCl

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Vito Gamberini <vito.gamberini@kitware.com>
Reviewed-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !12301
2026-07-22 09:55:45 -04:00
Tyler Yankee 027b962a81 VS: Avoid unsupported ScanSourceForModuleDependencies under ClangCl
As of commit ed48feeae8 (clang-cl: Add support for C++ modules,
2026-03-27, v4.4.0-rc1~428^2) CMake tries to support modules for
clang-cl, which can mostly be accomplished, except for the ClangCl VS
toolset, where the /scanDependencies flag is not yet supported.

Amend commit 3022f0363f (VS: set ScanSourceForModuleDependencies at
vcxproj level, 2024-04-27, v3.28.5~3^2) to only emit this setting when
scanning is supported by the toolchain.

Fixes: #27957
Issue: #27977
2026-07-21 17:02:29 -04:00
Daksh Mamodiya 79331d5865 CTest: Add Windows job server client
Use a named semaphore polled from the libuv event loop to share GNU Make
job slots on Windows. Cover token ordering, bounded draining, and
teardown, and document the new support.

Fixes: #27968
2026-07-20 16:40:11 +02: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
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
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
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
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 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 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 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
Tyler Yankee 273c414ece Help: Dedent multiple install --components note 2026-07-03 09:09:59 -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
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 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
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
Marc Chevrier faeeac60e8 Add SOURCE_GROUP properties for file set and source file
Fixes: #27627
2026-06-24 16:01:23 +02: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
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
Mickaël Germain 0f6e8ded1d GenEx: add $<LIST:TRANSFORM,...,APPLY,body> action
Add an APPLY action to $<LIST:TRANSFORM> that evaluates an arbitrary <body>
once per selected element, with $<_0> bound to the element, so a list can be
mapped through any generator expression at generate time.  Unlike the
configure-time list(TRANSFORM ... APPLY <function>) command, the genex form has
no side effects and returns the body's value directly, and a list-valued result
expands into multiple elements.

The body evaluates in its own binding scope, so nested APPLY actions can shadow
$<_0>, and context-sensitive state it observes (such as target dependencies)
still propagates to the enclosing expression.  APPLY accepts the same
AT/FOR/REGEX selectors as the canned actions.

Issue: #27892
2026-06-21 18:05:53 -07:00
Mickaël Germain c0a0b7fdd9 GenEx: add bound-operand binding mechanism and $<_0>
Introduce "binding operations": generator expressions that evaluate a <body>
once for each value they supply, with $<_0> expanding to that value.  This is
the foundation the $<LIST:TRANSFORM,...,APPLY> action and the predicate
selectors build on, letting a <body> refer to the element being processed.

Using $<_0> outside a binding operation is reported as an error rather than
silently expanding to nothing.

Issue: #27892
2026-06-20 12:32:30 -07:00
Brad King e6e3d728e9 Merge topic 'instrumentation-interrupt'
bda67b82e7 instrumentation: Write cmakeBuild snippet when build is interrupted
b801e7c78d instrumentation: Bump data version to 1.2

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: scivision <michael@scivision.dev>
Merge-request: !12154
2026-06-19 10:02:06 -04:00
Brad King 65269f4dfc Merge topic 'instrumentation-doc-version-fix'
330b36dddc instrumentation: Fix stale version references in documentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12188
2026-06-19 09:58:52 -04:00
Daksh Mamodiya 330b36dddc instrumentation: Fix stale version references in documentation
Four per-format version descriptions in cmake-instrumentation.7.rst
still claimed the data version is always 1.0, contradicting both the
authoritative Data Version paragraph (which says 1.1) and the JSON
schemas (which accept minor versions 0 and 1).

Replace the hardcoded version claims with a reference to the Data
Version section, so these lines remain correct as future minor
versions are added without requiring additional doc updates.

Fixes: #27889
2026-06-18 16:47:52 +02:00
Daksh Mamodiya bda67b82e7 instrumentation: Write cmakeBuild snippet when build is interrupted
The overall `cmakeBuild` snippet is written only after the native build
tool returns, so interrupting `cmake --build` with Ctrl+C terminated CMake
before it was recorded and lost the build's delineation.

When instrumentation is active, install a scoped, async-signal-safe handler
(POSIX SIGINT; Windows CTRL_C/CTRL_BREAK) that just flags the interrupt. The
existing write then runs during unwind, records the interrupting signal in a
new `interruptSignal` field, skips the post-build index hook, and re-raises so
the exit status still reflects the signal.

The handler lives in its own translation unit, keeping the platform-divergent
signal code out of the main instrumentation implementation.

Issue: #27859
2026-06-18 15:38:43 +02:00
Daksh Mamodiya b801e7c78d instrumentation: Bump data version to 1.2
Raise the maximum supported data version and the version CMake writes in
its snippet files from 1.1 to 1.2.
2026-06-17 18:24:25 +02:00
Brad King e87b932007 Merge topic 'instrumentation-snippet-schema'
bf71991174 instrumentation: Add JSON schema for snippet files
b736acdc3b Tests/instrumentation: Check errors for query schema validation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12170
2026-06-16 10:24:32 -04:00
Tyler Yankee bf71991174 instrumentation: Add JSON schema for snippet files
Issue: #27504
2026-06-15 10:35:53 -04:00
Brad King cf38d13311 Merge topic 'instrumentation-data-version-minor'
5405a8a7e3 Help: Add release note for the instrumentation version format change in 4.3.4

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Tyler Yankee <tyler.yankee@kitware.com>
Merge-request: !12168
2026-06-15 10:29:30 -04:00
Brad King 09b9fc300b Merge topic 'instrumentation-data-version-minor' into release-4.4
5405a8a7e3 Help: Add release note for the instrumentation version format change in 4.3.4

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Tyler Yankee <tyler.yankee@kitware.com>
Merge-request: !12168
2026-06-15 10:29:28 -04:00
Brad King ec22dd0de3 Merge topic 'ctest_configure_preset_binarydir'
3b6247a148 ctest: Honor preset binaryDir for initial configuration

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12167
2026-06-15 10:23:55 -04:00
Zack Galbreath 3b6247a148 ctest: Honor preset binaryDir for initial configuration
Prior to this commit, ctest would sometimes use the current working directory
as its binary directory rather than honoring `binaryDir` from a configure
preset. This would occur when using ctest in dashboard client mode to perform
an initial configuration with a preset.

  `ctest --source-dir=<dir> -T Configure -D CTEST_PRESET=<preset>`

An explicit `--build-dir` still takes precedence over the preset's `binaryDir`.
2026-06-13 08:50:33 -04:00
Brad King 5405a8a7e3 Help: Add release note for the instrumentation version format change in 4.3.4
This was missed in commit df36317176 (instrumentation: Revise Data
Version format, 2026-05-29, v4.4.0-rc1~43^2^2).

Closes: #27870
2026-06-12 09:22:55 -04:00
Brad King 6f985e9c00 Merge topic 'instrumentation-ftime-trace'
576471ba47 Help/instrumentation: Add release notes for instrumentation data version 1.1
0480222ff4 instrumentation: Add compileTrace option

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12048
2026-06-11 10:16:58 -04:00
Brad King 8d4479c2f9 Merge topic 'instrumentation-ftime-trace' into release-4.4
576471ba47 Help/instrumentation: Add release notes for instrumentation data version 1.1
0480222ff4 instrumentation: Add compileTrace option

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12048
2026-06-11 10:16:57 -04:00
Martin Duffy 0480222ff4 instrumentation: Add compileTrace option
Adds support for optionally saving and reporting trace files generated by
Clang's `-ftime-trace` option.
2026-06-10 15:19:41 -04:00
Brad King ec0ef3e7c4 Merge topic 'docs-release-4.4'
49ae4b6811 Help: Improve wording, formatting and consistency of 4.4 release notes
3284117eb4 Help: Fix list formatting for INDEPENDENT_FILES file set property
3153049509 Help: State behavior when test args are given in preset and command line
57469d1fad Help: Fix reversed ${fileDir} results for Base-Derived example

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12153
2026-06-08 11:18:22 -04:00
Craig Scott 3153049509 Help: State behavior when test args are given in preset and command line
The test presets description for the testPassthroughArguments
field already states the behavior, but it was missing from the
ctest -- <test-args> documentation.
2026-06-08 20:21:25 +10:00
Craig Scott 57469d1fad Help: Fix reversed ${fileDir} results for Base-Derived example 2026-06-08 20:21:23 +10:00
Brad King 1027dbd3a0 Merge topic 'instrumentation-stderr-stdout'
8e2aecbe42 instrumentation: Increase data version to 1.1
1a85245496 instrumentation: Optionally Record Command Output
6674be6d26 RunCMake: Allow error output suppression from run_cmake

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12031
2026-06-05 10:52:16 -04:00
Brad King 059170f19c Merge topic 'instrumentation-stderr-stdout' into release-4.4
8e2aecbe42 instrumentation: Increase data version to 1.1
1a85245496 instrumentation: Optionally Record Command Output
6674be6d26 RunCMake: Allow error output suppression from run_cmake

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12031
2026-06-05 10:51:52 -04:00
Brad King 42ce0813e5 Merge topic 'doc-message-log-level'
ef5e1e3a5b Help: Fix references to cmake_language(GET_MESSAGE_LOG_LEVEL)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12144
2026-06-05 09:25:02 -04:00
Brad King 1081423099 Merge topic 'doc-message-log-level' into release-4.4
ef5e1e3a5b Help: Fix references to cmake_language(GET_MESSAGE_LOG_LEVEL)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12144
2026-06-05 09:25:00 -04:00
Brad King eb4d21260b Begin post-4.4 development 2026-06-04 12:02:32 -04:00