9641 Commits
Author SHA1 Message Date
Brad King f358dacee8 Merge topic 'test-langs-launchers' into release-4.4
b63bcda722 CUDA, HIP: Revert false support for LINKER_LAUNCHER

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !12519
2026-09-21 11:28:30 -04:00
Brad King 72ae01edce Merge topic 'doc-interface-dash' into release-4.4
0871947862 Help: Remove spurious hyphen from cmake-buildsystem(7) references
ba67e946eb Help/INTERFACE_LINK_DEPENDS: Reference genexes

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12518
2026-09-18 08:01:41 -04:00
Tyler Yankee b63bcda722 CUDA, HIP: Revert false support for LINKER_LAUNCHER
The implementation in commits 77312cc6 (CUDA: Add support for
[CMAKE_]CUDA_LINKER_LAUNCHER, 2025-05-30, v4.1.0-rc1~80^2~1) and
cdf2a36f (HIP: Add support for [CMAKE_]HIP_LINKER_LAUNCHER, 2025-05-30,
v4.1.0-rc1~80^2) is broken, and the tests are wrongly configured
so as to never actually run. Revert the entire feature to avoid future
confusion, including documented support.

Enable the test for Fortran, which was added but untested by commit
d176a8c5ce (Fortran: Add support for [CMAKE_]Fortran_LINKER_LAUNCHER,
2025-05-26, v4.1.0-rc1~96^2), and whose implementation works.

Issue: #26967
2026-09-17 18:07:42 -04:00
Tyler Yankee 0871947862 Help: Remove spurious hyphen from cmake-buildsystem(7) references 2026-09-17 09:15:50 -04:00
Tyler Yankee ba67e946eb Help/INTERFACE_LINK_DEPENDS: Reference genexes 2026-09-17 09:15:26 -04:00
Tyler Yankee 27f28db197 Help: Clarify CTEST_NO_TESTS_ACTION support and interaction 2026-09-16 09:51:11 -04:00
Tyler Yankee a235560e53 Help: Clarify interaction between CTest parallelism toggles 2026-09-16 09:51:10 -04:00
Brad King 03779318b8 Merge branch 'release-4.3' into release-4.4 2026-09-04 11:30:58 -04:00
Brad King 4d4a0f16bb CMake 4.3.5 2026-09-04 10:54:04 -04:00
Brad King c16d5d7a04 Merge branch 'release-4.3' into release-4.4 2026-09-04 10:41:30 -04:00
Brad King 3d449c62fa Merge branch 'release-4.2' into release-4.3 2026-09-04 10:41:18 -04:00
Brad King ff7c4824e7 CMake 4.2.8 2026-09-04 09:57:16 -04:00
leha-bot af4e79b101 Help/manual/cpack: Document when -D<var>=<value> form was added
Closes: #28059
2026-08-31 12:32:30 -04:00
Brad King af7ecc8c29 CMake 4.4.3 2026-08-25 11:10:30 -04:00
Brad King 1eb64f8624 Merge topic 'autogen-vs-reduce-target-count' into release-4.4
d963b87ab4 Autogen: Reduce the number of targets under Visual Studio
2b5ad7e395 Autogen: Register per-config timestamp file with its full path

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !12409
2026-08-24 12:31:25 -04:00
Joerg Bornemann d963b87ab4 Autogen: Reduce the number of targets under Visual Studio
Commit 680fbb112a (Autogen: Enable depfile support for Visual Studio and
Xcode generators) disabled the PRE_BUILD optimization when a depfile is
used, because a PRE_BUILD event cannot carry depfile dependencies. Since
then, every target with AUTOMOC or AUTOUIC enabled gains an
'<ORIGIN>_autogen' and an '<ORIGIN>_autogen_timestamp_deps' target,
which the Visual Studio generators turn into two extra projects per
target in the generated solution.

Attach the autogen custom command to the origin target instead. The
custom command still carries the depfile, and the dependencies of the
origin target provide the ordering that
'<ORIGIN>_autogen_timestamp_deps' provides otherwise, because MSBuild
builds all referenced projects before any step of the referencing
project.

Use the conditions of the PRE_BUILD event, so that the
'<ORIGIN>_autogen' target keeps existing wherever it existed before
depfiles were enabled for the Visual Studio generators. In particular,
projects that name the target in add_dependencies() keep working.

Ninja and the Makefile generators keep the separate targets. Extra
targets have no cost for them, and '<ORIGIN>_autogen' has always existed
there.

