Commit Graph
9456 Commits
Author SHA1 Message Date
Brad King ffe0edc092 Merge topic 'list-predicate'
15340d6a96 list(FILTER): Add PREDICATE mode
c7af6e94d8 list(TRANSFORM): Add PREDICATE selector
0f30e0fe1c Help: Fix indentation of list(FILTER) docs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11945
2026-05-05 10:58:32 -04:00
Brad King bf3a43e4ad Merge topic 'JOB_POOL_COMPILE-FileSet-property'
8e6eec8125 FILE_SET: add JOB_POOL_COMPILE property support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12005
2026-05-05 10:55:51 -04:00
Brad King 885b588502 Merge topic 'SKIP_LINTING-FileSet-property'
f18ba89862 FILE_SET: add SKIP_LINTING property support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12004
2026-05-05 10:54:37 -04:00
Brad King 0daa41a8fd Merge topic 'presets-error-diagnostics'
654a195d8b presets: Improve error diagnostics
c6e81bf30e Help/presets: Disallow empty env keys in build presets also

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: scivision <michael@scivision.dev>
Merge-request: !11987
2026-05-05 10:50:28 -04:00
Brad King 1c4ef7291f Merge topic 'cmake-diagnostics-doc'
95f7f84609 Help: Fix CMD_INSTALL_ABSOLUTE_DESTINATION documentation
a882ec84ec cmDocumentation: Add diagnostics
97d13c3053 Help: Improve diagnostics documentation
3cccce8ca2 Help: Add developer documentation for new diagnostics
ffe4c2a8ff Help: Fix developer documentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robertjmaynard@gmail.com>
Merge-request: !11996
2026-05-04 10:32:28 -04:00
Brad King 871c7bcec2 Merge topic 'ctest-llvm-cov'
a7780d1b9c ctest: Add a `CoverageTool` setting to enable integration with `llvm-cov`
870d7d7cbe ctest: Introduce CTestDirectory

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11891
2026-05-04 10:21:12 -04:00
Marc Chevrier 8e6eec8125 FILE_SET: add JOB_POOL_COMPILE property support 2026-05-04 11:10:01 +02:00
Marc Chevrier f18ba89862 FILE_SET: add SKIP_LINTING property support 2026-05-04 10:16:06 +02:00
Mickaël Germain 15340d6a96 list(FILTER): Add PREDICATE mode 2026-05-01 18:55:07 -07:00
Mickaël Germain c7af6e94d8 list(TRANSFORM): Add PREDICATE selector
Add a new `PREDICATE` selector to `list(TRANSFORM)` that uses a
user-defined function or macro to decide which elements to transform.

The predicate callable receives each element value and an output
variable name.  It must set the output variable to a truthy or falsy
value in PARENT_SCOPE; only elements for which the predicate returns
true are passed to the transform action.

Adds a shared PredicateEvaluator helper class used by both TRANSFORM
PREDICATE and (in a subsequent commit) FILTER PREDICATE.

Includes parser wiring, error and success tests covering all existing
actions (TOUPPER, TOLOWER, REPLACE, STRIP, GENEX_STRIP, APPEND,
PREPEND, APPLY) combined with the PREDICATE selector.

Issue: #27761
2026-05-01 18:54:53 -07:00
Tyler Yankee c6e81bf30e Help/presets: Disallow empty env keys in build presets also
Build presets have a non-standard environment variable definition in
the schema yaml since they need extra Sphinx content. However, it was
missing the rule to disallow empty keys that the base environment
variable definition has.
2026-05-01 13:18:41 -04:00
Matthew Woehlke 95f7f84609 Help: Fix CMD_INSTALL_ABSOLUTE_DESTINATION documentation
CMD_INSTALL_ABSOLUTE_DESTINATION is a child of CMD_AUTHOR, but this was
not noted in the documentation. Add the missing annotation.
2026-05-01 13:00:10 -04:00
Brad King 0f30e0fe1c Help: Fix indentation of list(FILTER) docs 2026-05-01 09:47:12 -04:00
Brad King 096a676d13 Merge topic 'presets-file-arg'
95edd93948 presets: Support loading from arbitrary file
81c22a67b6 presets: Factor out command line arguments
e75b62fd73 presets: Convert allowNoFiles to enum class
8476469b72 Help: Add cmake-workflow-option role
5e76987626 Help/presets: Use preset role for configurePreset references
2d8e8213d4 Help/presets: Improve include field formatting
43f5fc8ac8 Help, Tests: Consolidate presets terminology and references
c49ebb67da Help: Use POSIX slashes for 'generated by' in presets files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11886
2026-05-01 09:22:20 -04:00
Matthew Woehlke 97d13c3053 Help: Improve diagnostics documentation
Make diagnostics into Sphinx objects so that they can be more readily
cross-referenced. (This is also needed to enable --help-diagnostic.)
Update various places that can make use of the same. Significantly
expand the documentation on controlling diagnostics.
2026-04-30 15:36:23 -04:00
Matthew Woehlke 3cccce8ca2 Help: Add developer documentation for new diagnostics
Add a developer-targeted document explaining the basics of how to use
CMake 4.4's new diagnostic framework.
2026-04-30 15:36:23 -04:00
Joseph Snyder a7780d1b9c ctest: Add a CoverageTool setting to enable integration with llvm-cov
Add a `CTEST_TEST_COVERAGE_TOOL` variable to tell CTest to integrate
with `llvm-cov` source-based code coverage by setting the
`LLVM_PROFILE_FILE` environment variable for each test.

