Commit Graph

13042 Commits

Author SHA1 Message Date
Brad King
bb0216e0a2 Merge topic 'cxx-module-metadata'
fa10dc6c22 Experimental/CXXModules: Implement EcoStd Module Metadata parser

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11422
2025-11-19 08:53:29 -05:00
Brad King
ad4a773d0c Merge topic 'vs-slnx'
06178da668 VS: Add include_external_msproject detection of `.wapproj` type
b9ce07b85b VS: Add SLNX project types

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11428
2025-11-19 08:47:07 -05:00
Vito Gamberini
fa10dc6c22 Experimental/CXXModules: Implement EcoStd Module Metadata parser
Adds a parser and serializer for the EcoStd Module Metadata format

RFC: https://github.com/ecostd/rfcs/pull/3

This adapts the existing experimental support for import std; to use
the new parser. The CMAKE_CXX_STDLIB_MODULES_JSON is now the canonical
variable for controlling how CMake discovers the stdlib module metadata,
and is used directly by compiler detection.

Toolchains can still override the __CMAKE::CXX## targets if they wish,
either in conjunction with CMAKE_CXX_STDLIB_MODULE_JSON or not. It is
possible to disable automatic detection of
CMAKE_CXX_STDLIB_MODULE_JSON by setting it to the empty string.

When available, the CMAKE_CXX_STDLIB_MODULE_JSON will be used to create
all requested C++ stdlibs which do not already have targets.
2025-11-18 11:39:59 -05:00
Brad King
06178da668 VS: Add include_external_msproject detection of .wapproj type
It is a Windows Application Packaging Project.

Issue: #27392
2025-11-18 11:18:17 -05:00
Brad King
b9ce07b85b VS: Add SLNX project types
Extend commit e6aa7742b0 (VS: Generate .slnx files for VS 2026,
2025-09-17, v4.2.0-rc1~151^2) to add the `Type=` attribute on SLNX
`<Project>` elements.

Fixes: #27392
2025-11-18 11:10:22 -05:00
Brad King
6087f56da9 Merge topic 'GenEx-STRING'
fd7e305097 GenEx: Add $<STRING> generator expression
7564cbae12 GenEx: add new expressions for string comparisons
dab5e6ebb1 introduce cm::CMakeString class as helper for string() command
34c0c7754f cmString: add methods append and insert
ab60f1a010 Extend usage for cm::string_view for more flexibility

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11382
2025-11-15 09:10:50 -05:00
Brad King
fcd9b4de43 Merge topic 'split-cxxmodules-testing'
3e7ffddf2f Tests/CXXModulesCompile: remove excess `examples/` directory
beabe25af1 Tests/CXXModulesCompile: rename examples to be shorter
9a8700296c Tests/CXXModules: split out compilation tests
2d988b7ec8 Tests/CXXModules: remove unused file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11300
2025-11-15 09:07:21 -05:00
Brad King
1b099307e4 Merge topic 'test-cmake-gui'
551937b4fb ci: Suppress hanging CMakeGUI test on macos-x86_64 jobs
2e5442eef5 Tests/CMakeGUI: Avoid QtTest internal timeout before ctest's timeout

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11421
2025-11-15 09:06:09 -05:00
Brad King
42d94ff876 Merge topic 'file-GET_RUNTIME_DEPENDENCIES-matching'
bf3f69834d file(GET_RUNTIME_DEPENDENCIES): Normalize paths before matching

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !11351
2025-11-15 09:03:56 -05:00
Brad King
4e85f9078d Merge topic 'vs-slnx'
70ed720232 VS: Add SLNX default startup project

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11420
2025-11-15 09:01:50 -05:00
Brad King
2e5442eef5 Tests/CMakeGUI: Avoid QtTest internal timeout before ctest's timeout
Issue: #27376
2025-11-14 15:22:25 -05:00
Brad King
70ed720232 VS: Add SLNX default startup project
At the time of commit e6aa7742b0 (VS: Generate .slnx files for VS 2026,
2025-09-17, v4.2.0-rc1~151^2), the VS 18 Insiders edition did not offer
support for specifying a default startup project in `.slnx` files.
This has since been added, so use it.

