1778 Commits

Author SHA1 Message Date
Brad King
ec4af051eb Merge topic 'doc-file-sys-commands'
d8c6bbe693 Help: Improve formatting for `cmake_host_system_information`
307c2240ad Help: Improve command formatting atop `file` page

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11603
2026-01-19 09:29:28 -05:00
Brad King
f71894a17d Merge topic 'fix-archive-path-traversal'
03f19aa4ea cmSystemTools: Fix path traversal vulnerability in archive extraction
be2ac223b0 cmSystemTools: Factor out libarchive extraction flags
9c408b844b Tests/RunCMake/CMP0135: Avoid paths with .. components in test archive
6015ef807d cmake -E tar: Improve error message formatting

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11564
2026-01-19 09:24:40 -05:00
Leslie P. Polzer
03f19aa4ea cmSystemTools: Fix path traversal vulnerability in archive extraction
Add security flags to libarchive extraction to prevent path traversal
(Zip Slip) and absolute path attacks:

- ARCHIVE_EXTRACT_SECURE_NODOTDOT: Block ".." path components
- ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS: Block absolute paths
- ARCHIVE_EXTRACT_SECURE_SYMLINKS: Block symlinks escaping extract dir

This hardens both `cmake -E tar` and `file(ARCHIVE_EXTRACT)` against
malicious archives that attempt to write files outside the intended
extraction directory.
2026-01-16 08:54:07 -05:00
Tyler Yankee
d8c6bbe693 Help: Improve formatting for cmake_host_system_information
Use the signature directive to improve formatting of links to each
sub-command, especially `QUERY WINDOWS_REGISTRY`.
2026-01-15 20:30:17 -05:00
Tyler Yankee
307c2240ad Help: Improve command formatting atop file page
Amend the references to the `file` page from commit c575d84555 (Help:
Use signature directive for `cmake_path` command, 2025-10-08).
2026-01-15 20:26:16 -05:00
Brad King
093b6974f1 Merge topic 'export-refactor-arguments'
254916dfc6 export: Make PACKAGE_INFO, SBOM sub-commands
a121e5d49e export: Reset CPS export experimental gate

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11584
2026-01-14 13:00:48 -05:00
Robert Maynard
bf4a63c7b0 Help: Document that enable_language cannot be used in block()
Issue: #27389
2026-01-13 11:16:54 -05:00
Matthew Woehlke
254916dfc6 export: Make PACKAGE_INFO, SBOM sub-commands
Change the interface of the `export` command so that `PACKAGE_INFO` and
`SBOM` are proper, first-level sub-commands, rather than being implemented via
`export(EXPORT ... (PACKAGE_INFO|SBOM) ...)`. This brings consistency with the
`install` command and also simplifies argument parsing.

Update the documentation and test cases accordingly. Some of the
argument handling test cases are now rather gratuitous, and are removed,
which also improves consistency with the `install` tests.
2026-01-12 14:05:27 -05:00
Brad King
da84370cff Merge topic 'sbom-export-generators'
8ec5a595cd cmSbom: Add documentation for `install(SBOM)` and `export(SBOM)`
83671f2d87 cmSbom: Add `export(SBOM)` build generators and unit tests
f2027a886b cmSbom: Add `install(SBOM)` generator and unit tests
dcadde3662 CPS: Refactor ForbidGeneratorExpressions into cmGeneratorExpression
bcb6f689a4 cmExportInstallFileGenerator: Allow overriding of CheckInterfaceDirs
6d6c37c90d cmPackageInfoArguments: Extract common values
8c6676b2ea cmFindPackage: Fix PACKAGE_VERSION not being set when rebuilding

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11396
2025-12-18 10:13:32 -05:00
AJIOB
e347176424 file(ARCHIVE_CREATE): Add controls for zip and 7z compression method/level
Fixes: #27463
2025-12-17 14:38:30 -05:00
Taylor Sasser
8ec5a595cd cmSbom: Add documentation for install(SBOM) and export(SBOM) 2025-12-17 14:35:12 -05:00
Kyle Edwards
1eb5ea3a64
Help(string(JSON)): Clarify that some modes can have zero members/indices 2025-12-16 11:14:16 -05:00
Kyle Edwards
06e6f1e69f
string(JSON): Add STRING_ENCODE mode 2025-12-16 10:11:30 -05:00
Kyle Edwards
15973ff247
string(JSON): Add GET_RAW mode 2025-12-16 10:00:29 -05:00
AJIOB
94ae247d44 cli tar: support different algorithms for zip & 7z
Fixes: #27443
2025-12-11 12:00:31 -05:00
Brad King
9149ac3f37 Merge topic 'fix-27420'
4fdfa0db1a file(ARCHIVE_CREATE): support multithreading compression
cbf71b21b2 cli tar: support multithreading compression

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11460
2025-12-05 09:04:58 -05:00
Brad King
e4737d1c4a Merge topic 'cli-tar-lzma'
5b87a5d53e cli tar: implement LZMA support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11465
2025-12-03 16:26:20 -05:00
AJIOB
4fdfa0db1a file(ARCHIVE_CREATE): support multithreading compression
Relates: #27420
2025-12-03 02:45:30 -05:00
Brad King
8fd9ebea6b Merge topic 'doc-policy-max'
7323fbd65e Help: Be more explicit about what `...<policy_max>` does not mean

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11438
2025-12-02 15:52:30 -05:00
ferdymercury
7323fbd65e Help: Be more explicit about what ...<policy_max> does not mean
Also use `<policy_max>` more consistently in signatures.
2025-12-02 15:25:47 -05:00
AJIOB
5b87a5d53e cli tar: implement LZMA support
Fixes: #27433
2025-12-02 10:44:49 +03:00
HannaWAR
2628c52e04 source_group: add genex support
Fixes: #19813
2025-11-24 21:08:46 +03:00
Brad King
bb877abc93 Merge topic 'doc-string-xref'
510d81c7bc Help: Avoid reST named references in string(JSON) synopsis
6c0f37546f Help: Improve string(JSON) synopsis document source readability

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11426
2025-11-18 09:05:18 -05:00
Brad King
510d81c7bc Help: Avoid reST named references in string(JSON) synopsis
Also revert commit 9702a01dc9 (Help: string(LENGTH): Fix synopsis link
to command description, 2023-12-30, v3.28.2~23^2).  It was only needed
to avoid re-using a named reference that we've now removed.

