Commit Graph
16140 Commits
Author SHA1 Message Date
Brad King 70f568b17b Merge topic 'FindPython-add-pydebug-ABI-support-on-Windows'
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:25 -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 cebb36e790 Merge topic 'doc-GNUInstallDirs-cross'
1b33892492 GNUInstallDirs: Document cross-compiling behavior w.r.t. lib directories

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12318
2026-07-24 08:18:24 -04: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
Brad King 47e0f5da6a Merge topic 'toolchain-preset-warning'
7bc37a0561 CMAKE_TOOLCHAIN_FILE: Avoid excess reconfigures from relative paths

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12289
2026-07-23 08:42:32 -04:00
Aiden Woodruff 7bc37a0561 CMAKE_TOOLCHAIN_FILE: Avoid excess reconfigures from relative paths
Save original input value of CMAKE_TOOLCHAIN_FILE also before
normalization or relative searching to avoid reconfiguring because the
full path doesn't match the input. Tests correct behavior avoiding
reconfigures and ensuring reconfigure on toolchain change from preset.

Fixes: #24942
2026-07-22 11:53:05 -04:00
Brad King 9c631586d2 Merge topic 'cuda-toolkit-namespace'
f2d5320d42 FindCUDAToolkit: Add CUDAToolkit:: namespace targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12290
2026-07-22 11:32:13 -04:00
Brad King 0c702d4692 Merge topic 'more-CMAKE_REQUIRED_FLAGS-fixes'
a72e241200 Check*: Restore more toleration of `;-W...` in CMAKE_REQUIRED_FLAGS
7644d557df Check*: Refactor variable handling

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12303
2026-07-22 10:55:46 -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 a0a2ba79c4 Merge topic 'FindPython-fix-SABIModule-detection'
5fdfb2283a FindPython: fix SABIModule detection failure

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12285
2026-07-21 10:05:47 -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
Arha Gatram f2d5320d42 FindCUDAToolkit: Add CUDAToolkit:: namespace targets
Changes target namespace to CUDAToolkit to match module name. Adds ALIAS
targets with the old CUDA:: namespace to maintain backwards
compatibility.

Issues: #27786
2026-07-20 15:59:26 -07:00
Brad King f858c1907d Merge topic 'gtest-multiple-discovery'
c3c95f3010 GoogleTest: Avoid generation error on duplicate target test discovery

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12279
2026-07-20 15:09:05 -04:00
Brad King 43f6543134 Merge topic 'gtest-test-target'
4f0dea4ea5 Merge branch 'backport-4.2-gtest-test-target' into gtest-test-target
fc1b218b37 GoogleTest: Fix gtest_discover_tests race on POST_BUILD of multiple targets
e79506fadf GoogleTest: Fix gtest_discover_tests race on POST_BUILD of multiple targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12276
2026-07-20 15:05:18 -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
Brad King a6d2c60f73 Merge topic 'googletest_handle_newline_characters'
2c181bd60a GoogleTest: Drop newlines from test names
b464920acc string(STRIP): Document that it removes newlines

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12262
2026-07-20 09:58:38 -04:00
Robert Maynard 2c181bd60a GoogleTest: Drop newlines from test names
It is possible to have trailing ( and maybe leading ) newlines in a test name. This causes problems with ctest
features like `tests-from-file` since they will never
be an exact match.

So now we sanitize names by removing these newlines
2026-07-16 15:11:53 -07:00
Marc Chevrier 5fdfb2283a FindPython: fix SABIModule detection failure
Fixes: #27950
2026-07-16 17:28:43 +02:00
Brad King 6677f6959f Merge topic 'fbuild_fix_win_cl_detection'
f143ff5ba4 FASTBuild: Prefer first compiler in PATH on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12264
2026-07-14 09:00:23 -04: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 ccb47a71cc Merge topic 'cpackifw-recent-versions'
311b78b37a CPackIFW: Add recent release versions to search list

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12268
2026-07-14 08:56:11 -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
Sharadh Rajaraman 1610aa22f4 Clang: Add support for import std when targeting the MSVC ABI
When Clang targets the MSVC ABI, discover the MSVC standard library's
import-std metadata discovery through the MSVC module logic.  Also
extend the latter to use `CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES`
and honor `CMAKE_CXX_STDLIB_MODULES_JSON`.