Issue: #26932
2026-04-30 14:22:26 -04:00
Matthew Woehlke ffe4c2a8ff Help: Fix developer documentation
HTML is not normally generated for developer documentation. As a result,
the validity of the reST is effectively never checked, and thus contains
a small handful of issues (mostly bad indent). Fix these.
2026-04-30 14:19:54 -04:00
Brad King a979d8eb3d Merge topic 'error_on_absolute_install_paths'
39a56136a3 Diagnostic: Add warn or error on absolute install paths
fd76089631 cmInstallFileSetGenerator: Only support per config Destination.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11882
2026-04-30 09:17:13 -04:00
Tyler Yankee 95edd93948 presets: Support loading from arbitrary file
Allow CMake, CTest, and CPack to read presets from a path given by
command-line argument instead of always requiring `CMakePresets.json`
or `CMakeUserPresets.json` in the source tree. This makes the presets
feature more extensible to cases in which the user doesn't have access
to the presets defined in the source tree (e.g., if the source tree is
not writable).

For now, there is no equivalent implementation of such an option in the
`cmake-gui`, nor for the recent presets functionality implemented in
`ctest_configure` and `ctest_build`.

Fixes: #27329
2026-04-30 08:04:26 -04:00
Tyler Yankee 5e76987626 Help/presets: Use preset role for configurePreset references 2026-04-30 07:49:41 -04:00
Tyler Yankee 2d8e8213d4 Help/presets: Improve include field formatting
Note the presets version which added it, and use the new `preset`
role when referencing it from other sections.
2026-04-30 07:49:40 -04:00
Tyler Yankee 43f5fc8ac8 Help, Tests: Consolidate presets terminology and references
References to `CMake[User]Presets.json` should correspond to behavior
pertaining to those files in particular, while references to presets
files generally should be disambiguated from that.

Re-spell "preset file" to "presets file" where applicable.

Make a few references to `cmake-presets(7)` more consistent.

Issue: #27329
2026-04-30 07:49:40 -04:00
Marc Chevrier 5f63b3c6b1 Remove MACROS directory property
It did not always contain all macros.
We have `if(COMMAND)` now instead.

Add policy CMP0217 for compatibility.

Fixes: #27765
2026-04-29 16:43:04 +02:00
Brad King 33d4082c8b Merge topic 'swift-module-name-hyphen'
933c59ffde Swift: Replace hyphens with underscores in default module name

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11986
2026-04-29 10:28:34 -04:00
Brad King ca3e513eb5 Merge topic 'swift-package-name'
118ab41984 Swift: Build with a package name by default
94faee3099 Swift: Add option to pass package name to swiftc invocation
635f71737c Swift: Factor out Swift-specific target flags

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11981
2026-04-29 10:26:01 -04:00
Brad King 7d3d5df5e7 Merge topic 'findcudatoolkit-sanitizer-api'
35747cb5e0 FindCUDAToolkit: Add sanitizer support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11968
2026-04-29 10:23:32 -04:00
Robert Maynard 39a56136a3 Diagnostic: Add warn or error on absolute install paths
Add `-Winstall-absolute-destination` diagnostic to warn or
error when an install command has an absolute destination.

This allow projects to enforce the best practice of not allowing
absolute install DESTINATIONS.
2026-04-29 09:22:29 -04:00
Evan Wilde 118ab41984 Swift: Build with a package name by default
Add policy CMP0216 to enable use of the `PROJECT_NAME` as the default
package name for Swift.

Issue: #26886
2026-04-28 15:30:44 -04:00
Evan Wilde 94faee3099 Swift: Add option to pass package name to swiftc invocation
Add a `Swift_PACKAGE_NAME` target property to specify the package name.

Fixes: #26886
2026-04-28 15:24:05 -04:00
Kyle Edwards 35747cb5e0 FindCUDAToolkit: Add sanitizer support 2026-04-28 10:13:20 -04:00
Roman Lavrov 933c59ffde Swift: Replace hyphens with underscores in default module name
GetSwiftModuleName() returns the target name verbatim when
Swift_MODULE_NAME is not set, but hyphens are not valid in Swift
module identifiers.  Replace them with underscores so that targets
like swift-syntax get module name swift_syntax automatically.

Issue: #27748
2026-04-27 19:21:29 -04:00
Zack Galbreath 348ff1938b ctest_build: add PRESET option
Allow users to specify a build preset when using CTest dashboard scripts.

