Commit Graph

15608 Commits

Author SHA1 Message Date
Brad King
2913f8b2ed Merge topic 'find_cuda_toolkit_move_more_logic_into_functions'
f757721ecd CUDAToolkit: Refactor find failure error messages to a single macro
0ae76a89b1 CUDAToolkit: Refactor guessing toolkit logic into a function

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11207
2025-09-21 18:32:11 -04:00
Brad King
7082fd0a20 Merge topic 'refactor_find_cuda_toolkit_to_support_cross_compilation_linux'
aed29e04bc CUDAToolkit: Prefer CUDAToolkit_ROOT over users `PATH` path

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11200
2025-09-21 18:29:44 -04:00
Robert Maynard
f757721ecd CUDAToolkit: Refactor find failure error messages to a single macro 2025-09-19 11:36:20 -04:00
Brad King
d361bf365e Emscripten: Drop hard-coded -sMAIN_MODULE and -sSIDE_MODULE flags
These flags are only needed for builds involving shared libraries,
and can cause undesirable behavior when they are not needed.
They also have variants with values like `=2`.  For now, just require
projects to add the flags when needed so they have full control.
In the future we may be able to add an abstraction to control them,
and automatically enable them when linking to shared libraries
or creating them.

Fixes: #27232
Issue: #27240
2025-09-19 09:54:02 -04:00
Brad King
707f14d434 Emscripten: Restore support for indirect use of emsdk toolchain file
Extend commit 644ad91e6a (Emscripten: Restore support for emsdk
toolchain file and platform module, 2025-09-17) to support using a
third-party `CMAKE_TOOLCHAIN_FILE` that includes the emsdk-provided
toolchain file.

Issue: #27232
2025-09-19 09:21:33 -04:00
Robert Maynard
aed29e04bc CUDAToolkit: Prefer CUDAToolkit_ROOT over users PATH path
Fixes #27102
2025-09-18 14:59:53 -04:00
Robert Maynard
0ae76a89b1 CUDAToolkit: Refactor guessing toolkit logic into a function 2025-09-18 14:56:52 -04:00
Brad King
792f6989e9 Merge topic 'android-ndk-custom-toolchain'
9266d4817d Android: Allow custom compilers with NDK

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11199
2025-09-18 08:49:55 -04:00
Brad King
0a11a8d77e Merge topic 'patch-QT_FOUND'
6a0cf35429 FindQt3, FindQt4: Clarify QT_FOUND result variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11198
2025-09-18 08:40:34 -04:00
Brad King
f2b2bac85d Emscripten: Detect and identify linker invoked by the compiler driver 2025-09-17 20:03:48 -04:00
Brad King
7f3f6d1ec6 Emscripten: Allow overriding -sMAIN_MODULE and -sSIDE_MODULE linker flags
Place the flag early on executable link lines so that projects can
override it, e.g., with `-sMAIN_MODULE=2` or `-sMAIN_MODULE=0` via
`target_link_options`.

The `-sSIDE_MODULE` flag already appears early enough on shared library
link lines.

Issue: #27232
2025-09-17 19:54:40 -04:00
Brad King
526c6ff6d2 Emscripten: Drop -sMAIN_MODULE and -sSIDE_MODULE with emsdk toolchain file
Emscripten provides a combined toolchain file and platform module that
predates CMake upstream support.  It disables support for shared libs.
Fix commit 96d9b94a98 (Emscripten: Add platform modules, 2025-05-16) to
avoid linking with `-sMAIN_MODULE` or `-sSIDE_MODULE` flags, meant to
support shared libraries, when using the emsdk toolchain file.

Fixes: #27232
2025-09-17 19:53:22 -04:00
Brad King
644ad91e6a Emscripten: Restore support for emsdk toolchain file and platform module
Emscripten provides a combined toolchain file and platform module that
predates CMake upstream support.  Since commit 96d9b94a98 (Emscripten:
Add platform modules, 2025-05-16), our `Platform/Emscripten` module is
included instead, suppressing existing behavior for users that set
`CMAKE_TOOLCHAIN_FILE` to the emsdk-provided toolchain file.  Restore
the previous behavior by teaching our module to defer to the original
module in that case.

Issue: #27232
2025-09-17 19:45:44 -04:00
Brad King
9cbeb922dd Emscripten: Enable de-duplication of libraries for CMP0156 with LLD
LLD automatically resolves newly encountered symbols using object files
previously encountered.  Also, the Emscripten compiler driver invokes
the LLD linker with `--whole-archive ... --no-whole-archive` around all
the libraries.  Therefore we should not repeat any.

