16301 Commits
Author SHA1 Message Date
James Miro 6c4a0d284e FindDoxygen: Makes USES_TERMINAL compatible with USE_STAMP_FILE
Fixes: #28238
2026-11-03 09:03:57 -05:00
Aiden Woodruff fcce694567 CMAKE_TOOLCHAIN_FILE: Account for empty values when detecting changes
Initially empty CMAKE_TOOLCHAIN_FILE values should not result in an
include() statement but should be recorded to later detect changes.

Fixes: #28231
2026-10-30 13:05:16 -04:00
Brad King 4f7dbc9408 Merge topic 'python3.16' into release-4.5
959098d148 FindPython: Add support for Python 3.16

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12738
2026-10-30 10:17:49 -04:00
Miro Hrončok 959098d148 FindPython: Add support for Python 3.16 2026-10-29 13:32:07 -04:00
Tyler Yankee 63e7673d0b FindDoxygen: Tolerate empty output formats
Amend commit 8fc8f564c9 (FindDoxygen: Create and clean recursive
subdirectories for output formats, 2026-08-09) to avoid syntax errors
with undefined variables.

Fixes: #28222
2026-10-29 09:30:36 -04:00
Vito Gamberini 511ac7ecd7 FindPkgConfig: Query prefix separately from modversion
FDO pkg-config does not allow multiple output modes like --modversion
and --variable in the same query. Split them up into two separate
queries while retaining batching for the rest of the flags.

Fixes: #28194
2026-10-23 11:17:20 -04:00
Brad King 46f45a2c81 Merge topic 'revert-UseSWIG--use-SOURCE_PROPERTY-genex' into release-4.5
a29e31496f UseSWIG: Revert "use $<SOURCE_PROPERTY> genex"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12688
2026-10-22 09:37:24 -04:00
Brad King 399d2eccba Merge topic 'gnuinstalldirs-opt-double-slash' into release-4.5
0f585d056c GNUInstallDirs: Fix double separator in /opt special-case absolute paths

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12673
2026-10-21 15:33:25 -04:00
Marc Chevrier a29e31496f UseSWIG: Revert "use $<SOURCE_PROPERTY> genex"
Revert commit 25798c15 (UseSWIG: use $<SOURCE_PROPERTY> genex,
2026-06-05).

Moving source file properties evaluation from configuration
to generation time prevents the possibility to have the same source file,
in one directory, in different targets with different settings.

Revert to the previous implementation not using $<SOURCE_PROPERTY>
generator expression.

Fixes: #28193
2026-10-21 19:10:15 +02:00
Mike Matthews 0f585d056c GNUInstallDirs: Fix double separator in /opt special-case absolute paths
Since commit 7566a477f7 (GNUInstallDirs: Factor out helper for special
absolute path logic, 2025-03-27, v4.1.0), when CMAKE_INSTALL_PREFIX is
under /opt/ (excluding /opt/homebrew), the special case FHS directories
include an extra path separator, resulting in values like /etc//opt/foo.
This is observed in CMAKE_INSTALL_FULL_SYSCONFDIR,
CMAKE_INSTALL_FULL_LOCALSTATEDIR, and CMAKE_INSTALL_FULL_RUNSTATEDIR
whenever their corresponding CMAKE_INSTALL_<dir> may be relative, as is
the case under policy CMP0192 OLD or if set explicitly while under
CMP0192 NEW (e.g. -DCMAKE_INSTALL_SYSCONFDIR=etc). Restore the previous
path calculation, which relies on the prefix starting with `/`.

Fixes: #28186
2026-10-20 14:12:09 -04:00
Tyler Yankee eb98a8782f FindOpenCL: Add support for OpenCL 3.1
Fixes: #28190
2026-10-19 17:36:11 -04:00
Brad King 9c4f4f65b0 Merge topic 'fix-old-clang-stdlib-modules-json' into release-4.5
d17d559734 c++modules: Don't set STDLIB_MODULES_JSON on Clang < 18.1.2

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12672
2026-10-19 14:01:48 -04:00
Vito Gamberini d17d559734 c++modules: Don't set STDLIB_MODULES_JSON on Clang < 18.1.2
This makes CMAKE_CXX_STDLIB_MODULES_JSON a valid check if import std is
expected to be available at all.

