Commit Graph

71056 Commits

Author SHA1 Message Date
Brad King
7dbffb3aa1 Merge topic 'cps-metadata-from-project'
ecf81c1bc1 CPS: Get metadata from project
9adf93d112 Tests/InstallPackageInfo: Consolidate bad arguments tests
d4ab279742 cmState: Track known projects
0ccbe5a2e1 CPS: Refactor argument parsing

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10837
2025-06-03 07:57:23 -04:00
Brad King
139062247d Merge branch 'release-4.0' 2025-06-03 07:55:22 -04:00
Brad King
8935e7865c Merge branch 'release-3.31' 2025-06-03 07:55:15 -04:00
Brad King
723505661e Merge branch 'release-3.31' into release-4.0 2025-06-03 07:55:05 -04:00
Brad King
b302378bbd Merge branch 'release-4.0' 2025-06-03 07:54:18 -04:00
Brad King
b97a6beb6b Merge topic 'clang-cuda-archs'
33fb4e1a50 CUDA/Clang: Add archs supported by Clang 21
a6aaabbdff CUDA/Clang: Reorder the logic for setting supported archs
695af87c6f CUDA/Clang: Fix list of architectures supported by Clang < 20.1

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10848
2025-06-03 07:54:18 -04:00
Brad King
d5bd7cf09f Merge topic 'clang-cuda-archs' into release-4.0
33fb4e1a50 CUDA/Clang: Add archs supported by Clang 21
a6aaabbdff CUDA/Clang: Reorder the logic for setting supported archs
695af87c6f CUDA/Clang: Fix list of architectures supported by Clang < 20.1

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10848
2025-06-03 07:54:16 -04:00
Brad King
160b518252 Merge topic 'clang-cuda-archs' into release-3.31
33fb4e1a50 CUDA/Clang: Add archs supported by Clang 21
a6aaabbdff CUDA/Clang: Reorder the logic for setting supported archs
695af87c6f CUDA/Clang: Fix list of architectures supported by Clang < 20.1

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10848
2025-06-03 07:52:36 -04:00
Kitware Robot
cd2d4276c3 CMake Nightly Date Stamp 2025-06-03 00:04:30 -04:00
Brad King
7db3dbddb2 VS: Suppress MSBuild default flags not specified by project or user
`Microsoft.Cl.Common.props` adds some `cl` flags by default, but for
CMake they may not match what's produced by command-line generators.
If the `-Zc:wchar_t`, `-Zc:forScope`, and/or `-Zc:inline` flags are
not specified by the project or user, suppress them.

Fixes: #26964
2025-06-02 14:59:38 -04:00
Andrey Alekseenko
33fb4e1a50 CUDA/Clang: Add archs supported by Clang 21 2025-06-02 18:35:13 +02:00
Andrey Alekseenko
a6aaabbdff CUDA/Clang: Reorder the logic for setting supported archs 2025-06-02 18:34:26 +02:00
Andrey Alekseenko
695af87c6f CUDA/Clang: Fix list of architectures supported by Clang < 20.1
Clang before 20.1 does not recognize sm_100 and newer.  Revise:

* commit b2251e0deb (CUDA/Clang: Update architectures supported by
                     CUDA 12.8, 2025-02-04, v4.0.2~4^2~1^2)
* commit a1b4c30f24 (CUDA: Add CUDA 12.9 new architectures and family
                     syntax, 2025-04-21, v4.0.2~3^2^2)
2025-06-02 10:32:27 -04:00
Matthew Woehlke
ecf81c1bc1 CPS: Get metadata from project
Modify {export,install}(PACKAGE_INFO) commands to inherit version
information from the current project in situations where it seems
reasonable to do so. Add an option to explicitly request inheritance
from a specific project.

This leverages the recently added project(COMPAT_VERSION).
2025-06-02 10:31:36 -04:00
Matthew Woehlke
9adf93d112 Tests/InstallPackageInfo: Consolidate bad arguments tests
Consolidate InstallPackageInfo's bad arguments tests into only two test
cases that each test multiple invocations, rather than having a single
test per invocation. This makes them match the similar ExportPackageInfo
tests which were necessarily consolidated due to those testing many more
variants (due to differences in the respective interfaces). This will
simplify adding additional tests in the future.
2025-06-02 10:31:36 -04:00
Matthew Woehlke
d4ab279742 cmState: Track known projects
Add a member to directory state that records the set of known projects.
Add a method to query whether a project exists.

