76291 Commits
Author SHA1 Message Date
Brad King 76395764c7 Merge topic 'export-ignore-pvs-config' into release-4.4
7abae1fc24 gitattributes: Do not export pvs-studio config in source archives

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12532
2026-09-22 09:39:43 -04:00
Brad King 7abae1fc24 gitattributes: Do not export pvs-studio config in source archives
This was missed in commit 3748deda58 (pvs-studio: Add .pvsconfig
exclusion file, 2026-04-27, v4.4.0-rc1~244^2~2).
2026-09-21 17:57:30 -04:00
Brad King 03c6ed2d65 Merge branch 'release-4.3' into release-4.4 2026-09-21 13:43:20 -04:00
Brad King f511735756 Merge topic 'cmp0210-trycompile-policy-order' into release-4.4
af7a370bf1 Merge branch 'backport-4.3-cmp0210-trycompile-policy-order'
92320466dd try_compile: Restore platform-default link flags in pre-CMP0210 projects

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12525
2026-09-21 13:41:57 -04:00
Brad King 2d3d4fd85a Merge topic 'backport-4.3-cmp0210-trycompile-policy-order' into release-4.3
92320466dd try_compile: Restore platform-default link flags in pre-CMP0210 projects

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12525
2026-09-21 13:40:54 -04:00
Brad King af7a370bf1 Merge branch 'backport-4.3-cmp0210-trycompile-policy-order' 2026-09-21 11:47:20 -04:00
Mickaël Germain 92320466dd try_compile: Restore platform-default link flags in pre-CMP0210 projects
The CMP0210 compatibility shims in the Darwin, AIX, HP-UX and ARMClang
modules read the policy with cmake_policy(GET CMP0210 ...) during
enable_language(), which runs inside project().  cmCoreTryCompile emitted
cmake_policy(SET CMP0210 ...) after project() in the generated test
project, so those shims always observed NEW regardless of the calling
project's setting.

On affected platforms this dropped the platform default link flags from
every try_compile, and left a toolchain-file value of
CMAKE_<LANG>_LINK_FLAGS unclobbered so that it reached the OLD code path.
For projects that are also not using CMP0181 NEW, that path uses the
variable as is and does not expand the LINKER: prefix.

Move the emission into the existing pre-project() policy block alongside
CMP0126, CMP0128 and CMP0197, which exist for exactly this reason.

Fixes: #28102
2026-09-21 11:35:38 -04:00
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
Brad King 5974bf5289 Merge topic 'ctest-dashboard-preset-env' into release-4.4
27f28db197 Help: Clarify CTEST_NO_TESTS_ACTION support and interaction
a235560e53 Help: Clarify interaction between CTest parallelism toggles
f745dd11ab ctest: Respect test envvars set by CTEST_PRESET
277236a99a cmCTestTestCommand: Factor out preset resolution
81b46d87ba cmCTest: Factor out environment variable handling
4e81913645 Tests: Fix unset(ENV{...}) typos

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12495
2026-09-18 07:59:54 -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
Tyler Yankee f745dd11ab ctest: Respect test envvars set by CTEST_PRESET
Note the special attention given to support CTest environment variables
from inside a test preset's `environment` field.

Fixes: #28079
2026-09-16 09:34:43 -04:00
Tyler Yankee 277236a99a cmCTestTestCommand: Factor out preset resolution
Prepare for a future commit which will reuse this functionality. Add a
structure to hold the resolved fields so that we can more easily
distinguish between errors during preset resolution and cases when
presets simply aren't used.
2026-09-16 09:05:32 -04:00
Tyler Yankee 81b46d87ba cmCTest: Factor out environment variable handling 2026-09-16 09:05:19 -04:00
Tyler Yankee 4e81913645 Tests: Fix unset(ENV{...}) typos 2026-09-16 08:51:36 -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 v4.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 v4.2.8 2026-09-04 09:57:16 -04:00
Brad King 8619aeebe5 Merge topic 'target-empty-imported-configs' into release-4.4
23f1cb47c7 cmTarget: Don't crash on empty IMPORTED_CONFIGURATIONS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12470
2026-09-03 09:16:02 -04:00
Matthew Woehlke 23f1cb47c7 cmTarget: Don't crash on empty IMPORTED_CONFIGURATIONS
The logic to select an imported configuration handled the case when
`IMPORTED_CONFIGURATIONS` was missing, but assumed that if it was
present, it was non-empty, which could cause CMake to crash if that
happens. (To be fair, I believe this would never happen for imports
generated by CMake.) Adjust the logic slightly to follow the same code
path when `IMPORTED_CONFIGURATIONS` is empty as is taken if it's
missing.

Fixes: #28065
2026-09-02 13:36:50 -04:00
Brad King 7973ccc395 Merge topic 'doc-cpack-D' into release-4.4
af4e79b101 Help/manual/cpack: Document when `-D<var>=<value>` form was added

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12451
2026-09-01 09:13:30 -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 6c32d5ed52 Merge topic 'revert-googletest-discovery' into release-4.4
5e5467bfc3 GoogleTest: Revert "Base on builtin command discover_tests"
c0ef680605 GoogleTest: Avoid else after return

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12448
2026-08-31 11:01:07 -04:00
Daniel Pfeifer 5e5467bfc3 GoogleTest: Revert "Base on builtin command discover_tests"
Revert commit a324c2bb58 (GoogleTest: Base on builtin command
discover_tests, 2026-03-01, v4.4.0-rc1~30^2).  The `discover_tests`
implementation does not persist already-discovered tests across ctest
runs, making it much slower on projects whose test binaries take a while
just to start up and list tests.  Revert to the prior implementation
pending caching support in `discover_tests`.

