4060 Commits

Author SHA1 Message Date
Brad King
6d8fd22a03 Merge branch 'release-3.31' 2026-01-26 14:22:33 -05:00
Brad King
cd51ca47cb CMake 3.31.11 2026-01-26 13:45:51 -05:00
Brad King
b6a60d9ebe Merge topic 'FindRuby-components'
c5e7cb691c FindRuby: Add support for interpreter and development components
dc8e05c4d2 FindRuby: Simplify finding the Ruby library - Ruby already knows!
b192f706aa FindRuby: Remove broken, untested and unmaintained cross-compiling support
ee75b3e7b4 FindRuby: Clean up variables read from Ruby
ba37066185 FindRuby: Versions are strings not paths.
b2bd6b221c FindRuby: Enclose Ruby executable in quotes
752d5cace6 FindRuby: Fix incorrect code and versions
deb67fa837 FindRuby: Remove duplicate word
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Osyotr <zhenchik35026@gmail.com>
Merge-request: !11544
2026-01-24 07:58:49 -05:00
Charlie Savage
c5e7cb691c FindRuby: Add support for interpreter and development components 2026-01-23 10:35:43 -05:00
Kyle Edwards
a4d9a20c49 Merge topic 'bin2c'
3dd49d857a ci: Enable bin2c large file test on some builds
3a893806bb cmake -E: Add bin2c mode
8cca26e562 cm::optional: Suppress GCC -Wmaybe-uninitialized false positive

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Brad King <brad.king@kitware.com>
Merge-request: !11536
2026-01-23 10:05:58 -05:00
Kyle Edwards
3a893806bb
cmake -E: Add bin2c mode
Run Tests/RunCMake/cmake-E-bin2c/generate_files.sh to regenerate the
following files:

- Tests/RunCMake/cmake-E-bin2c/long.c.txt
- Tests/RunCMake/cmake-E-bin2c/long_signed.c.txt
- Tests/RunCMake/cmake-E-bin2c/long_decimal.c.txt
- Tests/RunCMake/cmake-E-bin2c/long_signed_decimal.c.txt
- Tests/RunCMake/cmake-E-bin2c/hashes.cmake

Run it with --very-long to regenerate the following additional files:

