Add workflow and per-type defined values to cmake --list-presets.
Each -defined value lists every non-hidden preset of the selected type
and explains why unavailable presets cannot be used. The defined value
is an alias for configure-defined.
Support --list-presets=defined in cmake build and workflow modes,
ctest, and cpack. Propagate configure preset unavailability to
dependent build, test, package, and workflow presets.
Fixes: #28016, #26118
Allow CMake, CTest, and CPack to read presets from a path given by
command-line argument instead of always requiring `CMakePresets.json`
or `CMakeUserPresets.json` in the source tree. This makes the presets
feature more extensible to cases in which the user doesn't have access
to the presets defined in the source tree (e.g., if the source tree is
not writable).
For now, there is no equivalent implementation of such an option in the
`cmake-gui`, nor for the recent presets functionality implemented in
`ctest_configure` and `ctest_build`.
Fixes: #27329
Replace duplicated inline preset lookup/validation logic in cmake.cxx,
cmCTest.cxx, and cpack.cxx with a shared ResolvePreset<T> template
method on cmCMakePresetsGraph.
Use the PresetType::kind() static method introduced in commit
0f3347bb27 (cmCMakePresetsGraph: generalize printing presets of
different types) to derive error message strings, replacing the
runtime presetType string parameter with a template parameter.
Error messages for configure presets now consistently include
"configure" in the preset type (e.g., "No such configure preset")
matching the pattern used by build, test, and package presets.
The Debian `lintian` tool reported the dbgsym package issue as
`md5sums-lists-nonexistent-file`.
The DEB generator writes `md5sums` entries by stripping a top-level prefix
from each packaged file path. That used `CPACK_TEMPORARY_DIRECTORY`, which
works for regular debs but not for dbgsym packages.
Dbgsym package files are collected from `GEN_DBGSYMDIR` and passed to
`DebGenerator` with `WorkDir` rooted there. Because the `md5sums` writer
stripped `TemporaryDir` instead, the prefix did not match and absolute
staging paths leaked into `md5sums`.
Strip `WorkDir` instead. That is the actual root of `PackageFiles` for both
regular deb and dbgsym package generation, so `md5sums` entries stay
relative in both cases.
0c355dfcf7 tar: Use UTF-8 as a default encoding
21eb53e9eb tar: Add option to specify the encoding of archive pathnames
0435b76095 libarchive: Build with iconv to handle entry path encoding
24cb39e081 libarchive: Suppress upstream preference for MacPorts over macOS SDK
e07d0dacc9 cmArchiveWrite: Comment how we pass an entry pathname to libarchive
95040f37ed Tests/RunCMake/CommandLineTar: Improve formatting of error messages
e5c6c121c6 libarchive: Backport "Fix crash on failure to convert WCS/UTF-8 pathname"
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11601
Use UTF-8 by default, as this has become common for cross-platform
archive distribution, and our previous default was platform-specific.
Also revert commit f590010167 (libarchive: Restore tolerance of archives
with non-OEM paths on Windows, 2026-01-23, v3.31.11~1^2). Its primary
purpose was to tolerate UTF-8 paths when extracting archives, which we
now handle by default.
Issue: #26903
When there are two files with the same name but different content, an
error is shown, but the error does not include the filename which caused
it. This adds the filename to the error.
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.).
`include-what-you-use` diagnostics, in practice, are specific to
the environment's compiler and standard library. Update includes
to satisfy IWYU for our CI job under Debian 13. Some patterns:
* Types named in virtual `override` signatures no longer require
includes since the overridden signature already names them.
* A function argument's type needs to be included even if its constructor
is called only by implicit conversion. For example, constructing a
`std::function` from a lambda now requires `<functional>`.
* Some prior mysterious `<type_traits>` inclusions are no longer required.
`include-what-you-use` diagnostics, in practice, are specific to
the environment's compiler and standard library. Update includes
to satisfy IWYU for our CI job under Debian 13. Some patterns:
* Types named in virtual `override` signatures no longer require
includes since the overridden signature already names them.
* A function argument's type needs to be included even if its constructor
is called only by implicit conversion. For example, constructing a
`std::function` from a lambda now requires `<functional>`.
* Some prior mysterious `<type_traits>` inclusions are no longer required.
Add `CPACK_ARCHIVE_UID` and `CPACK_ARCHIVE_GID` options.
Add a policy to change the default to 0/0 to enable ownership
by root if unpacking as root.
Fixes: #12901
The explicit initialization with empty paths from commit 57bdc1a2f7
(cmState: Compute and store directory components., 2015-05-04,
v3.3.0-rc1~61^2~4) has not been needed since commit 6afd35b98a (cmState:
remove unused code, 2016-06-16, v3.7.0-rc1~90^2).
Avoid generating empty / conflicting directory components for
the installation root which is shared across components and
(except for the degenerate case of an empty installer)
will always be created implicitly.
By setting CPACK_WIX_CAB_PER_COMPONENT users can generate one
.cab per component instead of one .cab per installer.
WiX compresses .cab files in parallel.
This may potentially speed up installer creation.
May also allow larger installers (there is a 2GB per .cab limit).