Issue: #25546
2025-11-17 16:31:37 -05:00
Brad King
6c0f37546f Help: Improve string(JSON) synopsis document source readability
Avoid spaces in signature target names.
2025-11-17 16:31:37 -05:00
Brad King
42d94ff876 Merge topic 'file-GET_RUNTIME_DEPENDENCIES-matching'
bf3f69834d file(GET_RUNTIME_DEPENDENCIES): Normalize paths before matching

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !11351
2025-11-15 09:03:56 -05:00
Brad King
a5328ab279 Merge topic 'doc-typos-cleanup-4.2'
730cad9cb6 Help: Fix typos and formatting for 4.2 release

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11418
2025-11-14 09:49:18 -05:00
hanna.rusakovich
bf3f69834d file(GET_RUNTIME_DEPENDENCIES): Normalize paths before matching
Regex-based filtering should not have to account for slash differences.
Add policy CMP0207 for compatibility.

Fixes: #26202
2025-11-14 17:23:26 +03:00
Craig Scott
730cad9cb6
Help: Fix typos and formatting for 4.2 release 2025-11-14 16:29:51 +11:00
Matthew Woehlke
34343922a5 install: Add ability to generate CPS from install(EXPORT)
Add the ability to generate CPS package information when install(EXPORT)
is used. This relies on additional information to be passed to CMake,
and is intended as a way of getting CPS out of existing projects without
needing to make changes to the projects' CMakeLists.txt. (Particularly,
this feature is intended for package distributors, not project authors.)
2025-11-11 11:51:58 -05:00
Brad King
303ffae24f Merge topic 'deprecate-CMAKE_ENABLE_EXPORTS'
33d9146472 CMAKE_ENABLE_EXPORTS: Deprecate variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11381
2025-11-05 10:25:26 -05:00
Peter Kokot
33d9146472
CMAKE_ENABLE_EXPORTS: Deprecate variable
This makes it more clear which variable should be used.

Fixes #27357
2025-11-04 20:07:39 +01:00
Hanna Rusakovich
a73ddd2ddb file(CREATE_LINK): Implement COPY_ON_ERROR for directories
Add policy `CMP0205` for compatibility with projects not expecting this.