- Tests/RunCMake/cmake-E-bin2c/very_long_params.cmake
2026-01-22 14:33:17 -05:00
Marc Chevrier
e2a38a3990 GenEx SOURCE_PROPERTY
This feature is required for the support of the future feature of
pattern rules (see #27383).

But it is also a valuable addition in the context of custom command and target.
2026-01-21 16:03:30 +01:00
Paulius Velesko
47c3e55d4a HIP: Add support for SPIR-V platform
Add `spirv` as a known value for `CMAKE_HIP_PLATFORM`.
Default `CMAKE_HIP_ARCHITECTURES` to `OFF` for `spirv`.

Fixes: #27410
2026-01-20 13:18:18 -05:00
Brad King
3044be73a9 Merge branch 'release-4.2' 2026-01-20 10:42:30 -05:00
Brad King
3356d93e66 CMake 4.2.2 2026-01-20 09:46:37 -05:00
Brad King
59c3422974 Merge topic 'pvs-analyze'
ef12ef1bd6 pvs-studio: Add support for linting with PVS-Studio
8f722e0fac cmList: Expose container reserve
5d1f269658 cmcmd: Allow passing object file to co_compile commands

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Alex Overchenko <aleksandr9809@gmail.com>
Merge-request: !11323
2026-01-19 09:30:58 -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
Brad King
18c98682f5 Merge topic 'verify-private-header-sets'
b61637f90f File sets: Add verification of private file sets
61df2e15a2 Help: Verification target also sets CXX_SCAN_FOR_MODULES to false
909b54023a File sets: Specify verify file set target names in one place
20219414c3 File sets: Always verify interface files sets of executable targets
c7a1d5ee58 Tests: Rename VerifyHeaderSets tests to VerifyInterfaceHeaderSets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11565
2026-01-19 09:27:59 -05:00
Martin Duffy
ef12ef1bd6 pvs-studio: Add support for linting with PVS-Studio 2026-01-16 11:25:59 -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
Craig Scott
b61637f90f
File sets: Add verification of private file sets
Add support for PRIVATE header sets, analogous to the existing
INTERFACE header sets support. A key difference between the two is
the way they handle build and usage requirements. INTERFACE
header sets rely on the original target's INTERFACE, whereas PRIVATE
header sets copy across various properties from the original target.

Generated files need special handling for PRIVATE header sets.
Add a dependency on the original target to the verification target to
ensure such generated files will exist.

Fixes: #23448
2026-01-16 18:10:17 +11:00
Craig Scott
20219414c3
File sets: Always verify interface files sets of executable targets
When VERIFY_INTERFACE_FILE_SETS is set to true on an executable
target, verification of that target's interface file sets was only being
performed if the target's ENABLE_EXPORTS property was set to true.
We now always verify the interface file sets of executable targets,
subject to the new CMP0209 policy. This allows interface file sets to
be verified even for executable targets that do not export symbols.
Interface file sets containing headers that are fully inlined is an
example use case for this scenario. Unit test executables may link
to the executable under test, possibly with $<COMPILE_ONLY:...>.

Issue: #23448 #27046
2026-01-16 18:10:14 +11: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
Brad King
8194b8ff5c Utilities/Release: Update docker specs for linux-aarch64 to centos 8 vault
Update the centos base image from centos 7 to centos 8.  The latter is
available in `vault.centos.org` repositories, so we can rebuild in the
future.  The resulting binaries require GLIBC 2.28.

While at it, update to OpenSSL 3.6.0.
2026-01-13 11:38:30 -05:00
Brad King
08e1d1001a Merge topic 'fix-cmp0199'
35d5a4fd6d GenEx: Partially restore pre-CMP0199 behavior of $<CONFIG>

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: Matthew Woehlke <matthew.woehlke@kitware.com>
Merge-request: !11581
2026-01-13 11:05:11 -05:00
Brad King
dc652e91c6 Merge topic 'E_sum-stdin'
394ab1fcfb cmake -E *sum: Add ability to read from stdin

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !11590
2026-01-13 10:52:24 -05:00
Kyle Edwards
394ab1fcfb
cmake -E *sum: Add ability to read from stdin 2026-01-12 13:58:53 -05:00
Kyle Edwards
2d2036c9e9
FindCUDAToolkit: Add CUDA::bin2c target 2026-01-12 12:02:07 -05:00
Matthew Woehlke
35d5a4fd6d GenEx: Partially restore pre-CMP0199 behavior of $<CONFIG>
Modify the implementation of policy CMP0199 to only remove the oddball
configuration map matching of `$<CONFIG>` in `NEW` mode, restoring the
old behavior of matching BOTH the consumer's configuration and the
selected configuration of the imported target. It turns out that users
are more dependent on the former than the latter, and while matching
more than one thing is still dodgy, we will likely need to introduce a
new generator expression to match the selected configuration of the
imported target.

Meanwhile, `$<CONFIG>` on targets imported from CPS still only matches
the selected configuration of the imported target, which is the behavior
specified by CPS. However, this can only happen for `$<CONFIG>`
expressions that were generated internally during import.

Update documentation and test cases accordingly.

Fixes: #27487
Fixes: #27495
2026-01-12 10:58:08 -05:00
Brad King
538926c532 Merge topic 'cpack-archive-compression-level'
0bca70968a CPack: support archive compression level
54f926c740 libarchive: Limit lzma compression level to 6 on AIX

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11548
2026-01-12 09:40:51 -05:00
AJIOB
0bca70968a CPack: support archive compression level
Fixes: #18117
2026-01-09 10:35:04 -05:00
Brad King
b147c227d3 Merge topic 'trace-end'
b468b3baf2 trace: Print control structure "end" commands

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Alex Overchenko <aleksandr9809@gmail.com>
Merge-request: !11549
2026-01-09 09:51:54 -05:00
Tyler Yankee
b468b3baf2 trace: Print control structure "end" commands
Enhance `cmake --trace` (and related modes) by adding a backtrace for
the "end" command after "replaying" control structures.

Expand the unit test to include control structures.

Fixes: #27381
2026-01-07 09:21:15 -05:00
AJIOB
0b376b1bda cli tar: support for raw compression 2026-01-06 09:49:58 +03:00
AJIOB
e4e29aeb66 cli tar: extend supported compression methods 2026-01-06 09:49:57 +03:00
Craig Scott
0854e3d598
Help,Comments: Fix occurrences of doubled words 2025-12-21 21:03:33 +11:00
Brad King
732beb3960 Merge topic 'doc-4.1-vs-flags'
ea357236f4 Help: Add 4.1 release note about VS link flag suppression

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11525
2025-12-18 10:35:14 -05:00
Brad King
cfa16434c0 Merge topic 'doc-4.1-vs-flags' into release-4.2
ea357236f4 Help: Add 4.1 release note about VS link flag suppression

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11525
2025-12-18 10:35:12 -05:00
Brad King
3d0b2ec54d Merge topic 'file-ARCHIVE_CREATE-compression'
e347176424 file(ARCHIVE_CREATE): Add controls for zip and 7z compression method/level

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !11522
2025-12-18 10:02:18 -05:00
Brad King
ea357236f4 Help: Add 4.1 release note about VS link flag suppression
Document link flags suppressed by commit 99d09ec45a (VS: Suppress
MSBuild default link flags not specified by project or user, 2025-06-17,
v4.1.0-rc1~6^2).  Leave out `-subsystem` because that's being reverted
by another commit.

Issue: #27004
Issue: #27464
2025-12-17 16:58:30 -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
Kevin Barre
07fe3f95ce CPack/DEB: Add CPACK_DEBIAN_COMPRESSION_LEVEL variable
Add a new variable `CPACK_DEBIAN_COMPRESSION_LEVEL` to control the compression
level used when generating Debian packages. This complements the existing
`CPACK_DEBIAN_COMPRESSION_TYPE` variable and allows finer control over the
compression performance vs. size trade-off. Supported values correspond to
the compression level accepted by the underlying compressor (e.g. gzip, xz,
zstd, etc.).
2025-12-17 14:27:10 -05:00
Brad King
292f6fc360 Merge topic 'cpack-7z-zip-algorithms'
3db6cce657 cpack: 7z & zip supports compression algorithms
1e4b829279 cpack: restore broken archive compression methods

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11513
2025-12-17 14:11:52 -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
3db6cce657 cpack: 7z & zip supports compression algorithms
Fixes: #27461
2025-12-16 15:52:54 +03:00
Brad King
4eab9b6708 Merge topic 'cli-tar-compress-algo'
94ae247d44 cli tar: support different algorithms for zip & 7z
1ba3444fd8 libarchive: Limit 7zip and zstd compression level to 6 on AIX

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11488
2025-12-12 10:05:47 -05:00
AJIOB
94ae247d44 cli tar: support different algorithms for zip & 7z
Fixes: #27443
2025-12-11 12:00:31 -05:00
Brad King
d54e15a5b8 ci: Require Windows 10 in official precompiled binaries
See Windows SDK docs [1] on API selection via preprocessor definitions.

[1] https://learn.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt

Closes: #27450
2025-12-10 10:09:27 -05:00
Brad King
6eab40fa4a Merge topic 'export-empty-args'
2151e5f79d export, install: Improve argument parsing
2e71df0156 export: Explicitly allow empty NAMESPACE
5564c2cd9a cmArgumentParser: Improve bad argument handling
3f38f9511b cmArgumentParser: Add support for MaybeEmpty<std::string>
1ec7201558 cmStringAlgorithms: Add cmStripWhitespace
2ca58c5ac9 set: Improve error message consistency

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11472
2025-12-10 09:37:52 -05:00
Matthew Woehlke
2151e5f79d export, install: Improve argument parsing
Modify the `export(EXPORT)` and `install(PACKAGE_INFO)` commands to
actually enforce that certain arguments must be non-empty. With respect
to `export`, this is mainly targeted at CPS export, but ends up
affecting all flavors of `export(EXPORT)` because that is the level at
which argument parsing is performed.

Also, add unit tests to verify that the new rejection of arguments with
missing or empty values is working, update the existing tests due to
changes in error reporting, and remove no-longer-needed manual
validation of an empty `PACKAGE_INFO` argument.
2025-12-09 13:37:01 -05:00
Brad King
b32e8f11d0 Merge topic 'normalize-sqlite-target-name'
d4754c1a0c FindSQLite3: Use package name as namespace

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11482
2025-12-09 10:59:16 -05:00
Brad King
20e81dbd5e Merge branch 'release-4.2' 2025-12-08 14:06:39 -05:00
Brad King
485f11a780 CMake 4.2.1 2025-12-08 13:33:58 -05:00
Brad King
e10b07595a Merge branch 'release-4.1' 2025-12-08 12:01:54 -05:00