145 Commits
Author SHA1 Message Date
Tyler Yankee 7350b58c16 Help: Move regex specification to cmake-language(7)
Many other places in CMake beyond the `string` command rely on our
regex syntax, so it should be documented in a more general location.

Fixes: #22270
2026-09-07 10:17:42 -04:00
Gleb Popov 144021a43b file(GET_RUNTIME_DEPENDENCIES): Implement command for FreeBSD
Closes: #25305
2026-06-24 18:49:51 +03:00
Daksh Mamodiya 9800bd2098 file(ARCHIVE_CREATE): Add PATTERNS_EXCLUDE option
Exclude files and directories matching the given patterns while creating
an archive, using libarchive's matcher for parity with file(ARCHIVE_EXTRACT).

Fixes: #27877.
2026-06-16 15:33:06 +02:00
Brad King efe56769ba Merge topic 'file-curl-errors'
1f32d51dbb Help/file: Reference curl documentation for error codes

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12164
2026-06-12 09:37:51 -04:00
Tyler Yankee 1f32d51dbb Help/file: Reference curl documentation for error codes
Fixes: #27866
2026-06-11 13:47:24 -04:00
Daksh Mamodiya 531f3b568c file(ARCHIVE_EXTRACT): Add PATTERNS_EXCLUDE option
Omit archive entries matching the given patterns when extracting or
listing. May be combined with PATTERNS; on overlap the exclusion
takes precedence.

Fixes: #27837
2026-06-11 02:04:36 +02:00
scivision 3f3ba04d81 file(READ_SYMLINK): Add RESULT option to capture errors
Closes: #27753
2026-04-17 10:51:28 -04:00
Brad King 25dd69d2f2 Merge topic 'file-link-copy-fix'
57ca3dc521 file(CREATE_LINK): Fix CMP0205 to not remove content behind directory symlink
a6470b4681 Help/file: Clarify behavior change with CMP0205
b894942d3e file(CREATE_LINK): Revise CMP0205 warning

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !11925
2026-04-16 09:19:27 -04:00
Tyler Yankee a6470b4681 Help/file: Clarify behavior change with CMP0205 2026-04-15 14:03:39 -04:00
AJIOB 97455c3d7e file: Add ARCHIVE_* options to specify pathname encoding
Issue: #26903
2026-03-24 14:07:21 -04:00
AJIOB 899122e776 Help: Wrap long line in 4.3 versionadded note 2026-03-24 13:37:38 -04:00
Tyler Yankee 6592b8ac14 Help/cmake_path: Clarify output variable behavior
Add explicit cross-references for commands which optionally take an
output variable (otherwise modifying their input in-place) for clarity.

Note that `cmake_path` should not be used to modify variables reserved
by CMake.

Improve references to the "CMake-style" semicolon-separated lists, and
apply those corresponding changes to the `file` command page.
2026-02-12 12:50:51 -05:00
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
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 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
AJIOB e347176424 file(ARCHIVE_CREATE): Add controls for zip and 7z compression method/level
Fixes: #27463
2025-12-17 14:38:30 -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
AJIOB 4fdfa0db1a file(ARCHIVE_CREATE): support multithreading compression
Relates: #27420
2025-12-03 02:45:30 -05:00
AJIOB 5b87a5d53e cli tar: implement LZMA support
Fixes: #27433
2025-12-02 10:44:49 +03: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
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 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
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
Nikita Nemkin 9c963de998 Help: Remove stray spaces and one colon 2025-01-31 12:23:29 -05:00
Peter Kokot dc7aabf4d0 Help: Document CMAKE_OBJDUMP variable 2025-01-24 10:43:18 -05:00
Peter Kokot 2e02e5589d file(MAKE_DIRECTORY): Document current source directory
Relative paths in the directories list argument are treated as relative
to the current source directory.
2025-01-20 14:59:38 +01:00
Peter Kokot d7b33ed8e2 file(MAKE_DIRECTORY): Update synopsis signature
This syncs the signature as it provides another optional option.
2025-01-07 02:15:33 +01:00
Brad King 5e1a59dc2b file(DOWNLOAD/UPLOAD): Require minimum TLS 1.2 by default
Fixes: #25701
2024-09-26 10:10:20 -04:00
Brad King 8e92ee34f6 file(DOWNLOAD/UPLOAD): Verify TLS server certificate by default
If the connection fails in a way that might be a certificate error, and
verification was enabled by the new default, mention environment
variable `CMAKE_TLS_VERIFY` in the diagnostic to help users that were
relying on the old behavior turn off server certificate verification in
their environment.

