2444 Commits

Author SHA1 Message Date
Brad King
16eae4759d Merge topic 'doc-sphinx-pre-5.0'
01b94f5702 Help: Restore sphinx pre-5.0 compatibility

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12175
2026-06-16 10:02:07 -04:00
John Parent
01b94f5702 Help: Restore sphinx pre-5.0 compatibility
Revise commit 97d13c3053 (Help: Improve diagnostics documentation,
2026-04-30, v4.4.0-rc1~227^2~2) to switch `cmake.py`'s sphinx api usage
from 7.4+ features to 4.0+ features.

Replace `parse_text_to_nodes` and `parse_content_to_nodes` with
equivalent, backwards compatible sphinx code using existing api calls.

Signed-off-by: John Parent <john.parent@kitware.com>
2026-06-15 11:35:41 -04:00
Brad King
7c1e4fbf0b Configure CMake itself with policies through CMake 4.3 2026-06-05 11:34:36 -04:00
Tyler Yankee
1bc30bd30d Help/ctest: Improve formatting of dashboard options
We must differentiate between the `ctest -D` dashboard and `ctest -D`
variable options.
2026-06-02 13:49:16 -04:00
Tyler Yankee
69be06bad3 Help/fileAPI: Add version modified directives
Extend (part of) commit f26e9fcbae (Help: Generate presets JSON schema,
documentation, 2026-04-08) to the `cmake-file-api(7)` page, for each of
the currently applicable object kinds (i.e., only those which have
undergone changes, which is predominantly the codemodel).

This standardization helps to improve both the readability and
maintainability of the document.
2026-05-22 08:22:04 -04:00
Ben Boeckel
0bc2706da5 cmcurl: avoid list(PREPEND) in CMake's own CMake code
`list(PREPEND)` is new as of CMake 3.15, but CMake's own minimum CMake
is 3.13.
2026-05-14 21:01:01 -04:00
Ben Boeckel
771e87a9f4 Merge branch 'cmake-no-list-PREPEND-release' into cmake-no-list-PREPEND
* cmake-no-list-PREPEND-release:
  cmake: avoid `list(PREPEND)` in CMake's own CMake code
2026-05-14 21:00:46 -04:00
Ben Boeckel
29f1078fe0 cmake: avoid list(PREPEND) in CMake's own CMake code
`list(PREPEND)` is new as of CMake 3.15, but CMake's own minimum CMake
is 3.13.
2026-05-14 21:00:11 -04:00
Tyler Yankee
935c8525f6 libarchive: Backport "Validate pathname in record_hardlink"
Backport libarchive commit `16ad931073` (cpio reader: Validate pathname
in record_hardlink, 2026-05-08).

Add a fuzzing test case to expose this to dynamic analysis tools.
2026-05-09 19:38:34 -04:00
Brad King
40afd95f7c Merge topic 'libarchive-wincrypt-boringssl'
5752bb41e3 libarchive: Avoid preprocessor symbol conflicts with boringssl on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12019
2026-05-08 07:39:07 -04:00
Haowei Wu
5752bb41e3 libarchive: Avoid preprocessor symbol conflicts with boringssl on Windows
`<wincrypt.h>` defines symbols conflicting with BoringSSL/AWS-LC.
2026-05-07 11:44:48 -04:00
Brad King
e8c587013c ci: Do not linkcheck cppreference.com URLs
These URLs are expected to be stable.  Reduce load on their infrastructure.
2026-05-07 08:11:03 -04:00
Brad King
2c3a9fcabe clang-tidy module: Update to build against LLVM/Clang 22
Update for LLVM/Clang commit `91cdd35008e9` ([clang] Improve nested name
specifier AST representation, 2025-08-09), which removed dedicated
`ElaboratedType` nodes in favor of storing the elaborated keyword and
name qualifier in separate nodes for the underlying type.
2026-05-04 19:42:07 -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
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
Tyler Yankee
8476469b72 Help: Add cmake-workflow-option role 2026-04-30 07:49:42 -04:00
Tyler Yankee
c49ebb67da Help: Use POSIX slashes for 'generated by' in presets files 2026-04-30 07:49:39 -04:00
Brad King
6187c3947b curl: Set build options the way we need for CMake
Set options added by the update to curl 8.20.0.
2026-04-29 14:19:24 -04:00
Brad King
c5d7ca29f6 Merge branch 'upstream-curl' into update-curl
* upstream-curl:
  curl 2026-04-29 (a05f3497)