Closes: #26761
Signed-off-by: Sharadh Rajaraman <r.sharadh@outlook.sg>
2026-07-08 16:55:21 -04:00
Sharadh Rajaraman b9bb2b1256 CompilerId: detect MSVC STL for clang-cl
Extend C++ stdlib detection to cover Clang with MSVC frontend and
forward configured standard include directories to the probe command.

Also recognize _MSVC_STL_VERSION in CXX-DetectStdlib.h so the
standard library is classified as msvc instead of UNKNOWN in this path.

Issue: #26761
Signed-off-by: Sharadh Rajaraman <r.sharadh@outlook.sg>
2026-07-08 14:27:05 -04:00
Brad King 04c04c85f1 Merge topic 'tcl-9'
b4534a9b7c Find{TCL,Tclsh,TclStub,Wish}: Add support for Tcl/Tk 9.0 & 9.1
7ab991f5b6 Find{TCL,Tclsh,TclStub}: Remove matches for non-existent Tcl/Tk 8.7
df0671701e Find{TCL,Tclsh,TclStub,Wish}: Remove outdated Windows registry searches

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12232
2026-07-03 09:24:26 -04: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 c292fa6b2f Merge topic 'uname-no-sysroot'
15ddce7e35 CMakeDetermineSystem: Do not try to lookup 'uname' in CMAKE_SYSROOT

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12231
2026-07-01 09:49:13 -04:00
Dmitry Vilkov 15ddce7e35 CMakeDetermineSystem: Do not try to lookup 'uname' in CMAKE_SYSROOT
We find `uname` before the toolchain file has been included, so the user
has not yet been able to set `CMAKE_FIND_ROOT_PATH_MODE_PROGRAM`.  If
`CMAKE_SYSROOT` is passed via the command line, avoid searching in it.
2026-06-30 12:02:02 -04:00
Brad King bce2b06a6e Merge topic 'FindPkgConfig-batch'
660684c333 FindPkgConfig: Batch pkg-config flag queries
9555f80ea8 FindPkgConfig: Tolerate include directory order in test

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12204
2026-06-30 11:11:43 -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
Volodymyr Zolotopupov 660684c333 FindPkgConfig: Batch pkg-config flag queries 2026-06-29 15:43:55 -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 e0fab2e604 Merge topic 'cuda_lang_support_code_signing'
bd629722bd CUDA: Support _CMAKE_FEATURE_DETECTION_TARGET_TYPE like all other languages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12220
2026-06-29 11:48:37 -04:00
Robert Maynard bd629722bd CUDA: Support _CMAKE_FEATURE_DETECTION_TARGET_TYPE like all other languages 2026-06-25 13:22:02 -04:00
Brad King 1521c231c2 Merge topic 'FindDoxygen-USES_TERMINAL'
89de655356 FindDoxygen: Add USES_TERMINAL option to doxygen_add_docs()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12184
2026-06-25 07:31:24 -04:00
Brad King fe3be55d54 Merge topic 'check-tolerate-W-flags'
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:38 -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 8192c7dce1 Merge topic 'skip-toolchain-checks-more-variables'
170248fbcb CMakeDetermineCompilerABI: require more variables to skip checks

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12201
2026-06-25 07:22:31 -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 53862a2744 Merge topic 'fortran-ptr-size'
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:52 -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
Brad King 9120771b28 Merge topic 'FindCUDAToolkit_support_win_arm64'
0e9d7128cd CUDA: Add support for Clang on Windows ARM64
5f2b27562e FindCUDAToolkit: Add support for windows arm64
afb9e1eab8 FindCUDAToolkit: Detect target processor even when not cross-compiling

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12210
2026-06-25 07:17:56 -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