Fixes: #23608
2024-09-24 08:37:23 -04:00
Yuri Witte d8a9aabd24 file(ARCHIVE_CREATE): add WORKING_DIRECTORY option
Fixes: #25260
Issue: #21653
2024-09-11 09:52:32 -04:00
Brad King d65b5a8e03 Help: Format file(ARCHIVE*) options as definition lists 2024-09-11 09:50:55 -04:00
Craig Scott 012d116260 Merge topic 'cmp0168-populate-nondeclare-regression'
cbb727ca6b FetchContent: Don't update verify script timestamp if it doesn't change
795e7b44f2 Help: file(CONFIGURE) only updates output file timestamp if it changes

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9799
2024-09-08 18:32:40 -04:00
Craig Scott 795e7b44f2 Help: file(CONFIGURE) only updates output file timestamp if it changes 2024-09-06 15:48:38 +10:00
Aliaksandr Averchanka 4d4e008e69 file(GET_RUNTIME_DEPENDENCIES): Fix resolution of repeated ELF dependencies
When a library file name is encountered multiple times, reuse the result
from the first time.  This more closely matches the behavior of the
dynamic loader on Linux.

Fixes: #24621
2024-08-19 08:57:04 +03:00
Asit Dhal 95323c90a1 file(MAKE_DIRECTORY): Add optional RESULT keyword to capture failure.
Fixes: #26041
2024-06-24 02:20:43 +02:00
Craig Scott 7c516f7e28 file(): TOUCH, TOUCH_NOCREATE and MAKE_DIRECTORY accept empty lists
Projects may be generating a list of files or directories to pass as arguments
to file(TOUCH), file(TOUCH_NOCREATE), or file(MAKE_DIRECTORY). Those
lists might end up being empty, so rather than requiring at least one item,
allow an empty list.

Fixes: #24897
2024-05-31 22:55:20 +10:00
Joachim Wuttke (h) d2d2ffe1c1 Help: file: document GET_RUNTIME_DEPENDENCIES separately
Moved documentation of file(GET_RUNTIME_DEPENDENCIES ...) from
the 'Reading' section to a separate section at the bottom of
the page. Because it is a very long text, and because this
signature is quite different from all the others in the
'Reading' section.
2024-04-24 15:28:39 +02:00
Brad King bed32f400e file(DOWNLOAD|UPLOAD): Document TLS_VERSION fallback to environment variable
This was missed by commit 434fe8a34b (file(DOWNLOAD|UPLOAD): Add
CMAKE_TLS_VERSION environment variable, 2024-02-26).
2024-03-29 14:17:58 -04:00
Brad King c481ddda14 Merge topic 'curl-tls-version'
434fe8a34b file(DOWNLOAD|UPLOAD): Add CMAKE_TLS_VERSION environment variable
fb9a6cf909 file(DOWNLOAD|UPLOAD): Add CMAKE_TLS_VERSION variable
8e6776b9f3 file(DOWNLOAD|UPLOAD): Add TLS_VERSION option for https connections

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9290
2024-02-28 09:03:20 -05:00
Brad King fb9a6cf909 file(DOWNLOAD|UPLOAD): Add CMAKE_TLS_VERSION variable
Issue: #25701
2024-02-28 08:40:27 -05:00
Brad King 8e6776b9f3 file(DOWNLOAD|UPLOAD): Add TLS_VERSION option for https connections
Add an option to specify the minimum allowed TLS version for https
connections.

Issue: #25701
2024-02-28 08:40:14 -05:00
Ben Boeckel 189d28d77d Help/file: mention the working directory for ARCHIVE_EXTRACT
See: https://discourse.cmake.org/t/10135
2024-02-27 05:53:08 -05:00
Cristian Le fa00928bcd file: STRINGS + REGEX store match results
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
2024-01-09 16:36:55 -05:00
Brad King e48f2e69b5 Help: Clarify file() command multi-value argument placeholders
Use `<placeholder>...` syntax to imply "zero or more", as we do elsewhere.
2023-11-15 10:56:17 -05:00
Robert Maynard 6b5f2dbbfe file(REAL_PATH): resolve symlinks before '..' components
Previously REAL_PATH would collapse paths before resolving any symlinks
so if `..` crossed a symlink the output from `REAL_PATH` would be wrong.

It looked like REAL_PATH did this by mistake since it was a side-effect
of ensuring we had an absolute path before resolving symlinks.
2023-07-20 17:02:58 -04:00
Brad King 5922c86ed6 file(GET_RUNTIME_DEPENDENCIES): Document case-preserving change on Windows
In commit fa45594407 (file(GET_RUNTIME_DEPENDENCIES): Preserve casing
for Windows PE binaries, 2023-03-06) we neglected to update associated
documentation.
2023-03-27 09:49:51 -04:00
Matthew Woehlke c8f65d2b67 Help: Improve file command signatures
Fix a couple of file command signatures that were not using angle
brackets to mark arguments.
2023-03-15 10:53:25 -04:00
Matthew Woehlke 68fb1572a8 Help: Convert signatures of file command
Convert `file` command to use new `signature` directive. Use '<HASH>'
rather than 'HASH' for relevant signature targets, as this is arguably
more correct, results in less need to specify explicit targets, but
still produces '#hash' as the HTML anchor.

Although actual textual changes to `file` are fairly minimal, large
portions of the content have been re-indented and in many cases,
re-flowed. Some tabular content in literal text blocks has also been
converted to actual tables.
2023-03-15 10:53:25 -04:00