Commit Graph
3246 Commits
Author SHA1 Message Date
Daniele E. Domenichelli 9bd3346655 CMakePackageConfigHelpers: add more version compatibility modes
Add `SamePatchVersion`, `SameFullVersion`, and `SemanticVersion`
support.

Document `ExactVersion` as deprecated in favor of the clearer
`SamePatchVersion`/`SameFullVersion` names.

Closes: #18060
2026-05-15 13:51:11 -04:00
Brad King 08e5ffbeac Merge topic 'fileset-SKIP_UNITY_BUILD_INCLUSION'
5f7a7aa263 FILE_SET: add SKIP_UNITY_BUILD_INCLUSION property support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12040
2026-05-15 10:18:03 -04:00
Marc Chevrier 5f7a7aa263 FILE_SET: add SKIP_UNITY_BUILD_INCLUSION property support 2026-05-14 10:55:35 -04:00
Brad King 84a843cfb6 Merge topic 'file-api-many-file-sets'
9f4cf1cef7 fileAPI: Report full backtraces for sources in multiple file sets
3d249d2aa9 fileAPI: Support files added to multiple file sets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12009
2026-05-14 10:40:22 -04:00
Brad King 08bf1b6985 Merge topic 'ctest_commands_presets_file'
08dc82ceb3 ctest: add PRESETS_FILE option to CTest commands

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12042
2026-05-14 08:53:25 -04:00
Brad King 011fc8be63 Merge topic 'feature/list-functor-no-macro'
96c9a9c67d list: Reject macros as APPLY/PREDICATE/COMPARATOR arguments
08288eb14a list: Extract RequireFunction helper for command validation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11997
2026-05-14 08:45:19 -04:00
Brad King d7257109e7 Merge topic 'ctest-update-version-options'
585e0d5878 ctest_update: Add options VERSION_ONLY and VERSION_OVERRIDE

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12038
2026-05-13 13:28:21 -04:00
Tyler Yankee 9f4cf1cef7 fileAPI: Report full backtraces for sources in multiple file sets
Previously, if a single source file was added to multiple file sets via
multiple `target_sources` calls, only the first call originally adding
it to the target was stored in the backtrace graph and referenced by
index in the singular "backtrace" field.

Add a "backtraces" field expanding this to cover all command
invocations which associate the given source file with that target.
Preserve the original "backtrace" field for compatibility. Update
spellings in the test suite to check against both fields.

Issue: #27035
2026-05-12 16:45:13 -04:00
Tyler Yankee 3d249d2aa9 fileAPI: Support files added to multiple file sets
The `fileSetIndex` field of target sources replies is incomplete, as a
single source file can be added to arbitrarily many file sets. Add a
`fileSetIndexes` field to report all file sets to which a source
belongs, and preserve `fileSetIndex` for compatibility as the index of
the most recent addition.

Tweak the test suite to use the plural spelling only in expected JSON
snippets and verify that the singular `fileSetIndex` is always the last
element of the new list. (Note that remaining occurrences of the
singular spelling correspond to "installers" objects, which is entirely
different.)

Fixes: #27035
2026-05-12 16:45:12 -04:00
Zack Galbreath 08dc82ceb3 ctest: add PRESETS_FILE option to CTest commands
Allow CTest script authors to use presets from arbitrary files.
2026-05-12 15:49:39 -04:00
Mickaël Germain 96c9a9c67d list: Reject macros as APPLY/PREDICATE/COMPARATOR arguments
Fixes: #27781
2026-05-12 12:30:43 -07:00
Brad King 47b80d2a8a Merge topic 'cmake-diagnostics-relnotes'
629badc0c8 Diagnostics: Add release notes

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12032
2026-05-12 10:39:29 -04:00
Daniel Pfeifer 585e0d5878 ctest_update: Add options VERSION_ONLY and VERSION_OVERRIDE 2026-05-12 13:45:00 +02:00
Matthew Woehlke 629badc0c8 Diagnostics: Add release notes 2026-05-11 14:07:28 -04:00
Brad King 3b24c78ed9 Merge topic 'ctest_test_preset_option'
ef0d2ca6bb ctest: add PRESET option for ctest_test() and ctest_memcheck()
f9c831dad9 ctest: encapsulate loading of options from test preset

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12017
2026-05-11 11:12:42 -04:00
Zack Galbreath ef0d2ca6bb ctest: add PRESET option for ctest_test() and ctest_memcheck()
Allow users to specify a test preset when using CTest dashboard scripts.

Fixes #27630
2026-05-07 22:08:41 -04:00
Mickaël Germain 3dc32ac62b list(SORT): Add COMPARATOR option for user-defined comparisons
Allow users to provide a custom comparison function for `list(SORT)`.
The comparator is validated for strict weak ordering at runtime to
produce a clear CMake error rather than a platform-dependent abort.

Closes: #27761
2026-05-06 15:09:06 -04:00
Brad King bfeef792bb Merge topic 'openwatcom-linker-id'
2e549c1df4 CMakeDetermineLinkerId: support the OpenWatcom linker ID

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12012
2026-05-06 10:21:23 -04:00
56b3136f60 fileapi: Add build properties for SOURCES file set type to codemodel
This complements commit 5c5b68f44e (FILE_SET: Add support for the
SOURCES type, 2026-03-12).

Co-Authored-By: Brad King <brad.king@kitware.com>
Co-Authored-By: Tyler Yankee <tyler.yankee@kitware.com>
2026-05-05 19:57:54 -04:00
Ben Boeckel 2e549c1df4 CMakeDetermineLinkerId: support the OpenWatcom linker ID 2026-05-05 12:24:59 -04:00
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 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
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
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
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 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 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