Issue: #27630
2026-04-27 17:15:11 -04:00
Brad King 7a1e3d2800 Merge topic 'doc-CPACK_COMMAND_SYNC'
69ff535b54 Help: Document CPACK_COMMAND_SYNC variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11976
2026-04-27 11:23:41 -04:00
Andrey Filipenkov 69ff535b54 Help: Document CPACK_COMMAND_SYNC variable
It was added by commit ef739edd20 (CPack/DragNDrop: Prevent hdiutil
"resource is busy" failures, 2025-08-15, v4.2.0-rc1~315^2).
2026-04-27 10:52:55 -04:00
Brad King 89443e99d6 Merge topic 'vs-deploy-utility-fix'
6c0b499dab VS: Honor `VS_SOLUTION_DEPLOY` on targets created by add_custom_target

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11970
2026-04-27 09:49:27 -04:00
Roman Lavrov b6367f723b Swift/Ninja: Emit modules separately from compilation
Add policy CMP0215 to emit `.swiftmodule` from a dedicated `-emit-module`
build edge for importable Swift targets in the Ninja generator.
Downstream targets can begin compiling as soon as the module interface
is ready, overlapping with upstream object compilation and linking.

When CMP0215 is NEW and CMP0157 is NEW, separate module emission is
enabled by default.  The `Swift_SEPARATE_MODULE_EMISSION` target
property (initialized by the `CMAKE_Swift_SEPARATE_MODULE_EMISSION`
variable) can override this per target.

The compile edge still passes `-emit-module` so that swiftc continues
to produce `.swiftdoc`; only the `.swiftmodule` output moves to the new
edge.

Also fix swiftmodule dependency edges in cmNinjaNormalTargetGenerator
to use IsLanguageUsed instead of GetLinkerLanguage, so C/C++ targets
whose linker language propagated to Swift do not produce spurious
implicit dependencies.

Closes: #27748
2026-04-24 15:58:18 -04:00
Maykol Irigoyen 6c0b499dab VS: Honor VS_SOLUTION_DEPLOY on targets created by add_custom_target
Fixes: #27772
2026-04-24 12:10:40 -04:00
Brad King 811bf8fb89 Merge topic 'LINKER_TYPE-wild'
e96c5ba13d Add the support of the wild linker

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11966
2026-04-24 09:16:32 -04:00
Brad King ad5c6f5beb Merge topic 'cmake_build_preset_dir'
021cf4f4f7 cmake --build --preset: Relax CWD constraint

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: Robert Maynard <robertjmaynard@gmail.com>
Merge-request: !11962
2026-04-24 09:11:42 -04:00
Brad King e9e23c512e Merge topic 'list-transform-apply-only'
651f82642c Add APPLY action for list(TRANSFORM)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Alex Turbov <i.zaufi@gmail.com>
Merge-request: !11926
2026-04-24 09:03:50 -04:00
Marc Chevrier e96c5ba13d Add the support of the wild linker
Fixes: #27755
2026-04-23 16:21:30 +02:00
Zack Galbreath 021cf4f4f7 cmake --build --preset: Relax CWD constraint
Prior to this commit, cmake --build <dir> --preset <pre> needed to be called
from the source directory. We now look up the source directory in
CMakeCache.txt when a build directory is specified on the command line.

Issue: #27075
2026-04-23 09:23:01 -04:00
Mickaël Germain 651f82642c Add APPLY action for list(TRANSFORM)
Add a new APPLY action to list(TRANSFORM) that invokes a user-defined
function or macro for each element of the list, enabling arbitrary
per-element transformations.

The callable receives the current element value and an output variable
name, and must set the output variable in PARENT_SCOPE to the
transformed value.

Includes documentation, release notes, and tests for both function
and macro callables, OUTPUT_VARIABLE, error cases, and selector
combinations (AT, FOR, REGEX).
Refs: #27761
2026-04-22 19:04:12 -07:00
Brad KingandSerguei E. Leontiev a95fae2d36 PellesC: Add support for ASM_POASM language assembler
The Pelles C compiler does not support ASM, and the `poasm` assembler
uses a distinct syntax.  Add a dedicated language as we do for similar
cases from other vendors.  Leave documentation commented out for now
because the PellesC toolchain support in general is not yet documented.

Fixes: #27758
Issue: #21536
Co-authored-by: Serguei E. Leontiev <leo@sai.msu.ru>
2026-04-22 14:42:00 -04:00
Brad King b0bf7182f4 Help: Format list of supported languages as a definition list
This gives a natural place to put `versionadded` directives
and notes about specific languages.
2026-04-22 14:35:04 -04:00
Brad King b1193d4693 Merge topic 'FindPython-PEP803'
985dba8084 FindPython: Add support of Stable ABI for Free-Threaded python

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Henry Schreiner <henryschreineriii@gmail.com>
Merge-request: !11955
2026-04-22 11:03:08 -04:00
Brad King cf11d9f349 Merge topic 'json-partial-equals'
b14da400de string(JSON): Add PARTIAL_EQUAL for subset style JSON comparisons

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11725
2026-04-22 09:17:19 -04:00
Marc Chevrier 985dba8084 FindPython: Add support of Stable ABI for Free-Threaded python
Add the support of PEP803.

Fixes: #27736
2026-04-21 23:13:00 +02:00
Brad King 56921fa912 Merge branch 'release-4.3' 2026-04-21 09:50:31 -04:00