The Xcode generator gained the same two targets per origin target in
4.4, but attaching the custom command there needs some more thoughts on
the per-config timestamp file first: Xcode rejects targets whose sources
vary by configuration, and with AUTOGEN_BETTER_GRAPH_MULTI_CONFIG the
timestamp file is per configuration.

Fixes: #28034
Fixes: #28033
2026-08-14 13:14:54 +02:00
Evan Wilde e4a37fbf15 Tests/RunCMake/Swift: Add CMP0195 behavior checks
Adding checks to ensure that CMP0195 has the desired effect. If the
Swift compiler is too old and does not include the module triple in the
emitted target info, we won't set `CMAKE_Swift_MODULE_TRIPLE` and end up
with the flat directory structure. In this case, these tests won't have
the expected layout.

Issue: #28021
2026-08-13 10:18:16 -04:00
Evan Wilde b7a78568c3 CMP0215: Update NEW behavior to require CMP0157/CMP0195 to be NEW
Update CMP0215 to avoid attempting to iterate through the flags
looking for `-emit-module-path` ins the user-specified flags. We don't
do this anywhere else in the code. The existing implementation didn't
handle correctly parsing the flag so `-I blah/my-emit-module-path/` and
`-Xcc -emit-module-path ...` would both trigger it, result in the
compiler not emitting any module. Furthermore, it didn't include the
user-specified module path as part of the build graph resulting in an
incorrect build graph that would never resolve.

The only two appropriate layouts for the module are either the flat
binary module file with the name `<module-name>.swiftmodule`, or the
nested form with
`<module-name>.swiftmodule/<module-triple>.swiftmodule`. The noted
Swift-Syntax situation passes the explicit `-emit-module-path` to get to
the latter form. This form is automatically emitted by CMake when
CMP0195 is `NEW`, removing the need for the flag. The Swift project
generally recommends the nested directory structure since it gathers all
of the generated interface outputs from the compiler (textual swift
interfaces, swiftdoc, sourceinfo, and the binary swiftmodule file) in a
single place, and since it uses the module triple in the filename,
cleanly allows fat mach-o binaries on Apple platforms.

Fixes: #28021
2026-08-13 10:14:16 -04:00
Mickaël Germain 3151f7824f cmList: Fix shared state across nested list(TRANSFORM) calls
The TRANSFORM action registry held one live action instance per action for
the whole process, and each instance carried per-call state: a raw Selector
pointer, REPLACE's helper, APPEND/PREPEND's operands.  That was harmless
while every action ran to completion uninterrupted, but commit c7af6e94d8
(list(TRANSFORM): Add PREDICATE selector, 2026-04-08, v4.4.0-rc1) added a
selector that runs a user function once per element, interleaved with the
transform.  User code reentering list(TRANSFORM) with the same action now
rebinds the shared instance mid-flight.  That produces silently wrong
results, and a use-after-free once any element is transformed after the
reentering one.  It needs no unusual code to hit: a predicate calling
find_package(Python) reaches list(TRANSFORM ... REPLACE) inside FindPython's
own module.

Make action objects immutable and per-call.  Operands and the selector become
constructor arguments, Initialize is deleted, and the registry becomes a
constexpr table of metadata with a MakeTransformAction factory.  The
InSelection guard, duplicated in all eight actions, moves into the base class.

This also closes a second hole in the same machinery.  TransformActionApply
overrode only the vector form of Initialize, so transform(APPLY, "f",
selector) dispatched to the empty two-argument virtual in the base, left
Selector null, and dereferenced it.  With no virtual Initialize left to
inherit, an APPLY action without a cmMakefile is no longer constructible, so
the throwing stub that guarded the vector form is no longer needed.

Close a third, from commit 651f82642c (Add APPLY action for list(TRANSFORM),
2026-04-08, v4.4.0-rc1): the cmMakefile overload performs APPLY
unconditionally but validated only the arity of the action passed to it.
APPEND, PREPEND and APPLY all take one argument, so transform(APPEND, "x",
makefile) passed validation and then silently ran APPLY, calling "x" as a
function instead of appending it.  Reject any action but APPLY up front.
That path is unreachable from CMake code, since HandleTransformCommand only
selects the overload for APPLY, and Tests/CMakeLib has no cmMakefile to drive
it with, so it carries no test.

Document the predicate's evaluation order while here.  It runs once per
element, immediately before that element would be transformed.  The manual
did not state the timing, which matters precisely because a predicate that
reenters list(TRANSFORM) observes the outer call mid-flight.