2026-04-29 14:18:27 -04:00
Brad King
ee7829d9c7 curl: Update script to get curl 8.20.0 2026-04-29 14:17:31 -04:00
Tyler Yankee
86dfdbee1f libarchive: Backport "Fix use of uninitialized values from Huffman table"
Backport libarchive commit `1f5454575f` (cab reader: Fix use of
uninitialized values from Huffman, 2026-04-23).

Add a fuzzing test case to expose this to dynamic analysis tools.
2026-04-26 18:25:06 -04:00
Kyle Edwards
340ea3c2ad Utilities/Sphinx: Fix f-string formatting error
Versions of Python prior to 3.12 did not support nested quotes of
the same type in f-strings (see PEP 701). Use double quotes inside
the single-quote f-string.
2026-04-22 17:18:35 -04:00
Brad King
c940a13bd1 Merge topic 'preset-ref-explicit-titles'
26d5694151 Help: Allow preset references to have explicit titles

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11954
2026-04-21 15:21:20 -04:00
Matthew Woehlke
26d5694151 Help: Allow preset references to have explicit titles
Improve the CMake domain's 'preset' role, and reference resolving for
the same, to also accept explicit titles (i.e. 'title <ref>').

Also, remove some stray, inaccessible debugging code that was overlooked
in a previous round of improvements.
2026-04-21 11:08:18 -04:00
Matthew Woehlke
d3102b165a Presets: Fix generation of diagnostics schema
The description of diagnostics presets needs both the presets schema
spelling and the command-line spelling, but the initial generation logic
only used the former. This wasn't noticed because the spellings are the
same for single-word diagnostics, which were previously the only ones
being generated. Add the command-line spelling and update the
description templates.
2026-04-20 15:34:12 -04:00
Matthew Woehlke
d56f9718ac Presets: Generate diagnostics schema from header
Modify the script that generates the CMake presets schema to extract the
list of available diagnostics from the `cmDiagnostics.h` header and
generate the relevant properties. This information is combined with a
partial set that remains in the YAML for those diagnostics whose
definitions differ from what is easily generated. While these special
cases will remain, the addition of new diagnostics should no longer
require manual updates to the YAML. (The presets version log will still
require manual updates.)
2026-04-15 14:42:17 -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
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
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
Brad King
63a3a1c1a3 Merge topic 'update-kwiml'
da508dbafd Merge branch 'upstream-KWIML' into update-kwiml
014bb6c154 KWIML 2026-04-02 (46f18e5a)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11889
2026-04-03 09:35:06 -04:00
Matthew Woehlke
b96826bc08 Help: Improve abbreviated command-line option roles
Slightly tweak the helper roles that automatically generate targets for
command-line options to also strip values from `--arg <value>` options.
2026-04-02 16:46:30 -04:00
Brad King
e1c28e5011 Merge topic 'find_package-stack'
1b946dfbfe Merge branch 'backport-4.2-find_package-stack' into find_package-stack
e8ae3645db Merge branch 'backport-4.2-find_package-stack' into find_package-stack
aae02ee60a find_package: Share package information among copies of package stack
a789c21100 Merge branch 'backport-4.2-find_package-stack' into find_package-stack
9387988626 find_package: Save package information only after successfully loading it
561ece2407 cmFindPackageStack: Restore pure value semantics
e935ed22fb find_package: Share package information among copies of package stack
5aa649d5f6 find_package: Save package information only after successfully loading it
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11887
2026-04-02 13:23:54 -04:00
Brad King
da508dbafd Merge branch 'upstream-KWIML' into update-kwiml
# By KWIML Upstream
* upstream-KWIML:
  KWIML 2026-04-02 (46f18e5a)
