Commit Graph

75024 Commits

Author SHA1 Message Date
Brad King
e1c28e5011 Merge topic 'find_package-stack'
1b946dfbfe Merge branch 'backport-4.2-find_package-stack' into find_package-stack
e8ae3645db Merge branch 'backport-4.2-find_package-stack' into find_package-stack
aae02ee60a find_package: Share package information among copies of package stack
a789c21100 Merge branch 'backport-4.2-find_package-stack' into find_package-stack
9387988626 find_package: Save package information only after successfully loading it
561ece2407 cmFindPackageStack: Restore pure value semantics
e935ed22fb find_package: Share package information among copies of package stack
5aa649d5f6 find_package: Save package information only after successfully loading it
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11887
2026-04-02 13:23:54 -04:00
Kitware Robot
f5fc584bff CMake Nightly Date Stamp 2026-04-02 00:05:10 -04:00
Brad King
cae7b0461d Merge topic 'nvhpc-cpp26'
1e9150439c NVHPC: Record C23 and C++26 support
ee9f90005b NVHPC: Add detection of C++ 26 mode

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11881
2026-04-01 13:56:12 -04:00
Brad King
1b946dfbfe Merge branch 'backport-4.2-find_package-stack' into find_package-stack 2026-04-01 13:54:11 -04:00
Brad King
e8ae3645db Merge branch 'backport-4.2-find_package-stack' into find_package-stack
Use the `-s ours` merge strategy because we've already made the changes.
2026-04-01 13:53:41 -04:00
Brad King
aae02ee60a find_package: Share package information among copies of package stack
Since commit ae373e93fb (install(PACKAGE_INFO): Add version and location
to package dependencies, 2025-07-31, v4.2.0-rc1~340^2) we add package
information to the current package's stack entry as it is discovered.
However, a nested package can cause the current package's stack entry to
be replaced by a copy with a new ordering index due to commit c6e6861e63
(install(EXPORT): Export find_dependency() calls, 2023-11-07,
v3.29.0-rc1~439^2~1).  Depending on whether imported targets were
created by the current package before finding the nested package, the
`CurrentPackageInfo` pointer is either invalidated, or left pointing at
only one of multiple copies.

Fix this by sharing a single instance of package information with all
copies of the current package's stack entry.  Keep a mutable pointer
to the current package's information only while it is still pending.
This also avoids the need to expose mutation from the package stack.

Add a test that exposes the previously-invalidated pointer to dynamic
analysis tools.

Fixes: #27730
2026-04-01 13:53:07 -04:00
Brad King
a789c21100 Merge branch 'backport-4.2-find_package-stack' into find_package-stack 2026-04-01 13:52:04 -04:00
Brad King
9387988626 find_package: Save package information only after successfully loading it
If a package configuration file sets `<PackageName>_FOUND` to false,
the package is considered not found.  Do not save its package info.

Note that this exposes an existing pointer invalidation on nested
`find_package` calls, which will be fixed in following commits.

Issue: #27730
2026-04-01 13:51:11 -04:00
Brad King
561ece2407 cmFindPackageStack: Restore pure value semantics
A stack entry's storage may be shared by other copies, so mutation is
incompatible with value semantics.  We've migrated the motivating use
case to another approach.

Revert commit b3873b8272 (cmFindPackageStack: Allow controlled mutation,
2025-07-29, v4.2.0-rc1~438^2) and commit f2bdc2176f (cmStack: New,
mutable stack class, 2025-07-29, v4.2.0-rc1~438^2~1).  Record their
parent as a second parent of this commit so `git blame` can see the
original history of the restored content.
2026-04-01 13:47:24 -04:00
Brad King
e935ed22fb find_package: Share package information among copies of package stack
Since commit ae373e93fb (install(PACKAGE_INFO): Add version and location
to package dependencies, 2025-07-31, v4.2.0-rc1~340^2) we add package
information to the current package's stack entry as it is discovered.
However, a nested package can cause the current package's stack entry to
be replaced by a copy with a new ordering index due to commit c6e6861e63
(install(EXPORT): Export find_dependency() calls, 2023-11-07,
v3.29.0-rc1~439^2~1).  Depending on whether imported targets were
created by the current package before finding the nested package, the
`CurrentPackageInfo` pointer is either invalidated, or left pointing at
only one of multiple copies.

Fix this by sharing a single instance of package information with all
copies of the current package's stack entry.  Keep a mutable pointer
to the current package's information only while it is still pending.
This also avoids the need to expose mutation from the package stack.

Add a test that exposes the previously-invalidated pointer to dynamic
analysis tools.

