Commit Graph

38422 Commits

Author SHA1 Message Date
Brad King
515bb02443 Merge topic 'package-info-from-install-export'
34343922a5 install: Add ability to generate CPS from install(EXPORT)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11315
2025-11-12 11:53:07 -05:00
Brad King
4c1ace5fba Merge topic 'fbuild_byproducts'
b1b3602cda FASTBuild: remove non-existent autogen byproducts

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11405
2025-11-12 11:47:16 -05:00
Brad King
31c38f722a Merge topic 'fbuild_unique_names'
d6bc1a8a50 FASTBuild: rename test target to RUN_TESTS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11403
2025-11-12 11:42:13 -05:00
Brad King
3529a96ba5 Merge topic 'process-timeout-terminate'
3dc641d99c Merge branch 'backport-3.31-process-timeout-terminate'
22e84c7e7f execute_process: Restore termination of processes on timeout
e2cfc61e5e execute_process: Restore termination of processes on timeout

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11408
2025-11-12 10:53:50 -05:00
Kitware Robot
3454109c42 CMake Nightly Date Stamp 2025-11-12 00:06:38 -05:00
Matthew Woehlke
34343922a5 install: Add ability to generate CPS from install(EXPORT)
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.)
2025-11-11 11:51:58 -05:00
Brad King
22e84c7e7f execute_process: Restore termination of processes on timeout
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
2025-11-11 09:10:29 -05:00
Eduard Voronkin
b1b3602cda FASTBuild: remove non-existent autogen byproducts
Fixes: #27374
2025-11-11 08:59:44 -05:00
Eduard Voronkin
d6bc1a8a50 FASTBuild: rename test target to RUN_TESTS
Avoid case-insensitive conflicts with project targets called `Test`.

