Commit Graph
39813 Commits
Author SHA1 Message Date
Brad King e81dc7020a Merge topic 'fix-cmp0194-policy-warning'
895f83d019 Merge branch 'backport-4.2-fix-cmp194-policy-warning'
e733da51ba CMP0194: Fix policy number in warning text
b88cade899 Merge branch 'backport-4.1-fix-cmp194-policy-warning'
26681a69d2 CMP0194: Fix policy number in warning text
2eb1361cc2 CMP0194: Fix policy number in warning text

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12252
2026-07-08 09:19:52 -04:00
Kitware Robot 609e04b25e CMake Nightly Date Stamp 2026-07-08 00:05:35 -04:00
Jocó Mihalicza e733da51ba CMP0194: Fix policy number in warning text 2026-07-07 15:58:19 -04:00
Brad King 04b2dfd8be Merge topic 'changing-toolchain-recover'
ca3d1007f0 Tests: Simplify RunCMake.CompilerChange
ca0bf9848d cmake: Retain cache from presets and command line before re-configure
ee6bfdc1f3 CMAKE_TOOLCHAIN_FILE: Improve recovery from changed compiler or toolchain file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12241
2026-07-07 11:12:13 -04:00
Brad King 3765645365 Merge topic 'ctest-stdio-colors'
fd395b25b5 ctest: Improve colorization in output

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12243
2026-07-07 11:00:30 -04:00
Kitware Robot 57d51681e2 CMake Nightly Date Stamp 2026-07-07 00:08:57 -04:00
Kitware Robot b20e5a8661 CMake Nightly Date Stamp 2026-07-06 00:05:09 -04:00
Kitware Robot 7dc7836c59 CMake Nightly Date Stamp 2026-07-05 00:06:15 -04:00
Kitware Robot 40277a12b8 CMake Nightly Date Stamp 2026-07-04 00:05:02 -04:00
Tyler Yankee fd395b25b5 ctest: Improve colorization in output
Refactor CTest's logging to replace custom color code handling with the
infrastructure introduced in commit 329d755dbd (StdIo: Add a Terminal
abstraction to print color text, 2025-05-06).

Avoid ANSI escape sequences in files passed to `--output-log-file`.

Fixes: #27915
2026-07-03 10:02:43 -04:00
Aiden Woodruff ca0bf9848d cmake: Retain cache from presets and command line before re-configure
Triggering a cache reset and re-configure by changing the compiler or
CMAKE_TOOLCHAIN_FILE should be a shortcut for cmake --fresh. Losing the
cache variables from the command line and especially presets can have an
unexpected effect. This commit restores the preset cache variables and
reprocesses cache-affecting variables from the immediate command line.

Fixes: #27899
2026-07-03 10:00:16 -04:00
Aiden Woodruff ee6bfdc1f3 CMAKE_TOOLCHAIN_FILE: Improve recovery from changed compiler or toolchain file
Replace __CMAKE_DELETE_CACHE_CHANGE_VARS_ with a set of changed
variables in cmState to avoid interference from scripts and simplify
handling of changed variables.

Errors during configure step will block re-configure when the toolchain
file has changed. Downstream errors can be caused by failing in
EnableLanguage without an error, behavior introduced in 7a989ed58a
(CMAKE_TOOLCHAIN_FILE: Detect path changes and reset cache, 2026-06-24).
Errors directly related to a changed toolchain file should be fixed by
using the new one.

Trigger a fatal error when the toolchain file change is detected to
avoid wasteful configure that will be reset anyway, then re-configure
only for that specific case. Avoid re-configuring multiple times.

