`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.
Print the system error message in case of failure when calling
`CopyFileAlways`, `CopyFileIfDifferent`, `CopyFileIfNewer`,
`CopyADirectory` and `MakeDirectory`.
Remove unnecessary `cmSystemTools` wrappers for `CopyFileIfNewer` and
`CopyADirectory`.
Fixes: #18276
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.)
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
fa4bed7844 cmPackageInfoReader: Don't crash if input is malformed
be99a82eee cmPackageInfoReader: Just use std::string
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11390
Check all instances of converting a JSON value to a string to ensure
that we check first if the value is convertible, in order to avoid an
exception being thrown, which crashes CMake. Modify some instances to
report when we encounter such invalid values. (Many instances, however,
just silently ignore invalid values.)
Fixes: #27350
Improve how find_package reports the list of candidate package
configuration files that were considered but rejected to include a
reason for rejection. For CPS in particular, this allows the user to
tell if a CPS file was rejected due to a version mismatch, missing
required components, or because the file could not be read.
While we do not try to report more detail for why cmPackageInfoReader
rejected a file, the possible reasons are usually easy enough to
distinguish:
- The file is so malformed that we cannot read a JSON object.
- The schema version is not a version that CMake understands.
- The root object does not contain a string named "name".
- The root object does not contain an object named "components".
- Prefix resolution failed.
Three of these can only result from a file that fails schema validation.
Remove entries from the codespell ignore list that do not seem to be
present any more. Also, remove a deliberate typo and instead add a local
annotation to ignore it.
This list is still uncomfortably long, but unfortunately current
versions of codespell do not offer any granularity in between annotating
individual uses (which is not practical in most cases) or globally
ignoring words (which is overly broad and risks missing real errors).
Clang 21 now enforces placement of the module declaration:
.../scan_properties/module.cxx:7:8: error: module
declaration must occur at the start of the translation unit
Adds a "Step 0" to the tutorial which discusses minutia about where to
get CMake, how to run it, and most importantly deals at length with
various generator issues which aren't covered elsewhere.
8fa4a4bf67 Makefiles: Position target-wide link flags consistently with other generators
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11355
6a35c277d0 FindPython: Support getting DEBUG_POSTFIX without requiring Interpreter
43fec72adb Tests: Fix RunCMake.UseSWIG SetPOSTFIX case on Windows
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11345
Give the actual exit code of the command from the snippet as intended;
currently, this always gives 0 for sub-commands like compile and link,
as well as `ctest`.
For now, the result in build snippets will be `null`.
When CPS export fails due to a dependency on an improperly named
external target, reiterate the "canonical namespace" in the error
message for clarity.
When given the name of a project that doesn't exist, report it as an
"unknown project" rather than an "invalid project". This is more
consistent with other, similar reporting.