Fixes: #27730
2026-04-01 13:47:01 -04:00
Brad King
5aa649d5f6 find_package: Save package information only after successfully loading it
If a package configuration file sets `<PackageName>_FOUND` to false,
the package is considered not found.  Do not save its package info.

Note that this exposes an existing pointer invalidation on nested
`find_package` calls, which will be fixed in following commits.

Issue: #27730
2026-04-01 13:47:01 -04:00
Brad King
2b22c2a45f find_package: Clarify dependency ordering logic in package stack
Clarify package stack manipulation from commit c6e6861e63
(install(EXPORT): Export find_dependency() calls, 2023-11-07,
v3.29.0-rc1~439^2~1).

Issue: #27730
2026-04-01 13:47:01 -04:00
Brad King
ad50d3e3d8 Merge topic 'short-cmake-option-refs'
3d82ccbe0d Help: Add roles to abbreviate command-line options

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11883
2026-04-01 13:41:12 -04:00
Brad King
5e57306864 Merge topic 'FILE_SET-SOURCES'
c386aaebf8 FILE_SET: install and export SOURCES file set type
5c5b68f44e FILE_SET: Add support for the SOURCES type
5697bcced0 BT<> and cmLocalGenerator: Add helpers functions
42ca2a2062 cmEvaluatedTargetProperty: put declarations in namespace cm

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11863
2026-04-01 13:39:12 -04:00
Brad King
e9566afede Merge branch 'release-4.3' 2026-04-01 13:36:06 -04:00
Brad King
e8f5af42b5 Merge topic 'help-testdir'
67c84ef103 Help: Indicate that `ctest --test-dir` may be specified with a preset
02e9335d9c Help: Document that `cmake --preset` supports `-B` to override the build dir
c288ecddb2 Help: Revise versioning note for `cmake --build` with both dir and preset

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11880
2026-04-01 13:36:06 -04:00
Brad King
ed375f73b1 Merge topic 'help-testdir' into release-4.3
67c84ef103 Help: Indicate that `ctest --test-dir` may be specified with a preset
02e9335d9c Help: Document that `cmake --preset` supports `-B` to override the build dir
c288ecddb2 Help: Revise versioning note for `cmake --build` with both dir and preset

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11880
2026-04-01 13:36:04 -04:00
Kitware Robot
bad6831d5a CMake Nightly Date Stamp 2026-04-01 00:05:03 -04:00
scivision
1e9150439c NVHPC: Record C23 and C++26 support
NVHPC 26.3 documents support for `-std=c++26` [1].
The `-std=gnu*` flags were also added.

[1] https://docs.nvidia.com/hpc-sdk/archive/26.3/release-notes/index.html
2026-03-31 14:19:53 -04:00
Brad King
ee9f90005b NVHPC: Add detection of C++ 26 mode
This compiler uses GCC's standard library, and so limits `__cplusplus`
to that of the GCC toolchain.  However, it defines feature macros that
we can use to distinguish this mode.
2026-03-31 14:19:32 -04:00
Matthew Woehlke
3d82ccbe0d Help: Add roles to abbreviate command-line options
Add a handful of helper roles that allow many more command-line option
references to be written without explicit targets. Specifically, what
used to be written ':option:`--foo[=bar] <program --foo>` can now be
written ':program-option:`--foo`'. This allows many such references to
be significantly shortened.