Fixes: #28053
Issue: #28060
2026-08-28 11:08:59 -04:00
Daniel Pfeifer c0ef680605 GoogleTest: Avoid else after return
Commit c3c95f3010 (GoogleTest: Avoid generation error on duplicate
target test discovery, 2026-07-14, v4.4.1~24^2) has added a level of
indentation which made rebasing other changes harder than necessary.
Avoiding an else branch after a return command allows keeping the
original indentation.
2026-08-28 10:21:52 -04:00
Brad King 1d755eb844 Merge topic 'ibm-flang-fix' into release-4.4
fbe5bcb7d3 IBMFlang: Rename compiler modules from IBMLLVMFlang

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12443
2026-08-27 10:50:25 -04:00
Kelvin Li fbe5bcb7d3 IBMFlang: Rename compiler modules from IBMLLVMFlang
These were missed in commit 4969297469 (IBMFlang: Rename compiler id
from IBMLLVMFlang, 2026-06-09, v4.4.0-rc1~7^2).
2026-08-26 16:36:13 -04:00
Brad King af7ecc8c29 CMake 4.4.3 v4.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
Brad King 1e1b1bef21 Merge topic 'swift-cmp0215-update' into release-4.4
e4a37fbf15 Tests/RunCMake/Swift: Add CMP0195 behavior checks
b7a78568c3 CMP0215: Update NEW behavior to require CMP0157/CMP0195 to be NEW

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12407
2026-08-14 06:30:34 -04:00
Joerg Bornemann 2b5ad7e395 Autogen: Register per-config timestamp file with its full path
With AUTOGEN_BETTER_GRAPH_MULTI_CONFIG enabled, the per-config
'<ORIGIN>_autogen/timestamp_<CONFIG>' file was added to the origin target
as a bare file name, which resolves against the source directory.  The
origin target therefore carried a source file that no rule creates, and
the build system could not trace the timestamp file back to the custom
command that creates it.  Under the Visual Studio generators the bogus
path shows up as a <None> item in the project file.

Use the full path instead.
2026-08-14 10:08:37 +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
Brad King f27e315222 Merge topic 'clang-cl-absolute-source-path' into release-4.4
68491cedcf clang-cl: Fix C++ module scanning when cross-compiling from Linux

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12389
2026-08-12 11:47:00 -04:00
Brad King bd456b9f3a Merge topic 'libuv-macos-10.5' into release-4.4
6910a0e8cd libuv: Restore support for macOS 10.5 and 10.6

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !12397
2026-08-12 11:45:08 -04:00
Brad King 478912138b Merge topic 'list-transform-shared-state' into release-4.4
3151f7824f cmList: Fix shared state across nested list(TRANSFORM) calls

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12390
2026-08-12 11:42:40 -04:00
huangqinjin 68491cedcf clang-cl: Fix C++ module scanning when cross-compiling from Linux
Follow up commit ed48feeae8 (clang-cl: Add support for C++ modules,
2026-03-27, v4.4.0-rc1~428^2).  Prevent clang-cl from interpreting
absolute source paths as flags.

Fixes: #28036
2026-08-11 13:03:30 -04:00
Sergey Fedorov 6910a0e8cd libuv: Restore support for macOS 10.5 and 10.6
Upstream libuv no longer supports these versions.

Follow up commit abac34eda2 (libuv: Restore support for macOS 10.x,
2026-03-05, v4.4.0-rc1~571^2~3).  This leaves out macOS 10.4, since
a) it needs a lot more invasive changes, b) neither MacPorts nor my
PPCPorts support 10.4 anymore.

Signed-off-by: Sergey Fedorov <vital.had@gmail.com>
2026-08-11 11:53:09 -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 97d7e823c9 Merge topic 'FindPython-fix-CROSSCOMPILING-CMP0190-OLD' into release-4.4
7b74c14b02 FindPython: fix CROSSCOMPILING with CMP0190=OLD

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12394
2026-08-11 11:18:59 -04:00
Brad King a74af9fd2f Merge topic 'fix-check-modules-again' into release-4.4
3209535fb3 Check*: Restore toleration of false-like requirements

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12387
2026-08-10 09:52:23 -04:00
Marc Chevrier 7b74c14b02 FindPython: fix CROSSCOMPILING with CMP0190=OLD 2026-08-10 14:28:15 +02:00
Matthew Woehlke 3209535fb3 Check*: Restore toleration of false-like requirements
Commit 7644d557df (Check*: Refactor variable handling, 2026-07-20,
v4.4.1~12^2~1) introduced a subtle regression in the handling of
`CMAKE_REQUIRED_LINK_OPTIONS` and `CMAKE_REQUIRED_LIBRARIES` which
resulted in an error if these were set to a 'false-like' value. This
could happen, for example, if the user passes `<name>_LIBS`, which
happens to have the value `<name>-NOTFOUND`. Previously, such values
would be ignored.

Fix it by separately checking for user- or module-provided link options
or link libraries. (We were already doing this for the other variables
used to propagate requirements into checks.)

Fixes: #28026
2026-08-07 14:14:52 -04:00