Commit Graph
9372 Commits
Author SHA1 Message Date
Brad King 111454d8e0 Merge topic 'cmake-diagnostics-state'
99318e49b9 Help: Mention when diagnostics were added
daec98ba61 Diagnostics: Fix passing diagnostic state to try_compile
e0b0ac4295 Diagnostics: Overhaul warnings in cmake-gui
ca5d569524 Diagnostics: Switch state to new system
618c074a8c Diagnostics: Use categories for presets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !11855
2026-04-15 10:29:06 -04:00
Brad King f9170481f1 Merge topic 'cpack-nsis-ignore-components-page'
8046ceadf3 CPack/NSIS: Add option to not display component selection page

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11927
2026-04-15 09:40:25 -04:00
Matthew Woehlke 99318e49b9 Help: Mention when diagnostics were added 2026-04-14 12:42:33 -04:00
Matthew Woehlke ca5d569524 Diagnostics: Switch state to new system
Add an additional state to the cmake instance to track diagnostics. Use
this to initialize any new/reset states we create so that other contexts
will inherit the diagnostic state from presets / command-line options.
Modify the front-end to map presets and -W command-line options to
manipulation of this new diagnostic state. Remove old members for
storing diagnostic state. Rework how diagnostic state is persisted.
Deprecate old, non-standard spellings for manipulating diagnostics.
Deprecate old 'dev' spelling for CMD_AUTHOR.

Note that this is a work in progress. Messaging has not yet been
updated, so the new state is not yet being used to control diagnostics,
and some of the logic to update the old state has been stripped (and
will eventually be removed entirely). Backward compatibility support for
the deprecated CMAKE_{WARN,ERROR}_DEPRECATED variables is only partially
implemented. The GUI's interface for manipulating warnings is partially
broken and needs to be overhauled. These tasks are being done in
separate commits in order to minimize review burden and keep the changes
per commit / per merge request more manageable.
2026-04-14 12:42:33 -04:00
Brad King d5103f3e80 Merge topic 'FILE_SET-target-is-framework'
2dda1f21ab FILE_SET: enhance FRAMEWORK compatibility checks

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !11929
2026-04-14 10:30:33 -04:00
Chris Mocock 8046ceadf3 CPack/NSIS: Add option to not display component selection page
Fixes: #27754
2026-04-14 15:16:01 +01:00
Brad King 0afca0c1e0 Merge topic 'CPACK_RPM_SPEC_MORE_DEFINE-list2string'
30aa150c25 CPack/RPM: `CPACK_RPM_SPEC_MORE_DEFINE` could be a list

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11899
2026-04-14 09:53:55 -04:00
Brad King 645f239dec Merge topic 'doc-ctest-steps'
cec6248a94 Help/ctest_*: Improve documentation around the edges

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11928
2026-04-14 09:47:39 -04:00
Tyler Yankee cec6248a94 Help/ctest_*: Improve documentation around the edges
Improve standardization and cross-references. This doesn't make any
substantial changes to the existing prose.
2026-04-13 14:32:01 -04:00
Marc Chevrier 2dda1f21ab FILE_SET: enhance FRAMEWORK compatibility checks
The SOURCES file set type is compatible with the FRAMEWORK target.
Add check at generation time.

Fixes: #27705
2026-04-13 17:55:36 +02:00
Brad King e012f62599 Merge topic 'FILE_SET-INDEPENDENT_FILES'
bc7d8bd26f FILE_SET: Add INDEPENDENT_FILES property for Ninja order dependency control

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11904
2026-04-13 11:03:06 -04:00
Brad King 8cd4e1576c Merge topic 'instrumentation-index-lock'
0c2fcaec5d instrumentation: Avoid duplicate entries on concurrent indexing

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11912
2026-04-13 10:55:40 -04:00
Matthew Woehlke 618c074a8c Diagnostics: Use categories for presets
Modify diagnostics to track which preset schema version corresponds to
the introduction of each diagnostic. Modify how we parse presets to use
the set of diagnostics to generate bindings, and to store diagnostics as
maps rather than as fixed members. Enforce that only diagnostics known
to the specified preset version are present.