For now, supported programs are 'cmake', 'cpack'. 'ctest',
'cmake--build' and 'cmake--install', which should cover most cases, but
more can be trivially added. Additionally, this does not make a
concerted effort to replace all existing uses, as it is intended mainly
for use in future updates.
2026-03-31 12:56:16 -04:00
scivision
67c84ef103 Help: Indicate that ctest --test-dir may be specified with a preset
In commit c971212703 (ctest: Allow --test-dir override when using
presets, 2024-04-20, v3.30.0-rc1~200^2) we forgot to update the docs.
2026-03-31 09:38:05 -04:00
scivision
02e9335d9c Help: Document that cmake --preset supports -B to override the build dir 2026-03-31 09:37:54 -04:00
Brad King
c288ecddb2 Help: Revise versioning note for cmake --build with both dir and preset
Indent docs from commit 19296f507d (cmake --build: Allow CLI build dir
to override presets, 2025-11-17, v4.3.0-rc1~472^2) inside the `--preset`
option documentation.
2026-03-31 09:36:38 -04:00
Brad King
ed6b21f478 Merge topic 'cm-ct-preset-args'
2b924b885c cmCTest: Use consistent command-line parsing for presets
f4d4700d6b cmake: Move preset argument parsing to dedicated method

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11877
2026-03-31 09:19:34 -04:00
Brad King
74b3c133e9 Merge topic 'cpack-productbuild-nicer-code'
c33955688c cmCPackProductBuildGenerator: Modernize some code

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11878
2026-03-31 09:14:22 -04:00
Brad King
2f6450402f Merge topic 'android-ndk-arm64'
39b998edee Android: Add future linux-arm64 `CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG`

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11879
2026-03-31 09:12:27 -04:00
Brad King
87d2ffc738 Merge topic 'gtest-alias'
741233a02b GoogleTest: Allow alias target in test discovery

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11876
2026-03-31 09:10:55 -04:00
Marc Chevrier
c386aaebf8 FILE_SET: install and export SOURCES file set type 2026-03-31 09:50:09 +02:00
Marc Chevrier
5c5b68f44e FILE_SET: Add support for the SOURCES type
Fixes: #27550
2026-03-31 09:49:59 +02:00
Marc Chevrier
5697bcced0 BT<> and cmLocalGenerator: Add helpers functions
* Template remove_BT<> to extract content from BT wrapper
* cmLocalGenerator::AppendDefines which take std::set<> and std::vector<BT<>> as arguments
2026-03-31 09:27:58 +02:00
Marc Chevrier
42ca2a2062 cmEvaluatedTargetProperty: put declarations in namespace cm 2026-03-31 09:27:58 +02:00
Kitware Robot
4f7e484611 CMake Nightly Date Stamp 2026-03-31 00:05:15 -04:00
Colin Cross
39b998edee Android: Add future linux-arm64 CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG
Future NDK versions may support linux `aarch64` hosts.  Teach CMake to
set `CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG` to `linux-arm64` on them.
2026-03-30 17:02:12 -04:00
vvs31415
c33955688c cmCPackProductBuildGenerator: Modernize some code 2026-03-30 16:15:14 -04:00
Daniel Pfeifer
741233a02b GoogleTest: Allow alias target in test discovery
Fixes: #24427
Fixes: #24428
2026-03-30 15:27:07 -04:00
Tyler Yankee
2b924b885c cmCTest: Use consistent command-line parsing for presets 2026-03-30 09:04:06 -04:00
Brad King
5eab2214a2 Merge topic 'rust-edition'
abe64ca2d3 Rust: Update experimental UUID
313769e766 Rust: Add support for Rust editions with Rust_EDITION target property
d0e39096b6 Rust: Fix unused import warning in RustOnly test

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11852
2026-03-30 08:32:37 -04:00
Brad King
d80d536172 Merge topic 'clang-cl-cxxmodules'
ed48feeae8 clang-cl: Add support for C++ modules
7c2bd4f534 Clang-CXX: Flatten C++ module scanning conditions to reduce nesting

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !11875
2026-03-30 08:28:17 -04:00
Kitware Robot
5d0ef5dec6 CMake Nightly Date Stamp 2026-03-30 00:11:27 -04:00
Tyler Yankee
f4d4700d6b cmake: Move preset argument parsing to dedicated method 2026-03-29 14:50:49 -04:00
Kitware Robot
3fe6b0644c CMake Nightly Date Stamp 2026-03-29 00:04:50 -04:00
Brad King
7bdb0a181c Merge topic 'ci-clang22-windows'
2fcfea26ce ci: Update LLVM/Clang to 22.1 in nightly CI jobs on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11874
2026-03-28 10:22:51 -04:00
Kitware Robot
09d3ee5104 CMake Nightly Date Stamp 2026-03-28 00:05:23 -04:00
Brad King
ed48feeae8 clang-cl: Add support for C++ modules
Since commit 4a4986d28a (cxxmodules: support command templates for BMI
compilation, 2026-03-25, v4.3.1~2^2~1) we can express module interface
unit compilation to either object files or BMI-only in a way that works
with `clang-scan-deps` and `clang-cl` together.

Fixes: #25731
2026-03-27 15:39:33 -04:00
Brad King
7c2bd4f534 Clang-CXX: Flatten C++ module scanning conditions to reduce nesting 2026-03-27 15:39:33 -04:00
Brad King
2fcfea26ce ci: Update LLVM/Clang to 22.1 in nightly CI jobs on Windows 2026-03-27 15:38:55 -04:00
Brad King
c1c6b13eb3 Merge branch 'release-4.3' 2026-03-27 09:36:09 -04:00
Brad King
3a7d797d5b CMake 4.3.1 v4.3.1 2026-03-27 09:08:31 -04:00
Brad King
a565a07eb6 Merge branch 'release-4.3' 2026-03-27 09:02:41 -04:00