Fixes: #27294
2025-10-31 08:42:59 +03:00
Brad King
5ae9d92a92 Merge topic 'project-license-doc'
ebf0a359ad Help: Improve documentation of project SPDX_LICENSE

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11348
2025-10-28 09:32:40 -04:00
Brad King
b5ec664401 Merge topic 'project-license-doc' into release-4.2
ebf0a359ad Help: Improve documentation of project SPDX_LICENSE

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11348
2025-10-28 09:32:37 -04:00
Matthew Woehlke
ebf0a359ad Help: Improve documentation of project SPDX_LICENSE
Currently, CMake allows specifying a license (`SPDX_LICENSE`) for both
projects and targets, which is largely motivated by CPS export. The
design of CPS is geared toward components (targets) only expressing an
explicit license when that component's license differs from the license
that applies to the package as a whole (or, at least, the license
generally used by the package's software components). Accordingly, the
project license is not used to initialize the `SPDX_LICENSE` target
property at export time. This, however, was not documented previously.

Add a note explaining this to the `SPDX_LICENSE` option of the `project`
command.

Fixes: #27295
2025-10-27 10:38:40 -04:00
Brad King
f96cb60ba3 Merge topic 'fix-project-license-doc'
6500ea2776 Help: Add missing gate for project(SPDX_LICENSE)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !11342
2025-10-24 17:02:26 -04:00
Matthew Woehlke
6500ea2776 Help: Add missing gate for project(SPDX_LICENSE)
The `SPDX_LICENSE` option of the `project` command requires that the
`CMAKE_EXPERIMENTAL_EXPORT_PACKAGE_INFO` gate is enabled, but this was
not documented. Add the missing documentation.

Fixes: #27328
2025-10-23 11:36:16 -04:00
Peter Kokot
6374f70915
remove_definitions: Update documentation
- Reworded command description.
- Briefly mentioned that this command can also remove other flags given
  by add_definitions().
- Added examples section.
- Mentioned also add_compile_definitions() command, as
  remove_definitions() can remove also those.
2025-10-21 22:23:15 +02:00
Brad King
8183c6a9ba Merge topic 'fix-copy-on-error-directory-info'
657e9be724 file(CREATE_LINK): Document `COPY_ON_ERROR` behavior on directories

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11299
2025-10-12 09:20:20 -04:00
Brad King
7095118a78 Merge topic 'fix-copy-on-error-directory-info' into release-4.2
657e9be724 file(CREATE_LINK): Document `COPY_ON_ERROR` behavior on directories

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11299
2025-10-12 09:20:18 -04:00
Alex Overchenko
657e9be724 file(CREATE_LINK): Document COPY_ON_ERROR behavior on directories
Issue: #27294
2025-10-10 10:26:36 -04:00
Tyler Yankee
c575d84555 Help: Use signature directive for cmake_path command
Using `signature` renders the anchor links for each sub-command, and is
consistent with the other `Help/command` pages which contain multiple
sub-commands.
2025-10-08 20:44:38 -04:00
Brad King
927ccf212f Merge topic 'help-TRYRUN_OUTPUT_STDOUT'
6d61783103 Help: Document try_run output cache entries for cross-build

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11284
2025-10-07 09:02:32 -04:00
Jinzhe Zeng
6d61783103 Help: Document try_run output cache entries for cross-build
Document `try_run` cache entries added by commit a2cd0687db (try_run:
Add RUN_OUTPUT_STDOUT_VARIABLE and RUN_OUTPUT_STDERR_VARIABLE.,
2022-07-08, v3.25.0-rc1~443^2):

* `<runResultVar>__TRYRUN_OUTPUT_STDOUT`
* `<runResultVar>__TRYRUN_OUTPUT_STDERR`

Fixes: #27281
2025-10-06 10:33:54 -04:00
Brad King
0d01bc72b8 Merge topic 'cps-symbolic-info'
62a1d3e7f1 FileAPI: Add symbolic property to targets
d92b6c3e20 CPS: Add Symbolic Components
03284e018f Help: Simplify file-api version information for "abstract" field

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !11132
2025-10-03 11:24:50 -04:00
Brad King
caf01b88bc Merge topic 'instrumentation-target-content'
97adbc91fa instrumentation: Move target data into content files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11251
2025-10-03 11:21:17 -04:00
Taylor Sasser
d92b6c3e20 CPS: Add Symbolic Components
Adds support for "symbolic" components, which represent feature-level
capabilities of a package that do not correspond to actual build targets.
These are modeled as pseudo-targets, using the INTERFACE type as a base,
and can be queried via:

  get_target_property(... <tgt> "SYMBOLIC")

This enables consumers to declare requirements on optional features
(e.g., SSL support) even when they do not map to concrete targets.

Fixes: #27187
2025-10-02 10:46:02 -04:00
Martin Duffy
97adbc91fa instrumentation: Move target data into content files
Create a single place to store target data to prevent duplication.
This moves `targetType` and `targetLabels` out of the snippet files
and into a target map in the `cmakeContent` file referenced by each
snippet.

Fixes: #27244
2025-10-02 09:28:20 -04:00
Brad King
6babe38916 Help: Fix cmake_language(TRACE) command anchor 2025-10-01 09:23:33 -04:00