Internally, while this doesn't allow us to confirm that a variable like
`foo_VERSION` is actually associated with a project `foo`, it provides a
much stronger indicator than the mere existence of said variable.
2025-06-02 10:31:35 -04:00
Matthew Woehlke
0ccbe5a2e1 CPS: Refactor argument parsing
CPS package metadata involves a fair amount of passing around a
particular set of values, as well as shared argument handling, which is
only going to increase as additional features are added. In order to
reduce code duplication (now and going forward), create a helper class
to handle the shared argument parsing and to serve as a container to
pass metadata values.
2025-06-02 10:31:35 -04:00
Brad King
bb8baacbcc MSVC: Factor out link -machine flag name 2025-06-02 10:26:28 -04:00
Brad King
4c6c7f4d45 MSVC: Move link -subsystem flag handling near and -machine flag handling 2025-06-02 10:26:27 -04:00
Brad King
f1a80a5581 CUDA: Drop unused link rule variable setting on Windows 2025-06-02 10:26:27 -04:00
Brad King
a0732ce47f CMAKE_STATIC_LINKER_FLAGS: Fix terminology in cache entry help string
Static libraries are created by an archiver, not a linker.
2025-06-02 10:26:27 -04:00
Brad King
53aab8acd6 Tests: Generalize test name RunCMake.MSVC{Warning => Default}Flags
Prepare to add cases for other kinds of flags.
2025-06-02 10:26:27 -04:00
Brad King
e3b7a00af1 Merge topic 'patch-GNUInstallDirs'
535734ee16 GNUInstallDirs: Update documentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10846
2025-06-02 09:45:11 -04:00
Brad King
81bcc806d3 Merge topic 'allow-assigning-argument-helpers'
5eec48ee40 cmArgumentParser: Simplify assignment of marker types

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10845
2025-06-02 09:18:38 -04:00
Brad King
91cdfe6676 Merge topic 'linker-launcher'
cdf2a36f48 HIP: Add support for [CMAKE_]HIP_LINKER_LAUNCHER
77312cc636 CUDA: Add support for [CMAKE_]CUDA_LINKER_LAUNCHER

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10847
2025-06-02 09:02:46 -04:00
Brad King
457bb06f51 Merge topic 'test-tutorial'
2d712a760e Tests: Convert Tutorial tests to RunCMake infrastructure

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10843
2025-06-02 09:01:01 -04:00
Kitware Robot
45670ce4de CMake Nightly Date Stamp 2025-06-02 00:07:13 -04:00
Peter Kokot
d8b8183425 FindGTest: Deprecate result variables and update documentation
This updates the module documentation and deprecates some result
variables in favor of using imported targets.

Changes:
- Synced module documentation with other similar find modules.
- Reworded and updated descriptions.
- Renamed "Cache Variables" to "Hints".
- Added info about config mode.
- Added separate section "Deprecated Items".
- Mention of Threads::Threads imported target removed.
2025-06-02 08:01:19 +10:00
Kitware Robot
14ba99b5d5 CMake Nightly Date Stamp 2025-06-01 00:04:21 -04:00
Kitware Robot
747f4713dd CMake Nightly Date Stamp 2025-05-31 00:04:34 -04:00
Matthew Woehlke
5eec48ee40 cmArgumentParser: Simplify assignment of marker types
Explicitly allow argument markers to be assigned. Make use of this in
parsing. This simplifies working with these types, by allowing them to
be assigned from the underlying types using simple `a = b` syntax,
rather than requiring gymnastics to access the underlying assignment
operations. It also makes assignment more consistent with
initialization.
2025-05-30 11:10:41 -04:00
Maximilian Sander
cdf2a36f48 HIP: Add support for [CMAKE_]HIP_LINKER_LAUNCHER
`CMAKE_<LANG>_LINKER_LAUNCHER` and `<LANG>_LINKER_LAUNCHER` are
already support for C, CXX, CUDA, OBJC, OBJCXX, and Fortran.  Add HIP.

Closes: #26967
2025-05-30 10:05:46 -04:00
Maximilian Sander
77312cc636 CUDA: Add support for [CMAKE_]CUDA_LINKER_LAUNCHER
`CMAKE_<LANG>_LINKER_LAUNCHER` and `<LANG>_LINKER_LAUNCHER` are
already support for C, CXX, OBJC, OBJCXX, and Fortran.  Add CUDA.

