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.)
Since commit 5420639a8d (cmExecuteProcessCommand: Replace cmsysProcess
with cmUVProcessChain, 2023-06-01, v3.28.0-rc1~138^2~8) we have not
actually terminated child processes on an `execute_process` timeout.
Similarly for other migrations from cmsysProcess to cmUVProcessChain.
Teach cmUVProcessChain clients that implement timeouts to actually
terminate remaining child processes when the timeout is reached.
Fixes: #27378
ffce9fa39c Utilities: Update hard-coded try_compile results for libarchive 3.8.2
3c91d4427d libarchive: Set build options the way we need for CMake
c0354ddf83 Merge branch 'upstream-LibArchive' into update-libarchive
73b8b633a7 LibArchive 2025-10-15 (7f53fce0)
93620e671b libarchive: Update script to get 3.8.2
5c1ec64d20 Merge branch 'test-libarchive-3.8.2' into update-libarchive
576117b7eb Tests: Update expected Zstandard magic number for libarchive 3.8.2
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11402
40b093649b cmake: Avoid calling GetCMakeListFile with empty directory
f6b3ba5f55 CMP0198: Maintain CMAKE_PARENT_LIST_FILE only when configuring projects
3593aa59ef cmake: Replace working mode with role
accfa7fa81 cmake: Infer command failure action from role
e290d4f2a3 cmake: Infer command set from role
bfaaec6179 cmake --workflow: Convert implementation to internal role
ea5d04975e cmake --build: Convert implementation to internal role
0b83750e14 cmake: Clarify name of role of internal instances
...
Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11395
Since commit 5420639a8d (cmExecuteProcessCommand: Replace cmsysProcess
with cmUVProcessChain, 2023-06-01, v3.28.0-rc1~138^2~8) we've
occasionally observed immediate timeouts on processes that take longer
than the timeout to start, even though we only start the timer after the
child processes start. The problem is that:
* `uv_loop_init` initializes `uv_loop_t`'s cached "now" time.
* Starting processes takes time but does not update the "now" time.
* `uv_timer_start` computes expiry relative the cached "now" time,
so short timers may be expired as soon as they are started.
* `uv_run` invokes expired timer callbacks before polling for I/O
or process completion, so we "timeout" immediately.
Fix this by updating the cached "now" time via `uv_update_time` just
before starting timers. This is needed only for timers that start
before the `uv_run` event loop. Update our `uv_timer_ptr` wrapper
to make all callers consider the choice when calling `start()`.
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
Previously it initialized as `PROJECT` but didn't actually add any
commands. This was likely copied from the `--build` implementation,
which has since been converted to `INTERNAL` too.
Previously it initialized as `PROJECT` to support reconfiguration with
VS generators, but didn't actually add any commands until needed.
Instead initialize as the `INTERNAL` role and update when adding
commands.
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).
The save/restore from commit 427b6da9e5 (VS: Teach `cmake --build` to
reconfigure if needed before building, 2016-09-16, v3.8.0-rc1~290^2)
is unnecessary because `cmake::Build` does not rely on the source
and build directory being initialized.
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
Change cmPackageInfoReader::SetMetaProperty to just take the property
name as a std::string. We end up constructing one when we call
cmTarget::SetProperty, so we might as well do it up front and be done
with it. (Before, we were converting a string_view to char*, which is
decidedly non-optimal.)
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.