Fixes: #28183
2026-10-18 12:58:53 -04:00
Vito Gamberini bc45794c2a Clang: Account for empty include directories entries in stdlib probe
Fixes: #28178
2026-10-16 15:11:29 -04:00
Brad King a7cd047bc8 Merge topic 'sycl-fixes' into release-4.5
64fbf5bba4 SYCL: Don't use -shared for Intel device linking
46ec181d8e SYCL: Only use whole-archive device link when necessary

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12650
2026-10-15 10:45:06 -04:00
Brad King 98ff37f09f Merge topic 'LLVMFlang-Apple-Flang-18-19' into release-4.5
45208d7353 LLVMFlang: Support Flang 18 and 19 on Apple platforms

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12642
2026-10-15 10:30:12 -04:00
Vito Gamberini 64fbf5bba4 SYCL: Don't use -shared for Intel device linking
Fixes: #28163
2026-10-14 12:57:29 -04:00
Vito Gamberini 46ec181d8e SYCL: Only use whole-archive device link when necessary
Fixes: #28165
2026-10-14 12:27:10 -04:00
Daksh Mamodiya 45208d7353 LLVMFlang: Support Flang 18 and 19 on Apple platforms
Flang gained -Xlinker only in LLVM 20, so the Apple linker flags added
by commit 18d65b9d4b (LLVMFlang: Fix Fortran shared library creation on
Apple platforms, 2026-09-23) fail with older Flang.  For those versions
the flags now go through -Wl, with the install name joined to its flag.
Flang 20 and later keep the -Xlinker form.

Fixes: #28148
2026-10-14 09:35:43 -04:00
Vito Gamberini 21213ae1d9 DPClang: add compiler support
Fixes: #28157
2026-10-13 14:59:23 -04:00
Tyler Yankee 3e4b7dbaa8 Help: Document GTest discovery mode default variable 2026-10-12 12:38:44 -04:00
Brad King d9553e4ee9 Merge topic 'FindPython-CROSSCOMPILING-fix'
43a451a269 Merge branch 'backport-4.4-FindPython-CROSSCOMPILING-fix' into FindPython-CROSSCOMPILING-fix
31bc69fca0 FindPython: fix wrong check in cross-compiling and CMP0190=OLD
dbc73242d8 FindPython: fix wrong check in cross-compiling and CMP0190=OLD

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12622
2026-10-12 10:29:56 -04:00
Brad King 539d02479a Merge topic 'blas-lapack-nvpl'
c0a233dce9 Find{BLAS,LAPACK}: Restore targets in {BLAS,LAPACK}_LIBRARIES with NVPL

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12619
2026-10-12 10:27:57 -04:00
Marc Chevrier dbc73242d8 FindPython: fix wrong check in cross-compiling and CMP0190=OLD
Fixes: #28144
2026-10-09 16:35:54 +02:00
Ye Luo c0a233dce9 Find{BLAS,LAPACK}: Restore targets in {BLAS,LAPACK}_LIBRARIES with NVPL
Revert commit d8ade0500e (Find{BLAS,LAPACK}: Provide full paths in
`{BLAS,LAPACK}_LIBRARIES` with NVPL, 2026-09-05).  These variables
should supply full dependency, not just the immediate library file
returned by `get_target_property(IMPORTED_LOCATION_RELEASE)`.
Since the documentation regarding these two variables has been
updated, let's keep the old behavior which actually works better.

Issue: #28073
2026-10-09 10:30:21 -04:00
Brad King 9eab45da5f Merge topic 'sycl-language'
29fa0adc3e ci: enable SYCL tests on Fedora
f69754ad63 SYCL: Initial language implementation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12467
2026-10-09 08:49:00 -04:00
Brad King a2baaedb42 Merge topic 'ohos-linker-config'
6b14597177 OHOS: Add linker configuration files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12607
2026-10-08 09:17:55 -04:00
Vito Gamberini f69754ad63 SYCL: Initial language implementation
Add experimental support for SYCL under an experimental gate. The
IntelLLVM and Adaptivecpp compilers are recognized, as well as upstream
Clang with libsycl support.

