Commit Graph
16111 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
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
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
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
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
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
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 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 25efb8bf45 FindJNI: Add paths for OpenSUSE libalternatives-based packages
Fixes: #28015
2026-08-04 08:31:53 -04:00
Marc Chevrier 7fc60e733d FindPython: Fix CMAKE_LANG_COMPILER_ARCHITECTURE_ID check
Fixes: #28012
2026-08-02 15:54:33 +02:00
Brad King 9656732cf5 Merge topic 'discover-tests-crash' into release-4.4
1b2f3287f7 GoogleTest: Restore toleration of odd test PROPERTIES count
6147180017 discover_tests: Require properties to be key-value pairs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12350
2026-07-31 08:52:04 -04:00
Alex Turbov da9a8a3fbe CPack/DEB: Fix regression when package architecture is explicitly specified
Since commit 302a645d73 (CPack/DEB: use `triggers` instead of legacy
postXXX scripts for `ldconfig`, 2026-03-05, v4.4.0-rc1~583^2) the
`triggers` feature refers to `DPKG_EXECUTABLE` if the latter is defined.
Unfortunately, it is defined only if one particular execution branch has
executed.  Move the `find_program(dpkg)` to the function scope to make
it available in all execution branches.
2026-07-30 12:28:11 -04:00
Daniel Pfeifer 1b2f3287f7 GoogleTest: Restore toleration of odd test PROPERTIES count
Prior to porting `gtest_discover_tests` to `discover_tests` it silently
tolerated an unpaired property name.  `discover_tests` does not support
that, so remove the unpaired argument.  Also add a warning to help
projects avoid such usage.

Fixes: #28004
2026-07-30 12:23:22 -04:00
Josef Šimánek e81906d12e CheckSymbolExists: Restore support for CMAKE_REQUIRED_FLAGS
Refactoring in commit a72e241200 (Check*: Restore more toleration of
`;-W...` in CMAKE_REQUIRED_FLAGS, 2026-07-21, v4.4.1~12^2) changed the
pattern that `Check*` modules use to forward `CMAKE_REQUIRED_FLAGS` to
`try_compile` calls.  However, it accidentally left out part of the new
pattern in the `CheckSymbolExists` module.  Fix that and add tests.

Fixes: #28001
2026-07-29 11:02:57 -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 1b33892492 GNUInstallDirs: Document cross-compiling behavior w.r.t. lib directories
The default is always `lib` when cross-compiling because we do not
know the target's distro.

Closes: #27982
2026-07-23 16:46:00 -04:00
Matthew Woehlke a72e241200 Check*: Restore more toleration of ;-W... in CMAKE_REQUIRED_FLAGS
Commit 5abaf65154 (Check*: Restore toleration of `;-W...` in
CMAKE_REQUIRED_FLAGS, 2026-06-24, v4.4.0-rc3~2^2) introduced logic to
prevent `-W*` arguments in `CMAKE_REQUIRED_FLAGS` from being passed as
CMake arguments in the `check[_<lang>]_source_{compiles,runs}` family of
utilities. However, several other related modules are also affected.
Update those to also use the new logic, and to have more uniform
implementations, making use of the refactoring from the previous commit.

Fixes: #27961
2026-07-21 15:21:42 -04:00
Matthew Woehlke 7644d557df Check*: Refactor variable handling
Commit 5abaf65154 (Check*: Restore toleration of `;-W...` in
CMAKE_REQUIRED_FLAGS, 2026-06-24, v4.4.0-rc3~2^2) introduced logic to
prevent `-W*` arguments in `CMAKE_REQUIRED_FLAGS` from being passed as
CMake arguments. It was never the intent of `CMAKE_REQUIRED_FLAGS` to
support such usage; however, since older versions of CMake would
silently accept such arguments, some users were unintentionally passing
compiler warnings as CMake arguments. Although this usage is incorrect,
it was silently tolerated until CMake 4.4, which began treating unknown
`-W*` as an error.

Because it turns out that modules besides `CheckSource{Compiles,Runs}`
are affected, we are going to need the logic added by that commit in
many more places. As a first step toward accommodating that need, move
the logic to a new internal helper. While we're at it, try to generally
consolidate the common logic for handling the various variables that the
`Check*` family of modules uses for injecting arguments into the
ultimate `try_compile` calls.
2026-07-21 15:21:42 -04:00
Brad King 1a58fc5bb9 Merge topic 'FindPython-fix-SABIModule-detection' into release-4.4
5fdfb2283a FindPython: fix SABIModule detection failure

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12285
2026-07-21 10:05:45 -04:00
Tyler Yankee c3c95f3010 GoogleTest: Avoid generation error on duplicate target test discovery
The discovery script created by commit 3748ca9f (GoogleTest: generate
single discovery script, 2026-04-08, v4.4.0-rc1~302^2~1) creates
generate-time collisions if gtest_discover_tests() is called on the
same target in the same directory with the same arguments multiple
times. Handle the case with a warning to preserve compatibility with
existing projects.