Issue: #27232
Suggested-by: Marc Chevrier <marc.chevrier@gmail.com>
2025-09-17 19:44:13 -04:00
Brad King
f22d2904e2 Emscripten: Drop unused placeholder from link rule variables
Update commit 96d9b94a98 (Emscripten: Add platform modules, 2025-05-16)
to account for commit 67639002ad (Ninja,Makefile: Drop now-unused
placeholders from link rule variables, 2025-06-09, v4.1.0-rc1~37^2~1).
2025-09-17 19:44:13 -04:00
Brad King
f4da11a5da Emscripten: Select emcc and em++ compilers by default
This was missed by commit 96d9b94a98 (Emscripten: Add platform modules,
2025-05-16).
2025-09-17 19:44:13 -04:00
Brad King
9266d4817d Android: Allow custom compilers with NDK
If the user or toolchain file has already set `CMAKE_{C,CXX}_COMPILER`,
do not override it with the NDK-provided toolchain.

Fixes: #27162
2025-09-17 10:44:47 -04:00
Brad King
b62e751369 Merge topic 'patch-FindGit-version'
fe72a5dba2 FindGit: Add Git_VERSION

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11191
2025-09-17 10:04:31 -04:00
Peter Kokot
6a0cf35429 FindQt3, FindQt4: Clarify QT_FOUND result variable
Both of these modules provide `QT_FOUND` variable when using the
deprecated FindQt module, but `<PackageName>_FOUND` should be used when
using `find_package(Qt3)` or `find_package(Qt4)`.

- Qt3_FOUND became available in CMake 3.3.
2025-09-16 23:10:44 +02:00
Brad King
690ed2f706 Merge topic 'patch-CMakeConfigurableFile'
92c808687d Modules: Use file(CONFIGURE) instead of CMakeConfigurableFile.in

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11188
2025-09-16 09:55:23 -04:00
Brad King
4ae24357ad Merge topic 'patch-CMakeDependentOption-script-mode'
8b25e11fed CMakeDependentOption: Document project and script mode

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11192
2025-09-16 09:53:39 -04:00
Brad King
ae0f7f8498 Merge topic 'findwxwidgets'
96f6382357 FindwxWidgets: updates for wxWidgets 3.3

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Vadim Zeitlin <vz-kitware@zeitlins.org>
Merge-request: !11190
2025-09-16 09:51:52 -04:00
Brad King
a66c325ec1 Merge topic 'patch-FindImageMagick-version'
032e829b23 FindImageMagick: Add ImageMagick_VERSION

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11187
2025-09-16 09:50:27 -04:00
Brad King
c4fe74ba3d Merge topic 'python-android-link'
1507491c25 FindPython: link modules against libpython on Android

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11153
2025-09-16 09:16:35 -04:00
Brad King
c325904eb1 Merge topic 'vs2026'
47c784ba8a Help: Add release note for Visual Studio 18 2026 generator
cd46d8ec84 Merge branch 'backport-vs2026' into vs2026
3392b371e2 VS: Add Visual Studio 18 2026 generator
7f0883ac04 VS: Remove unused generator code
6f0d245083 VS: Fix `/dynamicdeopt` flag table entry order for v145 toolset
398ce8af72 VS: Remove `/guard:cf` from v145 link flag table
5c9085d876 VS: Remove `/MERGE` from v145 link flag table
fe5c78310c VS: Map the link `/debug` flag for v145 toolset
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11168
2025-09-16 09:00:10 -04:00
Brad King
1bdf6d2db6 Merge topic 'lfortran-0.55'
3b85cc1a8e Tests: Extend RunCMake.ParseImplicitLinkInfo for LFortran 0.55.0
7e8f76dad2 LFortran: Update flags renamed by version 0.55

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11184
2025-09-16 08:50:44 -04:00
Christopher Albert
7e8f76dad2 LFortran: Update flags renamed by version 0.55
The `--generate-object-code` flag is now `--separate-compilation`.

Fixes: #27225
2025-09-15 20:34:16 -04:00
Brad King
2337bfc562 Merge topic 'cxxmodules-custom-import-std-metadata-file'
85e536b5eb gitlab-ci: test `CMAKE_CXX_STDLIB_MODULES_JSON` in CI
42621a232b Tests/CXXModules: add a label
2f101b2c8c Tests/CXXModules: support testing with custom stdlib json locations
6c178a4ae3 Tests/RunCMake: add newlines in CXXModules options
2b85541e39 cxximportstd: support setting the `import std` metadata location

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11175
2025-09-15 11:39:52 -04:00
Brad King
cd46d8ec84 Merge branch 'backport-vs2026' into vs2026 2025-09-15 11:33:57 -04:00
Brad King
3392b371e2 VS: Add Visual Studio 18 2026 generator
Closes: #27213
2025-09-15 11:31:02 -04:00
Peter Kokot
8b25e11fed CMakeDependentOption: Document project and script mode
This module also works in script mode. This is a sync with the option()
command which mentions how the variable behaves in project and script
mode.
2025-09-14 23:38:51 +02:00
Peter Kokot
fe72a5dba2 FindGit: Add Git_VERSION
This deprecates the GIT_VERSION_STRING result variable.

Issue: #27088
Fixes: #26868
2025-09-14 21:08:16 +02:00
Maarten Bent
96f6382357 FindwxWidgets: updates for wxWidgets 3.3
wxWidgets 3.3 changed some win32 libraries from dynamic to static loading.
Update the list of win32 libraries to the list used upstream.
wsock32 is not used in wxWidgets 3.3 anymore, but keep it for older wxWidgets versions.