This is a first and necessary step toward moving CMake's internals over
to flexible categories rather than each category having its own bespoke
variables and member functions.

Note that the presets documentation currently contains some broken
links, as it is anticipating further documentation updates that will
happen in a future commit.
2026-04-13 10:41:18 -04:00
Marc Chevrier bc7d8bd26f FILE_SET: Add INDEPENDENT_FILES property for Ninja order dependency control
Fixes: #25370
2026-04-12 15:00:03 +02:00
Alex Turbov 30aa150c25 CPack/RPM: CPACK_RPM_SPEC_MORE_DEFINE could be a list
Signed-off-by: Alex Turbov <i.zaufi@gmail.com>
2026-04-12 05:54:58 +04:00
Trung Nguyen 9a342eb39b Haiku: Add support for RESCAN
Haiku also uses the GNU toolchain and therefore should support this
feature.
2026-04-11 06:04:50 +10:00
Martin Duffy 0c2fcaec5d instrumentation: Avoid duplicate entries on concurrent indexing
When indexing occurs twice at exactly the same time, there was a possibility
for snippets to show up in more than one index file, and therefore to be
removed by one indexing process while another indexing process ran a user
callback which needed to read the file.

Add a file locking mechanism around indexing to prevent it from happening
concurrently within a project build tree.

Fixes: #27741
2026-04-10 14:06:38 -04:00
Brad King 95a07e2fc6 Merge topic 'rework-presets-docs'
46ede9b46d Help: Add `preset` role
f26e9fcbae Help: Generate presets JSON schema, documentation
b96826bc08 Help: Improve abbreviated command-line option roles

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11884
2026-04-10 11:54:14 -04:00
Brad King 9ec879524a Merge topic 'doc-lang-link-flags'
c8b6725977 Help: Mention CMAKE_<LANG>_LINK_FLAGS where relevant

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11905
2026-04-10 11:33:46 -04:00
Matthew Woehlke 46ede9b46d Help: Add preset role
Add a new CMake domain role for referencing fields in CMake presets.
This has two main purposes. First, it replaces generic references (which
were excessively long and required explicit titles) and acts as an
improved version of the `ref` role by allowing the always-present
`CMakePresets.` prefix to be elided. Second, unlike generic references
which silently degrade to broken links that are only caught by
`linkcheck`, broken references are flagged immediately in regular Sphinx
builds. Therefore, this both improves presentation by bringing line
lengths back under control, and reduces errors by making bad references
immediately detectable.

There is also a small change in rendering, as field references are now
rendered as literals. This is consistent with how fields are mentioned
in prose when they are not linked.
2026-04-08 12:14:41 -04:00
Matthew Woehlke f26e9fcbae Help: Generate presets JSON schema, documentation
Replace the CMake presets schema.json with a YAML document, from which
both the JSON schema and (most of) the reST documentation are generated.
This achieves three main goals. First, the YAML document is much closer
to being human-readable than the JSON schema. Second, the JSON and reST
prose (when the latter differs) are contained in the same file, in most
cases adjacent (and at worst, still nearby) rather than in separate
files, which should greatly facilitate keeping the two in sync. Third,
changes are monumentally easier, as changes merely need to annotate the
version(s) to which variants apply, rather than creating entirely
separate schema trees for each variant.

Since requiring Python as part of the build process is not desired,
the outputs are kept in the source repository. This is consistent with
other areas which are seldom updated and require special tools, such as
the lexer.

While this does not represent any functional change for users, some
grammatical edits and other such editorial improvements have been made
in the process of transferring everything to the new YAML. However,
these are mainly incidental rather than representative of an attempt at
a thorough editorial pass.

