Commit Graph
39247 Commits
Author SHA1 Message Date
Kitware Robot 0ae58dfa7a CMake Nightly Date Stamp 2026-04-03 00:04:48 -04:00
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 1b946dfbfe Merge branch 'backport-4.2-find_package-stack' into find_package-stack 2026-04-01 13:54:11 -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 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 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 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 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
Kitware Robot bad6831d5a CMake Nightly Date Stamp 2026-04-01 00:05:03 -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
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
vvs31415 c33955688c cmCPackProductBuildGenerator: Modernize some code 2026-03-30 16:15:14 -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
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
Kitware Robot 09d3ee5104 CMake Nightly Date Stamp 2026-03-28 00:05:23 -04:00
Brad King 3a7d797d5b CMake 4.3.1 2026-03-27 09:08:31 -04:00
Brad King cfbb1649dd CMake 4.2.4 2026-03-27 08:25:44 -04:00
Brad King 7a8f6cc160 Merge topic 'discover-tests'
4e34426fb3 TestDriver: Add '-N' option to print all tests
b7f83c37a4 create_test_sourcelist: Document command line arguments
8600ce6547 discover_tests: Add documentation
969999fa9f discover_tests: Add tests
3947842733 discover_tests: Add CMake command implementation
3f1fce6b48 discover_tests: Add CTest command implementation
d718a979b7 cmTestGenerator: Allow to be inherited from

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11758
2026-03-27 07:38:38 -04:00
Brad King 0e47cd8c7b Merge topic 'bmi-only-command-template'
7ebb5687ab cmGeneratorTarget: use typename for `flag`
4a4986d28a cxxmodules: support command templates for BMI compilation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11871
2026-03-27 07:36:26 -04:00
Kitware Robot 0b4a69d046 CMake Nightly Date Stamp 2026-03-27 00:05:03 -04:00
Baudouin Feildel abe64ca2d3 Rust: Update experimental UUID 2026-03-26 23:15:58 +01:00
Baudouin Feildel 313769e766 Rust: Add support for Rust editions with Rust_EDITION target property 2026-03-26 23:15:58 +01:00
Ben Boeckel 7ebb5687ab cmGeneratorTarget: use typename for flag
Since the typename doesn't show up on the right side.
2026-03-26 13:20:19 -04:00
Ben Boeckel 4a4986d28a cxxmodules: support command templates for BMI compilation
Some compilers (Clang) warn when using their BMI-only flag with `-c`.
Support a complete template for BMI compilation rather than an
additional flag to support such toolchains.

Fixes: #27600
2026-03-26 13:20:19 -04:00
Brad King 75e2046af7 Merge topic 'autogen-enable-depfiles'
680fbb112a Autogen: Enable depfile support for Visual Studio and Xcode generators
d9f569c246 Autogen: Skip per-compilation dep reading when depfile merge is used

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11844
2026-03-26 10:49:19 -04:00
Daniel Pfeifer 3947842733 discover_tests: Add CMake command implementation 2026-03-26 10:36:21 -04:00
Daniel Pfeifer 3f1fce6b48 discover_tests: Add CTest command implementation 2026-03-26 10:36:21 -04:00
Daniel Pfeifer d718a979b7 cmTestGenerator: Allow to be inherited from 2026-03-26 10:36:21 -04:00
Brad King 811768e742 Merge topic 'file-archive-path-encoding'
97455c3d7e file: Add `ARCHIVE_*` options to specify pathname encoding
25af9288f9 Tests/RunCMake/File_Archive: Match expected errors more extensibly

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11853
2026-03-26 10:20:04 -04:00
Kitware Robot 7326c9b7c3 CMake Nightly Date Stamp 2026-03-26 00:05:00 -04:00
Brad King 3faeb49175 Merge topic 'include-cleanup'
df9b089720 Source: Remove unnecessary `#include` on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11849
2026-03-25 11:57:48 -04:00
Brad King 5c2db18281 Merge topic 'vs-fortran'
a380179285 Tests: Fix FortranOnly test with Intel Fortran VS integration
e75e912601 Tests: Fix FortranCInterface test with MSVC+IntelLLVM
1146a66d60 VS: Fix regression in Fortran project generation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11860
2026-03-25 11:48:01 -04:00
Brad King a2b39b756a Merge topic 'vs-fortran' into release-4.3
a380179285 Tests: Fix FortranOnly test with Intel Fortran VS integration
e75e912601 Tests: Fix FortranCInterface test with MSVC+IntelLLVM
1146a66d60 VS: Fix regression in Fortran project generation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11860
2026-03-25 11:47:59 -04:00
Joerg Bornemann 680fbb112a Autogen: Enable depfile support for Visual Studio and Xcode generators
Extend the depfile-based AUTOGEN incremental build support to Visual
Studio and Xcode generators, in addition to the existing Ninja and
Makefile support.  Use generator name matching rather than
SupportsCustomCommandDepfile() to select generators explicitly, because
not all generators that claim depfile support handle the resulting build
graph correctly.  In particular, when depfiles are used, CMake introduces
a _autogen_timestamp_deps utility target to express ordering constraints,
and the FASTBuild generator does not correctly propagate dependencies
through utility targets that have no commands, breaking the build when
generated files are AUTOMOC inputs.

When depfiles are used, disable the PRE_BUILD optimization for Visual
Studio because PRE_BUILD events cannot carry depfile dependencies.

Fixes: #25233
Fixes: #25234
2026-03-25 09:05:58 +01:00
Kitware Robot 970bc5b711 CMake Nightly Date Stamp 2026-03-25 00:05:01 -04:00
Moyo Okeremi df9b089720 Source: Remove unnecessary #include on Windows
These are not covered by the IWYU job in CI.
2026-03-24 14:19:31 -04:00
AJIOB 97455c3d7e file: Add ARCHIVE_* options to specify pathname encoding
Issue: #26903
2026-03-24 14:07:21 -04:00
Brad King c0e951865c Merge topic 'revert-per-importer-bmi' into release-4.3
c68b587abe c++modules: Fully revert implementation of per-importer BMIs for 4.3

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11864
2026-03-24 13:16:54 -04:00