Fixes: #27940
2026-07-20 13:26:08 -04:00
Tyler Yankee fc1b218b37 GoogleTest: Fix gtest_discover_tests race on POST_BUILD of multiple targets
Restore the logic from commit 6680df042e (GoogleTest: Avoid POST_BUILD
race condition for gtest_discover_tests(), 2025-10-26, v4.2.0-rc2~15^2)
that was lost in the refactoring in commit 3748ca9fc7 (GoogleTest:
generate single discovery script, 2026-04-08, v4.4.0-rc1~302^2~1). Add
a regression test.

Fixes: #27939, #27319, #27972
2026-07-20 11:21:35 -04:00
Marc Chevrier 5fdfb2283a FindPython: fix SABIModule detection failure
Fixes: #27950
2026-07-16 17:28:43 +02:00
Brad King e5eea8e913 Merge topic 'fbuild_fix_win_cl_detection' into release-4.4
f143ff5ba4 FASTBuild: Prefer first compiler in PATH on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12264
2026-07-14 09:00:21 -04:00
Brad King 8ca9a4e1c3 Merge topic 'cpackifw-recent-versions' into release-4.4
311b78b37a CPackIFW: Add recent release versions to search list

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12268
2026-07-14 08:56:10 -04:00
Eduard Voronkin f143ff5ba4 FASTBuild: Prefer first compiler in PATH on Windows
We already do this for other command-line generators on Windows.

Fixes: #27923
2026-07-13 18:54:00 -04:00
Craig Scott 311b78b37a CPackIFW: Add recent release versions to search list
Fixes: #27917
2026-07-12 15:08:18 +10:00
FeRD (Frank Dana) b4534a9b7c Find{TCL,Tclsh,TclStub,Wish}: Add support for Tcl/Tk 9.0 & 9.1
Tcl/Tk 9.0.0 was released[1] in 2024, and is already up to version
9.0.4 (just released 2026-07-26).

Tcl/Tk 9.1 is currently nearing beta,[2] and will likely release soon.

Since it's still possible to have both of these libraries installed
without Tclsh or Wish (making version detection via those tools
unviable), add 9.0 and 9.1 variants to the explicit library/include
path and file matches performed by FindTCL.

Also add 9.0 and 9.1 patterns to the tool detections in FindTclsh,
FindTclStub, and FindWish.

[1]: https://sourceforge.net/projects/tcl/files/Tcl/9.0.0/
[2]: https://sourceforge.net/projects/tcl/files/Tcl/9.1b0/
2026-07-02 06:58:58 -04:00
FeRD (Frank Dana) 7ab991f5b6 Find{TCL,Tclsh,TclStub}: Remove matches for non-existent Tcl/Tk 8.7
Version 8.7 of Tcl/Tk never made it past alpha status.
What was briefly labeled 8.7a5 eventually released as 9.0.0.

And in FindTclStub, also remove patterns for ttkstub8.8, which
even more than 8.7 never actually existed.
2026-07-02 06:58:01 -04:00
Brad King df0671701e Find{TCL,Tclsh,TclStub,Wish}: Remove outdated Windows registry searches
Installers from "Scriptics" have not been available for many years.

Issue: #27914
Reported-by: FeRD (Frank Dana) <ferdnyc@gmail.com>
2026-07-02 06:57:33 -04:00
Brad King 7b9bc34277 Merge topic 'check-tolerate-W-flags' into release-4.4
5abaf65154 Check*: Restore toleration of `;-W...` in CMAKE_REQUIRED_FLAGS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12212
2026-06-25 07:25:37 -04:00
Brad King fba52b2b69 Merge topic 'skip-toolchain-checks-more-variables' into release-4.4
170248fbcb CMakeDetermineCompilerABI: require more variables to skip checks

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12201
2026-06-25 07:22:29 -04:00
Brad King 9c7c431442 Merge topic 'fortran-ptr-size' into release-4.4
e13c32153b Fortran: Detect pointer size on Intel archs with Oracle Studio 12.4 and below
11c897d487 Fortran: Detect pointer size on PowerPC archs with PGI
e88a4b9f2c Sunway: Detect sw_64 architecture more consistently

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12216
2026-06-25 07:19:50 -04:00
Matthew Woehlke 5abaf65154 Check*: Restore toleration of ;-W... in CMAKE_REQUIRED_FLAGS
The `CMAKE_REQUIRED_FLAGS` variable, used by the various entry points to
`cmake_check_source_{compiles,runs}`, specifies that flags shall not be
separated by semicolons. This is because the way in which it is passed
to the child `cmake` process means that, when considered as a list (with
semicolon separated items), only the first item is actually used as
compile flags, with any additional items actually seen as arguments to
the child `cmake` process. While this usage is unsupported, if invoked
accidentally, flags starting with `-W` were silently ignored by CMake.