wxWidgets 3.3 also adds the wxwebp library. Add it, and its sub-libraries, to wxWidgets_COMMON_LIBRARIES.
2025-09-14 17:52:58 +02:00
Peter Kokot
92c808687d Modules: Use file(CONFIGURE) instead of CMakeConfigurableFile.in
When this was implemented, file(CONFIGURE) wasn't yet available until
CMake 3.18.
2025-09-14 00:56:19 +02:00
Peter Kokot
032e829b23 FindImageMagick: Add ImageMagick_VERSION
This deprecates the ImageMagick_VERSION_STRING result variable.

Additionally, ImageMagick version is now determined by either mogrify
executable (if available), or from the `<magick/version.h>` header.

Issue: #27088
2025-09-13 23:48:05 +02:00
Malcolm Smith
1507491c25 FindPython: link modules against libpython on Android 2025-09-13 12:53:18 +01:00
Peter Kokot
395452ad1d ExternalProject: Document module inclusion in project mode
This module can be only included in project mode (when `CMAKE_ROLE` is
`PROJECT`).

Issue: #26555
2025-09-12 03:38:42 +02:00
Ben Boeckel
2b85541e39 cxximportstd: support setting the import std metadata location
Some deployments may not be able to discover the metadata file reliably
(e.g., custom `clang` builds on macOS while using the SDK's stdlib or
distribution bugs). Allow users to force the location so that
compiler-driven detection doesn't have to bend over backwards for
unforeseen bugs.
2025-09-11 18:03:00 -04:00
Brad King
ea539e2de6 Merge topic 'GNUInstallDirs-cached-default'
2e88a3efc2 GNUInstallDirs: Fix regression on -DCMAKE_INSTALL_<dir>=<default> in /usr

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11167
2025-09-11 12:06:59 -04:00
Cristian Le
2e88a3efc2 GNUInstallDirs: Fix regression on -DCMAKE_INSTALL_<dir>=<default> in /usr
Fix commit 9789f7d05e (GNUInstallDirs: Add internal helper to compute
specific defaults, 2025-03-28, v4.1.0-rc1~384^2~3) to avoid updating
explicitly-specified cache entries on the first run.  Do not reset the
default value until at least the second run, during which we have
`_GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX` already defined.

Fixes: #27211
2025-09-10 16:03:43 -04:00
Nils Gladitz
193f17102f CPack/WiX: Implement opt-in per component .cab
By setting CPACK_WIX_CAB_PER_COMPONENT users can generate one
.cab per component instead of one .cab per installer.

WiX compresses .cab files in parallel.
This may potentially speed up installer creation.

May also allow larger installers (there is a 2GB per .cab limit).
2025-09-10 12:24:42 +02:00
Brad King
563e11b6fd Merge topic 'cmake#27203/add-NDEBUG-GHS'
7493bc6d4a GHS C/CXX compiler: add NDEBUG compile define for non-debug aka release builds

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11158
2025-09-09 09:53:10 -04:00
Brad King
c81e96d80c Merge topic 'CheckCompilerFlag-no-newlines'
993794f5f6 CheckCompilerFlag: Avoid matching parts of multiple messages
c196e024bd CheckCompilerFlag: Improve layout of message regex tables

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11161
2025-09-09 09:48:37 -04:00
Brad King
f32b6ae8f2 Merge topic 'iar-asm'
87d95b2222 ASM: Restore CMAKE_ASM_COMPILER_ARCHITECTURE_ID persistence

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11160
2025-09-09 09:45:34 -04:00
Brad King
76d88f7895 VS: Add CSharp VS 2026 compiler version and flag table v145
While the flag tables for C and C++ were generated from MSBuild `.xml`
files, the CSharp flag tables were written by hand.  Copy the `v143`
flag table to use for the `v145` toolset.
2025-09-08 20:24:14 -04:00
Andreas Graf
7493bc6d4a GHS C/CXX compiler: add NDEBUG compile define for non-debug aka release builds
Fixes: #27203
2025-09-08 18:19:03 +02:00
Brad King
bf1841534c Merge topic 'cpack-several-checksums'
bc1c295b95 CPack: Add support for multiple checksums per package

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11141
2025-09-08 11:29:34 -04:00
Brad King
daf5cc56a0 Merge topic 'fbuild_clang_cl'
888e9e1081 FASTBuild: fix CMake build with clang-cl

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !11137
2025-09-08 11:25:51 -04:00
Brad King
5e34b752d6 Merge topic 'cmp0178-warning-googletest'
f4059c5923 GoogleTest: Prevent spurious CMP0178 warning for EXTRA_ARGS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11152
2025-09-08 11:23:58 -04:00
Brad King
e6c24fe936 Merge topic 'cmp0174-warning-fetchcontent'
20c751bdcb FetchContent: Update policy settings to CMake 4.1
60b8114ea9 Help: Stronger wording for prohibited keywords in FetchContent_Declare()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11151
2025-09-08 11:22:07 -04:00