Fixes: #27867
2026-07-03 09:25:33 -04:00
Kitware Robot e442f2b766 CMake Nightly Date Stamp 2026-07-03 00:05:02 -04:00
Brad King db58e5fbd6 Merge topic 'compile-trace-rsp'
89b1e21a5e instrumentation: Gather compile trace files in compile rsp

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12238
2026-07-02 08:03:06 -04:00
Brad King f2001c745f Merge topic 'target-types'
f1d7bedc4b TargetTypes: Improve use of imported target scope type
a5a9ec9113 TargetTypes: Extract target-related types to dedicated header

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12236
2026-07-02 08:00:51 -04:00
Brad King e037d3bd2b Merge topic 'xc_cmd_comment'
de28f37ce4 Xcode: Propagate add_custom_command COMMENT to generated projects

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12237
2026-07-02 07:58:02 -04:00
Kitware Robot be0c7fd314 CMake Nightly Date Stamp 2026-07-02 00:05:36 -04:00
Matthew Woehlke f1d7bedc4b TargetTypes: Improve use of imported target scope type
Move `ImportedTargetScope` to `cmTargetTypes.h`, enabling it to be used
without dragging in all of `cmMakefile.h`. Use this in more places
instead of `bool global`.
2026-07-01 14:44:11 -04:00
Matthew Woehlke a5a9ec9113 TargetTypes: Extract target-related types to dedicated header
Move some target related enumeration types from `cmStateTypes.h` to a
new header, as these really aren't "state" types. Also, make
`TargetType` a strongly-typed enumeration.
2026-07-01 14:44:11 -04:00
Martin Duffy 89b1e21a5e instrumentation: Gather compile trace files in compile rsp
Updates instrumentation logic for gathering compile trace files to parse
compiler options in a response file for the presence of `-ftime-trace=...`.
2026-07-01 12:52:15 -04:00
Anton Tokar de28f37ce4 Xcode: Propagate add_custom_command COMMENT to generated projects
Propagate the COMMENT section of add_custom_command(OUTPUT) as Xcode
Build Phase, if present. Otherwise fallback to the current behavior

Fixes: #27910
2026-07-01 12:10:03 -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 8b8ffdb35d Merge topic 'cps-export-file-sets'
a5b38fb898 CPS: Implement exporting of file sets
8d229ec702 cmGeneratorFileSet: Support different mappings
c79c5aea4a CPS: Refactor getting file set destination for install

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12226
2026-07-01 09:51:30 -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
Brad King 45656a1839 Merge topic 'openssl3-error'
54686cae64 Utilities: Require OpenSSL >= 3.0.0 at configure time

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12223
2026-07-01 09:29:56 -04:00
Brad King 68d210d6c1 Merge topic 'FILE_SET-properties-evaluate-genex'
7f71e58444 FILE_SET: fix genex evaluation of properties

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !12233
2026-07-01 09:17:33 -04:00
Kitware Robot 75a3ddfdc2 CMake Nightly Date Stamp 2026-07-01 00:06:31 -04:00
Matthew Woehlke a5b38fb898 CPS: Implement exporting of file sets
Add (partial) file set export to CPS. For now, only headers ("includes")
are supported, as that is the only overlap with the specification.
(Source file sets are not supported by CPS at this time, and the hope is
that C++ modules will never be supported, as that information should
already be available via the `cpp_module_metadata` information.) CPS
also supports "embeds", but CMake doesn't (yet).

This also introduces our first official use of CPS extensions, used to
record the CMake file set name.
2026-06-30 15:08:02 -04:00
Matthew Woehlke 8d229ec702 cmGeneratorFileSet: Support different mappings
The full path of a file in a file set can be broken into groups like
`<base>/[<sub>/]<name>`, where `<base>` is the base directory and
`<name>` is the file name without any directory components. Existing
users evaluate file set files as a mapping from `<rel>` to the full
path. However, CPS export needs files grouped by base directory, and
cares about the composition of `<rel>` and `<name>`. To facilitate
obtaining this information in a more useful form, refactor how we
extract file set files to allow the user to pass a lambda 'handler' for
each file, which has the base directory, full path, and path relative to
the base directory available. (We already obtained `<rel>` from the
latter, so while this technically means the existing use needs to do
additional work, in practice it just means the call to get `<rel>` moves
to the lambda.)