Fixes: #27387
2025-11-14 11:03:57 -05:00
Marc Chevrier
fd7e305097 GenEx: Add $<STRING> generator expression
Fixes: #27188
2025-11-14 16:44:29 +01:00
Marc Chevrier
7564cbae12 GenEx: add new expressions for string comparisons 2025-11-14 16:44:29 +01:00
Brad King
3566a30938 Merge topic 'vs-slnx'
7c284f4278 VS: Fix SLNX with multiple solution-to-project configuration mappings

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11415
2025-11-14 09:46:33 -05:00
Ben Boeckel
3e7ffddf2f Tests/CXXModulesCompile: remove excess examples/ directory
Now that the test is split, it doesn't make sense to have the directory
anymore. It also helps with shortening paths.
2025-11-14 09:27:00 -05:00
Ben Boeckel
beabe25af1 Tests/CXXModulesCompile: rename examples to be shorter
Perform the following renames on the example directory names to avoid
long paths:

- `build-database` → `builddb`
- `export` → `exp`
- `import` → `imp`
- `include-directories` → `incdirs`
- `interface` → `iface`
- `module` → `mod`
- `private` → `priv`
- `property` → `prop`
- `properties` → `props`
- `transitive` → `trans`
2025-11-14 09:27:00 -05:00
Ben Boeckel
9a8700296c Tests/CXXModules: split out compilation tests
The test is getting fairly large and timing out more and more often.
Split out actual compilation tests.
2025-11-14 09:26:51 -05:00
hanna.rusakovich
bf3f69834d file(GET_RUNTIME_DEPENDENCIES): Normalize paths before matching
Regex-based filtering should not have to account for slash differences.
Add policy CMP0207 for compatibility.

Fixes: #26202
2025-11-14 17:23:26 +03:00
Brad King
7c284f4278 VS: Fix SLNX with multiple solution-to-project configuration mappings
Filter each mapping to apply only to its intended solution-wide config.

Fixes: #27385
2025-11-13 12:01:51 -05:00
Brad King
8832f78dd6 IWYU: Update for Debian 13 CI job
`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.
2025-11-12 14:54:35 -05:00
Brad King
f49b0e6759 IWYU: Update for Debian 13 CI job
`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.
2025-11-12 14:54:16 -05:00
Brad King
3653b3e95e Merge branch 'backport-ci-debian-13' into ci-debian-13 2025-11-12 14:44:43 -05:00
Brad King
a0642acbce FindImageMagick: Fix detection of version 7 from headers 2025-11-12 14:35:11 -05:00
Brad King
038cb65bc6 Tests/FindJNI/Minimal: Fix test for Java 24 and above 2025-11-12 14:35:10 -05:00
Brad King
02f3f5d801 Merge topic 'cmake-E-copy-system-errors'
fb7a904e90 cmcmd: report system errors on more filesystem operations
4795cb6550 Merge branch 'upstream-KWSys' into cmake-E-copy-system-errors
dc8cc945ee KWSys 2025-11-12 (1139f8a0)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11401
2025-11-12 11:59:48 -05:00
Frank Winklmeier
fb7a904e90 cmcmd: report system errors on more filesystem operations
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
2025-11-12 11:53:35 -05:00
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
8ff110d4be Merge topic 'test-pch'
dac2823975 Tests: Split RunCMake.PrecompileHeaders into multiple tests

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !11410
2025-11-12 11:49:10 -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
dac2823975 Tests: Split RunCMake.PrecompileHeaders into multiple tests
The test runs many cases serially.  Split them into two groups to
enable more concurrency and shorter tests.
2025-11-11 14:11:32 -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
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
666f0b1173 Merge topic 'test-libarchive-3.8.2' into release-4.2
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:21:31 -05:00
Brad King
5c1ec64d20 Merge branch 'test-libarchive-3.8.2' into update-libarchive 2025-11-10 15:11:31 -05:00
Brad King
576117b7eb Tests: Update expected Zstandard magic number for libarchive 3.8.2
libarchive 3.8.2 enabled Zstandard's checksum feature in the zstd write
filter.  Update our tests' expected results accordingly.

Fixes: #27355
Reported-by: Funda Wang <fundawang@yeah.net>
2025-11-10 15:11:10 -05:00
Ben Boeckel
2d988b7ec8 Tests/CXXModules: remove unused file 2025-11-10 14:48:44 -05:00
Brad King
1803eda9f7 CPack/RPM: Backport "Fix detection of RPM support for weak dependencies"
Backport commit 283a48403f (CPack/RPM: Fix detection of RPM support for
weak dependencies, 2025-02-28, v4.0.0-rc3~8^2) to CMake 3.31.

Fixes: #27373
2025-11-10 11:40:49 -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
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
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
Brad King
e290d4f2a3 cmake: Infer command set from role 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
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
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