Issue: #26967
2025-05-30 10:00:18 -04:00
Brad King
2d712a760e Tests: Convert Tutorial tests to RunCMake infrastructure
RunCMake matches output more robustly than `PASS_REGULAR_EXPRESSION`,
and provides more details on failure.
2025-05-30 09:54:39 -04:00
Brad King
26460454b7 Merge topic 'patch-CheckCompilerFlag'
ac67631b02 Check{,C,CXX,Fortran,OBJC,OBJCXX}CompilerFlag: Update documentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10840
2025-05-30 09:35:17 -04:00
Brad King
9165675464 Merge topic 'patch-CSharpUtilities'
0d74966cd9 CSharpUtilities: Update documentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10841
2025-05-30 09:33:21 -04:00
Brad King
5273ffdfa5 Merge topic 'astgrep-rm-cmdbg-usage'
43fbd92991 Utilities/ast-grep: add rules to remove `CM_DBG` usage

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10839
2025-05-30 09:24:21 -04:00
Kitware Robot
ab5866c2d2 CMake Nightly Date Stamp 2025-05-30 00:04:41 -04:00
Peter Kokot
535734ee16 GNUInstallDirs: Update documentation
- Added intro code block showing how to include this module.
- Reworded module introduction.
- Used "command" instead of "function".
- Reworded command arguments and descriptions.
- Added the "See Also" section.
2025-05-30 02:35:45 +02:00
Brad King
a385cafc59 Merge topic 'renesas-compiler'
514135f563 Renesas: Add support for Renesas compilers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10669
2025-05-29 13:13:08 -04:00
Brad King
c3b2e5b444 Merge topic 'fix-project-COMPAT_VERSION'
09701440d9 project: Fix handling of COMPAT_VERSION

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10838
2025-05-29 10:13:11 -04:00
Brad King
1c8fa92921 Merge topic 'windows-module-def-per-lang'
8b710d8264 Linker: Generate per-language module -DEF: flags on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Markus Mützel <markus.muetzel@gmx.de>
Merge-request: !10836
2025-05-29 10:11:13 -04:00
Brad King
f2239ecff7 Merge topic 'ci-linkcheck'
3fdd1a1d13 Autogen: Replace documentation links with their permanent redirects

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10835
2025-05-29 10:09:11 -04:00
Brad King
975b78d0eb Merge topic 'remove-CMakeDetermineVSServicePack'
39da33ae81 CMakeDetermineVSServicePack: Add policy to remove this module

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10834
2025-05-29 10:07:44 -04:00
Kitware Robot
df894a11b3 CMake Nightly Date Stamp 2025-05-29 00:04:53 -04:00
Peter Kokot
0d74966cd9 CSharpUtilities: Update documentation
- Added intro code block showing how to include this module.
- Used "commands" instead of "functions".
- Reworded command descriptions.
- Synced style or command arguments.
2025-05-29 01:46:34 +02:00
Peter Kokot
ac67631b02 Check{,C,CXX,Fortran,OBJC,OBJCXX}CompilerFlag: Update documentation
- Added intro code blocks showing how to include these modules.
- Used word "command" instead of "macro".
- Added examples sections.
- Updated and synced descriptions of commands and arguments.
- Added a rubric title for variables that affect the checks.
- Listed CMAKE_TRY_COMPILE_TARGET_TYPE variable in the rubric together
  with CMAKE_REQUIRED_* variables.
- Added link to CheckCompilerFlag module in the target_compile_options()
  docs.
- Used lowercase style for check_fortran_compiler_flag() command.
- Added a link to `$<COMPILE_LANGUAGE:languages>` generator expression
  so it can be linked from other pages (See commit
  2e37a20f02 for more info on the initial
  style used).
- Fixed the GENEX_NOTE inclusion (starting with line after the 2nd line)
  where part of the sentence was rendered in the output.
2025-05-29 00:16:39 +02:00
Ben Boeckel
43fbd92991 Utilities/ast-grep: add rules to remove CM_DBG usage
An easy way to detect and remove debugging left over from development.
The rules are disabled by default so that LSP usage doesn't interfere
when they are wanted.

To actually use the rules, severity flags are necessary:

    ast-grep scan --error=rm-cmdbg-includes --error=rm-cmdbg-macros

This command will report on instances; passing `-U` as well will update
the source.

Tests are also not run by default; see
https://github.com/ast-grep/ast-grep/issues/2023 to track its progress.
2025-05-29 00:03:20 +02:00
Matthew Woehlke
09701440d9 project: Fix handling of COMPAT_VERSION
In cmProjectCommand, after validating the VERSION, we move it into a
local variable. Later, however, we were comparing COMPAT_VERSION against
the VERSION stored in the arguments. Compare to the local variable
instead.
2025-05-28 14:28:51 -04:00
Brad King
8b710d8264 Linker: Generate per-language module -DEF: flags on Windows
With IntelLLVM on Windows, we link using the compiler driver.
With MSVC on Windows, we invoke the linker directly.  If we
use both in a single build tree, for separate languages,
the value of `CMAKE_LINK_DEF_FILE_FLAG` conflicts.  Add a
per-language `CMAKE_<LANG>_LINK_DEF_FILE_FLAG` variable to
avoid the conflict.  Preserve the language-agnostic variable
for compatibility with projects that reference it.

Fixes: #26005
2025-05-28 13:48:26 -04:00