Fixes: #27372
2025-11-11 08:54:54 -05:00
Brad King
174fca1854 Merge topic 'update-libarchive'
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
2025-11-11 08:23:26 -05:00
Kitware Robot
86e8bd3b4b CMake Nightly Date Stamp 2025-11-11 00:04:28 -05:00
Brad King
3c91d4427d libarchive: Set build options the way we need for CMake 2025-11-10 15:12:47 -05:00
Brad King
8b32e8c057 CMake 4.2.0-rc3 2025-11-10 09:55:31 -05:00
Brad King
6dcfe66085 Merge topic 'cpack-archive-ownership'
5a18728cec CPack/Archive: Add support for setting UID/GID in archive

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11353
2025-11-10 09:15:13 -05:00
Brad King
deb70f536e Merge topic 'cmake-init'
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
2025-11-10 09:13:42 -05:00
Brad King
06b3095df7 Merge topic 'process-timeout-short'
6ec2c51f0c execute_process: Restore support for short timeouts

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !11399
2025-11-10 09:08:41 -05:00
Brad King
5d69468679 Merge topic 'process-timeout-short' into release-4.2
6ec2c51f0c execute_process: Restore support for short timeouts

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !11399
2025-11-10 09:08:39 -05:00
Brad King
1ec4e64227 Merge topic 'process-timeout-short' into release-4.0
6ec2c51f0c execute_process: Restore support for short timeouts

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11399
2025-11-10 09:06:55 -05:00
Kitware Robot
c3ba7ecaa5 CMake Nightly Date Stamp 2025-11-10 00:09:46 -05:00
Brad King
6ec2c51f0c execute_process: Restore support for short timeouts
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()`.
2025-11-09 09:13:43 -05:00
Kitware Robot
11b487d841 CMake Nightly Date Stamp 2025-11-09 00:07:11 -05:00
Clinton Stimpson
5a18728cec CPack/Archive: Add support for setting UID/GID in archive
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
2025-11-08 09:25:08 -05:00
Kitware Robot
d90e073cdd CMake Nightly Date Stamp 2025-11-08 00:06:41 -05:00
Brad King
40b093649b cmake: Avoid calling GetCMakeListFile with empty directory 2025-11-07 09:35:55 -05:00
Brad King
f6b3ba5f55 CMP0198: Maintain CMAKE_PARENT_LIST_FILE only when configuring projects
Revise commit 41aea12941 (Do not define CMAKE_PARENT_LIST_FILE in
CMakeLists.txt, 2025-07-05, v4.2.0-rc1~505^2).
2025-11-07 09:35:55 -05:00
Brad King
3593aa59ef cmake: Replace working mode with role 2025-11-07 09:35:55 -05:00
Brad King
accfa7fa81 cmake: Infer command failure action from role 2025-11-07 09:35:55 -05:00
Brad King
e290d4f2a3 cmake: Infer command set from role 2025-11-07 09:35:54 -05:00
Brad King
bfaaec6179 cmake --workflow: Convert implementation to internal role
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.
2025-11-07 09:35:54 -05:00
Brad King
ea5d04975e cmake --build: Convert implementation to internal role
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.
2025-11-07 09:35:54 -05:00
Brad King
0b83750e14 cmake: Clarify name of role of internal instances
These instances do not run arbitrary cmake language code.
2025-11-07 09:35:54 -05:00
Brad King
57ea73f289 cmake: Load options scripts in script role
Some code paths load `.cmake` scripts to get `set(...)` options.
2025-11-07 09:35:54 -05:00
Brad King
0aab75bf0e cmake: Clarify name of enum backing CMAKE_ROLE property 2025-11-07 09:35:53 -05:00
Brad King
9e36f22684 cmake: Clarify name of enum identifying set of commands added 2025-11-07 09:35:53 -05:00
Brad King
5078d5be4f cmake: Clarify name of enum identifying try_compile 2025-11-07 09:35:53 -05:00
Brad King
e62cd22172 cmake: Avoid initializing with empty source and build paths 2025-11-07 09:35:53 -05:00
Brad King
4a2d32e7c4 cmake: Remove unnecessary initialization of empty source and build paths
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).
2025-11-07 09:35:52 -05:00
Brad King
28610de96b cmake --build: Consolidate role upgrade to reconfigure VS projects 2025-11-07 09:35:52 -05:00
Brad King
cc9290f983 cmake --build: Remove unnecessary source and build directory tracking
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.
2025-11-07 09:35:52 -05:00
Brad King
c3b4462147 cmCMakeLanguageCommand: Drop always-true condition 2025-11-07 09:35:52 -05:00
Kitware Robot
b8de18df08 CMake Nightly Date Stamp 2025-11-07 00:09:13 -05:00
Brad King
b95d5b31ab Merge topic 'fix-cps-crash-on-bad-input'
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
2025-11-06 13:26:13 -05:00
Brad King
55b083c4a6 Merge topic 'improve-cps-find_package-failure-reporting'
6c2fc502b6 find_package: Report why a candidate was rejected

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11377
2025-11-06 13:24:38 -05:00
Kitware Robot
6b0663f860 CMake Nightly Date Stamp 2025-11-06 00:07:04 -05:00
Matthew Woehlke
fa4bed7844 cmPackageInfoReader: Don't crash if input is malformed
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
2025-11-05 11:29:13 -05:00
Matthew Woehlke
be99a82eee cmPackageInfoReader: Just use std::string
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.)
2025-11-05 10:46:09 -05:00
Matthew Woehlke
6c2fc502b6 find_package: Report why a candidate was rejected
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.
2025-11-05 10:45:23 -05:00
Brad King
7bcdf7353a Merge topic 'ci-macos-qt-6.9.3'
3f21bf9f0a ci: Restore packaging with macOS SDK from Xcode
c1ee4d57dc Utilities/Release: Remove unused Qt 5.15.2 build script for macOS
0f18aa010e ci: Update to Qt 6.9.3 on macOS
2ae318bb5d cmake-gui: Install only necessary plugins for Qt 6
74dec2c7fd cmake-gui: Detect Qt lib directory on macOS more robustly
0d1321770d cmake-gui: Clarify signature of QCheckBox::checkStateChanged callbacks
a49e5c8eb9 Utilities/Release: Teach macOS notarization script to sign Qt artifacts

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11386
2025-11-05 10:22:20 -05:00
Kitware Robot
1463723e4a CMake Nightly Date Stamp 2025-11-05 00:06:13 -05:00
Brad King
8d16842e33 Merge topic 'file-CREATE_LINK-COPY_ON_ERROR-dir'
a73ddd2ddb file(CREATE_LINK): Implement COPY_ON_ERROR for directories
f719a36bc0 file(CREATE_LINK): Refactor error handling for removal of destination
0448f646a8 file(CREATE_LINK): Factor out dedicated test
a2a626055b cmSystemTools: Return KWSys Status from RepeatedRemoveDirectory

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11311
2025-11-04 12:02:47 -05:00