Fixes: #27219, #27905
2026-10-07 11:43:31 -04:00
Brad King e7208acd29 Merge topic 'vs-cuda-integration-missing'
fe7ad024a1 VS: Improve error message when CUDA integration is not installed

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robertjmaynard@gmail.com>
Merge-request: !12600
2026-10-07 11:33:43 -04:00
Joerg Bornemann 6b14597177 OHOS: Add linker configuration files
Since commit 1e35163ae8, the WHOLE_ARCHIVE feature is defined in the
linker configuration modules. OHOS had no such files, so
$<LINK_LIBRARY:WHOLE_ARCHIVE,...> failed there.

Add forwarding files to the Linux linker configuration, as done for
Android in commit d2997ab601. Unlike Android, fall back to LLD when the
linker cannot be identified, because the OHOS SDK toolchain file links
with -fuse-ld=lld.
2026-10-07 13:58:13 +02:00
Brad King fe7ad024a1 VS: Improve error message when CUDA integration is not installed
Fixes: #28142
2026-10-06 11:09:33 -04:00
Brad King a100852cad Merge topic 'fix-clang-std-discovery'
54dcd459ff ci: Test Windows Clang modules without a developer environment
23df9ff972 c++modules: Improve clang stdlib detection on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12561
2026-10-06 10:35:07 -04:00
Brad King 9a717716ea Merge topic 'cuda-clang-cl'
3fae9133cc CUDA: Support clang-cl

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12593
2026-10-06 10:31:24 -04:00
Vito Gamberini 23df9ff972 c++modules: Improve clang stdlib detection on Windows
Allow the stdlib probe to guide modules.json discovery when using a
clang driver on Windows. Explicitly provided module metadata still takes
precedence, and this check fails if clang itself can't discover the
stdlib.

Fixes: #28035
2026-10-05 09:59:21 -04:00
Craig Scott b6bb95a8bf Merge topic 'FindProtobuf-protoc-options-comment'
5a082c7dde FindProtobuf: Fix protobuf_generate COMMENT with multiple PROTOC_OPTIONS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12556
2026-10-05 07:23:00 -04:00
Vito Gamberini 3fae9133cc CUDA: Support clang-cl
Fixes: #28139
2026-10-04 22:11:50 -04:00
Brad King 6a2c93c901 Merge topic 'windows-cuda-module-def'
6401308473 CUDA: Add per-language module -DEF: flag on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12591
2026-10-02 10:38:05 -04:00
Brad King f57f2a5acb Merge topic 'windows-library-path-per-lang'
89e5c19c55 Linker: Generate per-language link directory flags on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12588
2026-10-02 10:27:33 -04:00
Brad King 2dc27edfb2 Merge topic 'FindTclStub-found'
2e76eec10d FindTclStub: Do not require the Tk and ttk stub libraries

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12584
2026-10-02 10:15:02 -04:00
Brad King 372b8a26fb Merge topic 'FindTCL-tk9'
9589c88e10 FindTCL: Find Tk 9 libraries and Homebrew headers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12580
2026-10-02 10:11:32 -04:00
Daksh Mamodiya 6401308473 CUDA: Add per-language module -DEF: flag on Windows
NVIDIA CUDA links with `link.exe` directly, but had no
`CMAKE_CUDA_LINK_DEF_FILE_FLAG` and fell back to the global
`CMAKE_LINK_DEF_FILE_FLAG`.  With IntelLLVM enabled in the same build
tree, that holds `/Qoption,link,/DEF:`, which `link.exe` ignores, so a
CUDA DLL exported nothing from its `.def` file.  Commit 8b710d8264
(Linker: Generate per-language module -DEF: flags on Windows,
2025-05-28) covered the other Windows toolchains but missed CUDA.

Fixes: #25598
Issue: #26005
2026-10-01 23:26:45 +05:30
Daksh Mamodiya 2e76eec10d FindTclStub: Do not require the Tk and ttk stub libraries
TclStub_FOUND also required TTK_STUB_LIBRARY, but Tk puts its ttk
stubs in the Tk stub library and has no separate one, so it was
false on standard installs. It now needs only TCL_STUB_LIBRARY,
which is what the docs say it reports.

