Commit Graph
76273 Commits
Author SHA1 Message Date
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
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
Brad King d657ecc4ea Merge branch 'release-4.3' into release-4.4 2026-08-07 10:54:12 -04:00
Brad King 7ecf782279 Merge topic 'file-GLOB-CONFIGURE_DEPENDS-quoting' into release-4.4
249e364dd7 Merge branch 'backport-3.31-file-GLOB-CONFIGURE_DEPENDS-quoting'
2c89c2a74c file(GLOB): Teach CONFIGURE_DEPENDS to handle quotes in matched file names
9a9ce6637b file(GLOB): Teach CONFIGURE_DEPENDS to handle quotes in matched file names

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12378
2026-08-07 10:53:31 -04:00
Brad King 13b58e541e Merge branch 'release-4.2' into release-4.3 2026-08-07 10:52:41 -04:00
Brad King d17ff27167 Merge topic 'file-GLOB-CONFIGURE_DEPENDS-quoting' into release-4.3
249e364dd7 Merge branch 'backport-3.31-file-GLOB-CONFIGURE_DEPENDS-quoting'
2c89c2a74c file(GLOB): Teach CONFIGURE_DEPENDS to handle quotes in matched file names
9a9ce6637b file(GLOB): Teach CONFIGURE_DEPENDS to handle quotes in matched file names

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12378
2026-08-07 10:52:29 -04:00
Brad King 0d9389f17c Merge branch 'release-4.1' into release-4.2 2026-08-07 10:52:24 -04:00
Brad King 0e22b819e2 Merge topic 'file-GLOB-CONFIGURE_DEPENDS-quoting' into release-4.2
249e364dd7 Merge branch 'backport-3.31-file-GLOB-CONFIGURE_DEPENDS-quoting'
2c89c2a74c file(GLOB): Teach CONFIGURE_DEPENDS to handle quotes in matched file names
9a9ce6637b file(GLOB): Teach CONFIGURE_DEPENDS to handle quotes in matched file names

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12378
2026-08-07 10:52:09 -04:00
Brad King 69c0c40459 Merge branch 'release-4.0' into release-4.1 2026-08-07 10:51:56 -04:00
Brad King 4ad6fe8c84 Merge topic 'file-GLOB-CONFIGURE_DEPENDS-quoting' into release-4.1
249e364dd7 Merge branch 'backport-3.31-file-GLOB-CONFIGURE_DEPENDS-quoting'
2c89c2a74c file(GLOB): Teach CONFIGURE_DEPENDS to handle quotes in matched file names
9a9ce6637b file(GLOB): Teach CONFIGURE_DEPENDS to handle quotes in matched file names

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12378
2026-08-07 10:51:40 -04:00
Brad King 1d4e75b58a Merge branch 'release-3.31' into release-4.0 2026-08-07 10:51:33 -04:00
Brad King 30b4c66234 Merge topic 'file-GLOB-CONFIGURE_DEPENDS-quoting' into release-4.0
249e364dd7 Merge branch 'backport-3.31-file-GLOB-CONFIGURE_DEPENDS-quoting'
2c89c2a74c file(GLOB): Teach CONFIGURE_DEPENDS to handle quotes in matched file names
9a9ce6637b file(GLOB): Teach CONFIGURE_DEPENDS to handle quotes in matched file names

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12378
2026-08-07 10:51:25 -04:00
Brad King 2ec6c94f82 Merge topic 'backport-3.31-file-GLOB-CONFIGURE_DEPENDS-quoting' into release-3.31
9a9ce6637b file(GLOB): Teach CONFIGURE_DEPENDS to handle quotes in matched file names

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12378
2026-08-07 10:48:42 -04:00
Brad King 249e364dd7 Merge branch 'backport-3.31-file-GLOB-CONFIGURE_DEPENDS-quoting' 2026-08-06 10:47:43 -04:00
Brad King 2c89c2a74c file(GLOB): Teach CONFIGURE_DEPENDS to handle quotes in matched file names
Otherwise a malicious file name can inject code into the verification
script.

Fixes: #28023
2026-08-06 10:38:49 -04:00
Brad King 9a9ce6637b file(GLOB): Teach CONFIGURE_DEPENDS to handle quotes in matched file names
Otherwise a malicious file name can inject code into the verification
script.

Fixes: #28023
2026-08-06 10:37:56 -04:00
Brad King 86d6c46938 Merge topic 'orangec-rc' into release-4.4
835dfdfbac OrangeC: Fix compiling Windows Resources with only CXX enabled

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12373
2026-08-06 09:24:52 -04:00
Brad King 835dfdfbac OrangeC: Fix compiling Windows Resources with only CXX enabled
Fix commit 402d72b6c0 (OrangeC: Add support for compiling Windows
Resources, 2026-03-24, v4.4.0-rc1~444^2~1) to work for both C and CXX.

Inspired-by: Arha Gatram <agatram@nvidia.com>
2026-08-05 14:21:10 -04:00
Brad King 362f4ec53a Merge topic 'FindJNI-OpenSUSE' into release-4.4
25efb8bf45 FindJNI: Add paths for OpenSUSE libalternatives-based packages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12368
2026-08-05 13:49:25 -04:00
Brad King 6ded06cb1d Merge topic 'FindPython-fix-ARCHITECTURE_ID-check' into release-4.4
7fc60e733d FindPython: Fix CMAKE_LANG_COMPILER_ARCHITECTURE_ID check

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12362
2026-08-04 09:00:27 -04:00