However, CMake 4.4 newly complains about unrecognized warning
categories, which means that uses which were silently broken now result
in a hard error.

In the longer term, it would be helpful to introduce a policy to repair
improper use of semicolons in `CMAKE_REQUIRED_FLAGS` in order to do what
the user probably meant. However, for various reasons, we do not want to
introduce a policy to CMake 4.4 at this time, and anyway, the policy
won't help users that haven't enabled it. Therefore, alter the 'check
source' functions to detect arguments being passed to `cmake` rather
than the compiler, and remove any such that start with `-W`. This
removes any arguments that newly cause errors starting with CMake 4.4,
while not otherwise altering behavior in case any users were abusing
this implementation quirk.

Strictly speaking, this means that users can no longer abuse this quirk
to alter CMake's diagnostics. However, the only case in which this
should be observable is if the user is already abusing the quirk to
inject their own CMake logic into the CMake-provided test projects.
Since this was never supported, anyone doing that can keep the pieces.

Issue: #27901
Fixes: #27893
2026-06-24 13:59:11 -04:00
Ben Boeckel 170248fbcb CMakeDetermineCompilerABI: require more variables to skip checks
These variables were missed in the addition of the feature.

Fixes: #27894
2026-06-24 11:38:50 -04:00
Brad King e13c32153b Fortran: Detect pointer size on Intel archs with Oracle Studio 12.4 and below
Revise commit eb8cb2c6c2 (Fortran: Detect pointer size on Intel archs
with PGI, 2014-04-10, v3.0.0-rc4~4^2) to consider more variants of the
architecture macros.
2026-06-24 11:32:44 -04:00
Brad King 11c897d487 Fortran: Detect pointer size on PowerPC archs with PGI
The PGI compiler does not define __SIZEOF_POINTER__ so use the
__ppc64__ or __ppc__ CPU macros to select a pointer size instead.
2026-06-24 11:32:44 -04:00
Brad King e88a4b9f2c Sunway: Detect sw_64 architecture more consistently
Revise commit cfbf0480ff (Sunway: Add sw_64 support, 2025-08-05,
v4.2.0-rc1~373^2) to use the same set of preprocessor definitions for
all languages, and to order them consistently w.r.t. other archs.
2026-06-24 11:32:44 -04:00
Robert Maynard 0e9d7128cd CUDA: Add support for Clang on Windows ARM64 2026-06-23 16:43:15 -04:00
Robert Maynard 5f2b27562e FindCUDAToolkit: Add support for windows arm64 2026-06-23 16:43:04 -04:00
Robert Maynard afb9e1eab8 FindCUDAToolkit: Detect target processor even when not cross-compiling 2026-06-23 14:31:18 -04:00
Brad King a733b2c1ce Merge topic 'fix-opengl-legacy' into release-4.4
69956c6f63 FindOpenGL: Fix OpenGL and GLX result variables with legacy GL

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12205
2026-06-23 09:55:23 -04:00
Carlo Bramini 69956c6f63 FindOpenGL: Fix OpenGL and GLX result variables with legacy GL
In commit 32a5f11e50 (FindOpenGL: respect legacy preference for OpenGL
and GLX libraries, 2025-10-31, v4.3.0-rc1~544^2) the result variables
were spelled incorrectly.  Also re-order logic to preserve the CMP0072
warning text naming the GLVND libraries.

Fixes: #27299
2026-06-22 20:05:04 -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
Brad King d2880479b0 Merge topic 'FindRuby-vendor-dirs' into release-4.4
c4ee728699 FindRuby: Fix vendor directory discovery

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12189
2026-06-19 09:56:17 -04:00
Vito Gamberini 6d3e9d8220 c++modules: single import std target 2026-06-18 15:20:54 -04:00
Brad King c4ee728699 FindRuby: Fix vendor directory discovery
The `ruby -r vendor-specific` module no longer exists.
Use `ruby -r rbconfig` instead.

This patch has been carried by openSUSE's cmake package:

* https://build.opensuse.org/projects/openSUSE:Factory/packages/cmake/files/cmake-fix-ruby-test.patch?rev=274
* https://build.opensuse.org/package/rdiff/openSUSE:Factory/cmake?rev=106
* https://build.opensuse.org/package/rdiff/openSUSE:Factory/cmake?rev=57
* https://build.opensuse.org/package/rdiff/openSUSE:Factory/cmake?rev=56

Fixes: #27888
2026-06-18 10:50:52 -04:00