Commit Graph

38396 Commits

Author SHA1 Message Date
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
Brad King 8a2f0e819b Merge topic 'typos-1.39.0'
1405dc49e8 pre-commit: version bump `typos` and `sphinx-lint` hooks + fix found typos

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11380
2025-11-04 11:24:40 -05:00
Brad King 519d69c92c Merge topic 'typos-1.39.0' into release-4.2
1405dc49e8 pre-commit: version bump `typos` and `sphinx-lint` hooks + fix found typos

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11380
2025-11-04 11:24:30 -05:00
Brad King 070ddd6732 Merge topic 'fbuild_fix_superfluous_dirs'
2a5855f034 FASTBuild: fix superfluous directory creation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11379
2025-11-04 10:47:08 -05:00
Brad King 0f18aa010e ci: Update to Qt 6.9.3 on macOS
Get Qt updates fix `cmake-gui` button rendering when compiled with a
macOS 26 SDK.

Issue: #27325
2025-11-04 09:58:38 -05:00
Kitware Robot 7956f3c5c2 CMake Nightly Date Stamp 2025-11-04 00:07:00 -05:00
Brad King 2ae318bb5d cmake-gui: Install only necessary plugins for Qt 6 2025-11-03 11:05:04 -05:00
Brad King 74dec2c7fd cmake-gui: Detect Qt lib directory on macOS more robustly
Avoid assuming a specific path within a framework.
2025-11-03 11:05:04 -05:00
Brad King 0d1321770d cmake-gui: Clarify signature of QCheckBox::checkStateChanged callbacks
In commit cbf0d3da52 (cmake-gui: Port away from deprecated API in Qt >=
6.7, 2025-02-21, v4.1.0-rc1~755^2~4) we assumed that `Qt::CheckState` is
implemented as an `int`.  Spell out the type explicitly for the Qt 6.7+
callback signatures.
2025-11-03 11:05:04 -05:00
Alex Turbov 1405dc49e8 pre-commit: version bump typos and sphinx-lint hooks + fix found typos 2025-11-03 10:18:16 -05:00
Eduard Voronkin 2a5855f034 FASTBuild: fix superfluous directory creation
Fixes: #27356
2025-11-03 09:39:16 -05:00
Brad King 586cf25827 Merge topic 'cmake-gui-macos-install'
7ebad5d201 cmake-gui: Refactor installation into CMake.app/Contents on macOS
a65d986850 cmake-gui: Simplify macOS bundle version logic
91bb70cfcb Source: Factor out common parts of install layout variable loop item names

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !11376
2025-11-03 08:35:45 -05:00
Kitware Robot 80d912e768 CMake Nightly Date Stamp 2025-11-03 00:09:28 -05:00
Kitware Robot 3a5a3af5d1 CMake Nightly Date Stamp 2025-11-02 00:04:41 -04:00
Kitware Robot 00f5aa25a3 CMake Nightly Date Stamp 2025-11-01 00:05:18 -04:00
Brad King 7ebad5d201 cmake-gui: Refactor installation into CMake.app/Contents on macOS
Instead of mutating `CMAKE_INSTALL_PREFIX`, add a `CMake.app/Contents/`
prefix to install destinations besides the `cmake-gui` target itself.
2025-10-31 09:33:52 -04:00
Brad King a65d986850 cmake-gui: Simplify macOS bundle version logic 2025-10-31 09:33:51 -04:00
Brad King 91bb70cfcb Source: Factor out common parts of install layout variable loop item names 2025-10-31 09:33:51 -04:00
Brad King 5524773d57 Merge topic 'ci-fedora-43'
2338d987d5 ci: use Fedora 43 images and environments
5219f383fe ci: update Fedora base images to Fedora 43
373e8ea652 clang-tidy: ignore warnings new in version 21
e12ce158bc clang-tidy: fix bugprone-unintended-char-ostream-output lint
2ca11db2e3 pre-commit: version bump `typos` hook plus fix found typos
d314d85ea5 Tests: Extend RunCMake.ParseImplicitLinkInfo for LLVMFlang 21.1.3
b7ad081f1a Tests: Fix RunCMake.CXXModules compilation with Clang 21

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11375
2025-10-31 07:12:29 -04:00
Hanna Rusakovich a73ddd2ddb file(CREATE_LINK): Implement COPY_ON_ERROR for directories
Add policy `CMP0205` for compatibility with projects not expecting this.

Fixes: #27294
2025-10-31 08:42:59 +03:00
Brad King f719a36bc0 file(CREATE_LINK): Refactor error handling for removal of destination
Avoid relying on global state.
2025-10-31 08:42:59 +03:00
Brad King a2a626055b cmSystemTools: Return KWSys Status from RepeatedRemoveDirectory
This provides the OS-reported error on failure.
2025-10-31 08:42:59 +03:00
Kitware Robot f9fcb89eba CMake Nightly Date Stamp 2025-10-31 00:04:57 -04:00
Brad King e12ce158bc clang-tidy: fix bugprone-unintended-char-ostream-output lint 2025-10-30 17:43:17 -04:00
Alex Turbov 2ca11db2e3 pre-commit: version bump typos hook plus fix found typos
Backport commit 8de02a14c8 (ci(pre-commit): version bump `typos` hook
plus fix found typos, 2025-10-23) to the CMake 4.2 release branch.
2025-10-30 17:43:16 -04:00
Brad King a86b6c4db4 CMake 4.2.0-rc2 2025-10-30 09:03:07 -04:00