Finally, for clarity, monkey-patch `sphing.domains.changesets` and add
additional 'version modified' directives with slightly tweaked text to
identify changes to the presets schema. These are nearly identical to
the built-in directives, but use the text 'in presets version N' rather
than 'in version N[.N]'.
2026-04-08 10:45:21 -04:00
Tyler Yankee c8b6725977 Help: Mention CMAKE_<LANG>_LINK_FLAGS where relevant
Also, correct the documentation added in commit 98f9874703 (cmake:
Add per-language link flags for all target types, 2025-12-17) by
placing the variables in the proper section of cmake-variables(7).

Issue: #21934
2026-04-07 10:14:28 -04:00
Brad King b73e1508ec Merge topic 'FILE_SET-CXX_SCAN_FOR_MODULES'
df0a2aca6d FILE_SET: Add CXX_SCAN_FOR_MODULES property for per-file-set scanning control

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !11890
2026-04-04 15:36:19 -04:00
Brad King bff90ab59e Merge topic 'doc-if'
6ff2057b93 Help/if: Improve formatting

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11895
2026-04-04 15:34:08 -04:00
Tyler Yankee 6ff2057b93 Help/if: Improve formatting
Consolidate the description of precedence during evaluation. Use xrefs
to improve syntax highlighting. Remove an outdated `versionadded`
directive for CMake 2.6.
2026-04-03 09:36:04 -04:00
Marc Chevrier df0a2aca6d FILE_SET: Add CXX_SCAN_FOR_MODULES property for per-file-set scanning control
This is more specific than both the target property and the
directory-wide source file property of the same name.
2026-04-03 09:29:29 -04:00
Brad King 1efc5daef9 Merge topic 'doc-instrumentation-google-trace'
e056f53500 Help: Fix path to Google Trace File in cmake-instrumentation(7)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11892
2026-04-02 18:00:53 -04:00
Brad King e056f53500 Help: Fix path to Google Trace File in cmake-instrumentation(7)
Fix commit b8d8faf900 (Help/instrumentation: Improve CMake
Instrumentation documentation, 2026-03-24, v4.3.1~4^2).

Fixes: #27734
2026-04-02 13:09:37 -04:00
Brad King ad50d3e3d8 Merge topic 'short-cmake-option-refs'
3d82ccbe0d Help: Add roles to abbreviate command-line options

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11883
2026-04-01 13:41:12 -04:00
Brad King 5e57306864 Merge topic 'FILE_SET-SOURCES'
c386aaebf8 FILE_SET: install and export SOURCES file set type
5c5b68f44e FILE_SET: Add support for the SOURCES type
5697bcced0 BT<> and cmLocalGenerator: Add helpers functions
42ca2a2062 cmEvaluatedTargetProperty: put declarations in namespace cm

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11863
2026-04-01 13:39:12 -04:00
Brad King e8f5af42b5 Merge topic 'help-testdir'
67c84ef103 Help: Indicate that `ctest --test-dir` may be specified with a preset
02e9335d9c Help: Document that `cmake --preset` supports `-B` to override the build dir
c288ecddb2 Help: Revise versioning note for `cmake --build` with both dir and preset

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11880
2026-04-01 13:36:06 -04:00
Matthew Woehlke 3d82ccbe0d Help: Add roles to abbreviate command-line options
Add a handful of helper roles that allow many more command-line option
references to be written without explicit targets. Specifically, what
used to be written ':option:`--foo[=bar] <program --foo>` can now be
written ':program-option:`--foo`'. This allows many such references to
be significantly shortened.