Fixes: #28134
2026-10-01 21:28:03 +05:30
Daksh Mamodiya 9589c88e10 FindTCL: Find Tk 9 libraries and Homebrew headers
Tk 9 names its library with a "tcl9" prefix (tcl9tk90.lib,
libtcl9tk9.0.so), which our tk90/tk9.0 patterns don't match. We now
search for these names too, and also look in include/tcl-tk for the
headers, where Homebrew installs them.

Fixes: #28129
2026-10-01 21:24:12 +05:30
Brad King 3fadb7a600 Merge topic 'discover-test-deps'
463517fddd ctest: Support Test Dependencies for discover_test modules

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12413
2026-10-01 10:41:29 -04:00
Cristian Adam 640361b655 CPack: Add APK generator
Package Android applications by driving the Android SDK build tools
(aapt2, d8, zipalign and apksigner) and the JDK directly, so that no
Gradle installation is needed.  Java code is taken from sources, `.jar`
and `.aar` files.  Maven dependencies, such as the AndroidX libraries,
can be listed in `CPACK_APK_MAVEN_DEPENDENCIES` to have them and their
dependencies downloaded at packaging time, resolved like Gradle does
from Gradle module metadata or POMs.  Nothing is downloaded otherwise.
Like the Android Gradle plugin, the shared C++ runtime of the NDK is
packaged for the native libraries that `readelf` finds linked to it.
The native libraries of several ABIs are packaged into one APK by a
superbuild that builds each ABI with `ExternalProject` and lists the
build trees in `CPACK_INSTALL_CMAKE_PROJECTS`.

See: https://bugreports.qt.io/browse/QTBUG-106495
2026-10-01 09:44:06 -04:00
Daksh Mamodiya 89e5c19c55 Linker: Generate per-language link directory flags on Windows
IntelLLVM links through the compiler driver, so its link directory
flag is wrapped in `/Qoption,link,`.  MSVC and CUDA run `link.exe`
directly.  When both are used in one build tree, the IntelLLVM value
of `CMAKE_LIBRARY_PATH_FLAG` leaked onto `link.exe` command lines.
Setting `CMAKE_<LANG>_LIBRARY_PATH_FLAG` per language, as was done
for `CMAKE_<LANG>_LINK_DEF_FILE_FLAG`, gives each link line the
spelling its own linker understands.  The variable is now documented.

Fixes: #28116
2026-10-01 15:37:42 +05:30
Martin Duffy 463517fddd ctest: Support Test Dependencies for discover_test modules
- Update discover_tests to work with test_prep targets and ctest --out-of-date
- Extend behavior to gtest_discover_tests
- Don't treat non-built targets as always out of date
- Support imported targets in BUILD_DEPENDS

Issue: #28052, #28070
2026-09-30 09:26:58 -04:00
scivision e54d5ade18 FindMatlab add R2025b-R2026b version map 2026-09-29 16:55:36 -04:00
Brad King 1ece2660b2 Merge topic 'drop-import-std-gate'
4874f044bd Experimental: Remove import std experimental gate
b65a094a31 c++modules: Don't set CMAKE_CXX_STDLIB_MODULES_JSON if the file does not exist

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: Sharadh Rajaraman <r.sharadh@outlook.sg>
Merge-request: !12547
2026-09-28 08:36:27 -04:00
15daksh-2003 5a082c7dde FindProtobuf: Fix protobuf_generate COMMENT with multiple PROTOC_OPTIONS
With two or more PROTOC_OPTIONS the custom command's comment picked up
the raw list separator, so the unquoted COMMENT expanded to several
arguments. Since CMP0175 that's a configure error under NEW and a
policy warning otherwise, and the comment only ever showed the last
option.

We're now joining the options with spaces before they go into the
comment, which is how upstream protobuf fixed the same code in v33.0
(protocolbuffers/protobuf@aa1f665cdc). The COMMENT argument is also
quoted now, and the module sets CMP0175 to NEW for its own
add_custom_command() call instead of inheriting the project's setting.
That keeps a stray separator from splitting the comment again, and it
stops the policy warning that pointed into this module.

Fixes: #28078
2026-09-25 22:43:49 +05:30