Because there are many existing users that would need to duplicate the
lambda, the old methods are retained as-is, although this does result in
minor code duplication between `GetFiles` (which calls the overload of
`EvaluateFileEntry` which fills the old file map) and `EvaluateFiles`
(which is essentially `GetFiles`, but accepts a user-provided 'handler'
lambda rather than directly producing a file map).
2026-06-30 15:08:02 -04:00
Matthew Woehlke c79c5aea4a CPS: Refactor getting file set destination for install
Modify `cmExportInstallPackageInfoGenerator::GetFileSetDirectory` to not
have side effects, moving that logic to the call site instead. This will
allow the method to be used in other contexts.

Also, tweak a bunch of methods called by this method to not
unnecessarily require mutable objects.
2026-06-30 15:08:02 -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
Mickaël Germain c418a3dc85 GenEx: factor out reusable SORT comparator and option-parsing helpers
Prepare for a genex-driven SORT comparator without changing behavior: let
cmList::sort() accept a caller-supplied comparison function, and give the
$<LIST:SORT> COMPARE:/CASE:/ORDER: option parsing a single definition shared
with the canned handler.  The new feature can then reuse both rather than
duplicating the sort plumbing and the option syntax.

Issue: #27892
2026-06-30 08:19:41 -07:00
Mickaël Germain e335872625 GenEx: generalize bound operands to a frame and add $<_1>
Allow a binding operation to bind more than one operand at once, exposed as
$<_0>, $<_1>, ....  A single value remains the common case, but the upcoming
SORT COMPARATOR must bind the two elements being compared, so the binding
becomes an indexed frame and $<_1> is added.  Referencing an index the active
binding does not provide is reported as an error.

Issue: #27892
2026-06-30 08:19:41 -07:00
Brad King d5d4eb2991 Merge topic 'sarif-diagnostics'
1c3d648fc5 cmSarif: Classify results by diagnostic category
4cc948ad08 cmSarif: Improve conformance with SARIF in CMake result reporting

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !12191
2026-06-30 11:10:18 -04:00
Brad King be33dbe421 Merge topic 'changing-toolchain'
7a989ed58a CMAKE_TOOLCHAIN_FILE: Detect path changes and reset cache

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12211
2026-06-30 11:08:58 -04:00
Brad King 00538bfea0 Merge topic 'correct_rpaths_no_matter_sysroot'
b6d3e9ba18 RPATH: Support CMAKE_SYSROOT value of `/`

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12221
2026-06-30 11:06:21 -04: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
Marc Chevrier 7f71e58444 FILE_SET: fix genex evaluation of properties 2026-06-30 11:59:07 +02:00
Kitware Robot b767f0fabb CMake Nightly Date Stamp 2026-06-30 00:06:18 -04:00
Brad King a61c57997a CMake 4.4.0-rc3 2026-06-29 14:33:59 -04:00
Daniel Tierney 1c3d648fc5 cmSarif: Classify results by diagnostic category
Add additional rules to CMake's SARIF reporting for diagnostic categories.

Fixes: #27883
2026-06-29 14:12:31 -04:00
Daniel Tierney 4cc948ad08 cmSarif: Improve conformance with SARIF in CMake result reporting
Reorganize CMake's SARIF implementation to clearly distinguish between the SARIF standard and CMake's result reporting structure, fixing several validation failures.
- Removed unused message strings in reported rules.
- Report artifact locations relative to the CMake home directory.
- Use the recommended schema URL.
- Stop reporting some invalid locations read from the top of the stack.

cmMessenger no longer manages a SARIF log but stores a list of displayed messages. The SARIF log is constructed from displayed messages upon writing the file.
2026-06-29 14:12:31 -04:00
Aiden Woodruff 7a989ed58a CMAKE_TOOLCHAIN_FILE: Detect path changes and reset cache
If the path to the toolchain file changes then anything in the cache
that's derived from the toolchain may need to be recomputed.  Detect
this case and start a fresh build.

Issue: #27867
Signed-off-by: Aiden Woodruff <aiden.woodruff@kitware.com>
2026-06-29 12:09:16 -04: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 68a5833ccb Merge topic 'target-SOURCE-file-set-read-only'
e1c4e91133 Some target properties for SOURCE file sets are read-only.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12219
2026-06-29 11:54:30 -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