For now, supported programs are 'cmake', 'cpack'. 'ctest',
'cmake--build' and 'cmake--install', which should cover most cases, but
more can be trivially added. Additionally, this does not make a
concerted effort to replace all existing uses, as it is intended mainly
for use in future updates.
2026-03-31 12:56:16 -04:00
scivision 67c84ef103 Help: Indicate that ctest --test-dir may be specified with a preset
In commit c971212703 (ctest: Allow --test-dir override when using
presets, 2024-04-20, v3.30.0-rc1~200^2) we forgot to update the docs.
2026-03-31 09:38:05 -04:00
scivision 02e9335d9c Help: Document that cmake --preset supports -B to override the build dir 2026-03-31 09:37:54 -04:00
Brad King c288ecddb2 Help: Revise versioning note for cmake --build with both dir and preset
Indent docs from commit 19296f507d (cmake --build: Allow CLI build dir
to override presets, 2025-11-17, v4.3.0-rc1~472^2) inside the `--preset`
option documentation.
2026-03-31 09:36:38 -04:00
Marc Chevrier c386aaebf8 FILE_SET: install and export SOURCES file set type 2026-03-31 09:50:09 +02:00
Marc Chevrier 5c5b68f44e FILE_SET: Add support for the SOURCES type
Fixes: #27550
2026-03-31 09:49:59 +02:00
Brad King 5eab2214a2 Merge topic 'rust-edition'
abe64ca2d3 Rust: Update experimental UUID
313769e766 Rust: Add support for Rust editions with Rust_EDITION target property
d0e39096b6 Rust: Fix unused import warning in RustOnly test

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11852
2026-03-30 08:32:37 -04:00
Brad King ed48feeae8 clang-cl: Add support for C++ modules
Since commit 4a4986d28a (cxxmodules: support command templates for BMI
compilation, 2026-03-25, v4.3.1~2^2~1) we can express module interface
unit compilation to either object files or BMI-only in a way that works
with `clang-scan-deps` and `clang-cl` together.

Fixes: #25731
2026-03-27 15:39:33 -04:00
Brad King c1c6b13eb3 Merge branch 'release-4.3' 2026-03-27 09:36:09 -04:00
Brad King 3a7d797d5b CMake 4.3.1 2026-03-27 09:08:31 -04:00
Brad King 73763b86ea Merge branch 'release-4.2' 2026-03-27 09:02:29 -04:00
Brad King 9d6a1dbec6 Merge branch 'release-4.2' into release-4.3 2026-03-27 09:02:10 -04:00
Brad King cfbb1649dd CMake 4.2.4 2026-03-27 08:25:44 -04:00
Brad King 7a8f6cc160 Merge topic 'discover-tests'
4e34426fb3 TestDriver: Add '-N' option to print all tests
b7f83c37a4 create_test_sourcelist: Document command line arguments
8600ce6547 discover_tests: Add documentation
969999fa9f discover_tests: Add tests
3947842733 discover_tests: Add CMake command implementation
3f1fce6b48 discover_tests: Add CTest command implementation
d718a979b7 cmTestGenerator: Allow to be inherited from

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11758
2026-03-27 07:38:38 -04:00
Brad King 0e47cd8c7b Merge topic 'bmi-only-command-template'
7ebb5687ab cmGeneratorTarget: use typename for `flag`
4a4986d28a cxxmodules: support command templates for BMI compilation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11871
2026-03-27 07:36:26 -04:00
Brad King f7eff87604 Merge topic 'bmi-only-command-template' into release-4.3
7ebb5687ab cmGeneratorTarget: use typename for `flag`
4a4986d28a cxxmodules: support command templates for BMI compilation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11871
2026-03-27 07:36:24 -04:00
Brad King 2250c5e1f1 Merge topic 'tutorial'
53a2a77d19 Tutorial: Add missing entry in Step4 file list

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11873
2026-03-27 07:34:17 -04:00
Baudouin Feildel abe64ca2d3 Rust: Update experimental UUID 2026-03-26 23:15:58 +01:00
Baudouin Feildel 313769e766 Rust: Add support for Rust editions with Rust_EDITION target property 2026-03-26 23:15:58 +01:00