Fixes: #28031
2026-08-11 11:36:08 -04:00
Brad King c162d6852d CMake 4.4.2 2026-07-31 09:01:06 -04:00
Brad King d1cffecacd CMake 4.4.1 2026-07-28 10:26:50 -04:00
Brad King 32d437aa49 Merge topic 'FindPython-add-pydebug-ABI-support-on-Windows' into release-4.4
84cb7e2629 FindPython: Add support for pydebug ABI flag on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12325
2026-07-28 09:35:23 -04:00
Marc Chevrier 84cb7e2629 FindPython: Add support for pydebug ABI flag on Windows
Fixes: #27969
2026-07-26 17:10:25 +02:00
Brad King 96b3a4e6c7 Style: Replace some UTF-8 characters with ASCII equivalents 2026-07-24 09:55:14 -04:00
Brad King 8dd7eb41bb Merge topic 'vs-clangcl-modules' into release-4.4
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:42 -04:00
Brad King 5175aa4872 Merge topic 'doc-ide-compiler-selection' into release-4.4
90e2a33dba Help/CMAKE_LANG_COMPILER: Document Visual Studio, Xcode, GHS generators quirks

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12296
2026-07-22 09:52:29 -04:00
leha-bot 90e2a33dba Help/CMAKE_LANG_COMPILER: Document Visual Studio, Xcode, GHS generators quirks
They don't support setting compiler via this variable, they use the
toolsets, so you could switch the compiler by choosing another toolset.

Closes: #21644
2026-07-21 17:39:07 -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
FeRD (Frank Dana) 8df169ebe1 Help: target_sources: Align descriptions with signatures
Recent changes to the `target_sources()` docs changed the `<items>`
placeholders to `<source>` or `<files>` (for `FILE_SET` commands),
but the documentation still used "items" frequently, and even
`<items>` once.

Change all mentions of "items" to use terms that match the
corresponding placeholders, for consistency.
2026-07-21 15:42:13 -04:00
FeRD (Frank Dana) 72ff5cb481 Help: target_sources: Align descriptions with signatures
Recent changes to the `target_sources()` docs changed the `<items>`
placeholders to `<source>` or `<files>` (for `FILE_SET` commands),
but the documentation still used "items" frequently, and even
`<items>` once.

Change all mentions of "items" to use terms that match the
corresponding placeholders, for consistency.
2026-07-21 15:40:49 -04:00
Tyler Yankee 273c414ece Help: Dedent multiple install --components note 2026-07-03 09:09:59 -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
Aiden Woodruff abee191e93 Help/tutorial: reword Installation Commands intro
Signed-off-by: Aiden Woodruff <aiden.woodruff@kitware.com>
2026-06-22 12:08:38 -04:00
Aiden Woodruff 15bd933fc4 Help/tutorial: fix minor typos
Signed-off-by: Aiden Woodruff <aiden.woodruff@kitware.com>
2026-06-22 12:08:38 -04:00
Vito Gamberini 6d3e9d8220 c++modules: single import std target 2026-06-18 15:20:54 -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
Brad King 672ddaa5b7 Merge branch 'release-4.3' into release-4.4 2026-06-17 10:22:00 -04:00
Brad King c2fd48014f CMake 4.3.4 2026-06-17 09:53:06 -04:00
Brad King 0e9598ba0e Merge branch 'release-4.3' into release-4.4 2026-06-17 09:40:23 -04:00
Brad King 8cf3d277b7 Merge branch 'release-4.2' into release-4.3 2026-06-17 09:40:16 -04:00
Brad King 24581cbe98 CMake 4.2.7 2026-06-17 09:01:47 -04:00
Brad King d20e909f3d Merge topic 'if-diagnostic' into release-4.4
597c573d7d if: Add `DIAGNOSTIC <category>` condition

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12181
2026-06-17 08:54:47 -04:00
Matthew Woehlke 597c573d7d if: Add DIAGNOSTIC <category> condition
Add an existence check to the `if` command for diagnostic categories,
mirroring the check for policies. Aside from being desirable for
consistency's sake, this will make it easier for users to write logic to
manipulate diagnostics from newer versions of CMake that don't exist
today.
2026-06-16 15:14:13 -04:00
Tyler Yankee bf71991174 instrumentation: Add JSON schema for snippet files
Issue: #27504
2026-06-15 10:35:53 -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
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 cd7328bd29 Merge topic 'cuda-add-std23-nvcc-support' into release-4.4
d01c9a429b CUDA: Add support for cuda_std_23 for nvcc 13.3+

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12162
2026-06-11 10:25:32 -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 576471ba47 Help/instrumentation: Add release notes for instrumentation data version 1.1 2026-06-10 15:19:41 -04:00