2026-04-02 10:06:12 -04:00
Brad King
1b946dfbfe Merge branch 'backport-4.2-find_package-stack' into find_package-stack 2026-04-01 13:54:11 -04:00
Brad King
561ece2407 cmFindPackageStack: Restore pure value semantics
A stack entry's storage may be shared by other copies, so mutation is
incompatible with value semantics.  We've migrated the motivating use
case to another approach.

Revert commit b3873b8272 (cmFindPackageStack: Allow controlled mutation,
2025-07-29, v4.2.0-rc1~438^2) and commit f2bdc2176f (cmStack: New,
mutable stack class, 2025-07-29, v4.2.0-rc1~438^2~1).  Record their
parent as a second parent of this commit so `git blame` can see the
original history of the restored content.
2026-04-01 13:47:24 -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
Brad King
69b3d5b4a2 Merge topic 'libarchive-zip-zstd'
04ff010887 libarchive: Avoid zstd compression levels beyond 19 in zip format

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11868
2026-03-25 12:05:32 -04:00
Brad King
ba8760b6d6 Merge topic 'zstd-threads'
f278888171 zstd: Enable multithreading support in build within CMake

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11857
2026-03-25 12:02:47 -04:00
Brad King
04ff010887 libarchive: Avoid zstd compression levels beyond 19 in zip format
We document Zstd compression levels up to 19.  However, the zip
format defines compression level range 0 through 9.  libarchive
scales it into range `ZSTD_minCLevel()` to `ZSTD_maxCLevel()`.
Zstd compression levels beyond 19 require large memory allocations
which may fail on some platforms, such as 32-bit Linux.

Fixes: #27712
2026-03-24 18:24:34 -04:00
Brad King
f278888171 zstd: Enable multithreading support in build within CMake
Since commit cbf71b21b2 (cli tar: support multithreading compression,
2025-11-28, v4.3.0-rc1~393^2~1) we offer command-line options to control
compression threading.  Enable them when used with Zstd.

On AIX this causes allocation failures similar to those we avoid via
commit 1ba3444fd8 (libarchive: Limit 7zip and zstd compression level to
6 on AIX, 2025-12-11, v4.3.0-rc1~335^2~1), so leave threading off there
pending further investigation.

Issue: #27712
2026-03-24 18:24:28 -04:00
Brad King
4708e0934d Merge branch 'upstream-LibArchive' into update-libarchive
* upstream-LibArchive:
  LibArchive 2026-03-10 (3a9249b4)

Fixes: #27714
2026-03-23 10:46:18 -04:00
Brad King
e8a96af179 libarchive: Update script to get 3.8.6 2026-03-23 09:51:11 -04:00
Brad King
671ada703b Merge topic 'cmake-diagnostics'
a78f356ed9 Diagnostics: Shorten type names
2b7ee7137b cmStateSnapshot: CanPop* should be const
a0612aeb5d Diagnostics: Add cmake_diagnostic command
e74fbb3d44 Diagnostics: Implement diagnostic stack
d80a38e524 cmMakefile: Use enumeration for policy scope

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11818
2026-03-20 08:44:26 -04:00
Brad King
263443ca85 Merge topic 'cmext-algorithm-keys'
a5882e9abe cmext/algorithm: Fix return type of cm::keys and cm::values

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !11828
2026-03-20 08:40:05 -04:00
Matthew Woehlke
a0612aeb5d Diagnostics: Add cmake_diagnostic command
Add command to manipulate the new diagnostic stack/state introduced in
the previous commit. Start adding documentation for the system as a
whole.
2026-03-19 11:29:44 -04:00
Marc Chevrier
a5882e9abe cmext/algorithm: Fix return type of cm::keys and cm::values 2026-03-19 15:23:27 +01:00
Brad King
8370f76b07 IWYU: Suggest cm/{filesystem,optional,string_view} variants of std headers 2026-03-19 09:38:51 -04:00
Marc Chevrier
ec2daddf47 cmext/algorithm: add helpers functions cm::keys and cm::values 2026-03-14 11:55:55 +01:00