78225 Commits
Author SHA1 Message Date
Tyler Yankee 25abbc4ad4 Genex: Fix crash on out of range LIST index 2026-11-02 09:02:15 -05:00
Mickaël Germain 37b38a29b6 cmake: Add CMAKE_LISTFILE_COVERAGE_DIR to record listfile coverage
Projects test their CMake code, but no tool tells them which parts of
that code their tests run.  Add a `CMAKE_LISTFILE_COVERAGE_DIR`
environment variable.  When it names a directory, each `cmake` process
that runs CMake language code records which lines of each listfile ran
and how many times each function and macro was called.  At exit the
process writes one lcov tracefile, `<pid>-<token>.info`, into that
directory.  An empty value means off.  A relative path, or a directory
that cannot be written, is an error at startup.

Configure, script mode, `cmake --install`, `try_compile` projects, and
a re-run of configure from the build system record coverage.
`cmake --build`, `cmake -E`, `--help`, `--version`, and a
`--check-build-system` step that does not re-run configure do not
record, because they run no user code.

The collector registers each file when CMake parses it, and counts a
hit for each command that `cmMakefile::ExecuteCommand` runs.  A command
counts on the line where it starts.  `else()` and the `end*()` commands
do not count.  `elseif()` counts each time its condition is evaluated,
through a hook in `cmIfCommand`.  Function and macro bodies count on
their lines in the file that defines them, and each definition gets an
lcov `FN` record with the number of calls.  If one file defines the
same name more than once, each record name gets an `@<line>` suffix.
Commands that another command runs on the same line, such as those of
`cmake_language(CALL)` and `list()` callbacks, add no hit.  Code from
`cmake_language(EVAL CODE)` is left out, because it has no file.

Add `cmLcovTracefile` to read, merge, and write lcov tracefiles, so
that later changes can merge per-process files in ctest and read them
in `ctest_coverage()`.

Issue: #28192
2026-11-01 22:42:38 -08:00
Kitware Robot 4e0fa8da34 CMake Nightly Date Stamp 2026-11-02 00:14:52 -05:00
Tyler Yankee 859a40b291 cmSubcommandTable: Implement closest string for invalid subcommand 2026-11-01 13:58:09 -05:00
Tyler Yankee ba61d59840 presets: Implement closest string for invalid preset 2026-11-01 13:53:58 -05:00
Tyler Yankee 2603725ccc presets: Extend ResolvePreset to workflow presets
Replace the inline workflow preset lookup and validation with the
shared utilities used by the other preset types, from commit e99fbf4100
(Presets: Extract ResolvePreset utility for preset resolution,
2026-04-21, v4.4.0-rc1~284^2).
2026-11-01 13:47:06 -05:00
Kitware Robot 8e91f7aa9b CMake Nightly Date Stamp 2026-11-01 00:05:35 -04:00
Sergiu Deitsch 07dbb31e69 GenerateExportHeader: Support deprecation messages
Add message variants of the deprecation macros. With CXX_ATTRIBUTES,
prefer the standard [[deprecated]] as of C++14 and place it before the
export marker, since a C++11 attribute cannot follow __declspec.

Fixes: #20527
2026-10-31 13:54:22 +01:00
Tyler Yankee 0fcac5aa18 clang-tidy: Enable checks that have no existing violations 2026-10-31 07:02:29 -04:00
Kitware Robot 66c683b203 CMake Nightly Date Stamp 2026-10-31 00:06:25 -04:00
Sergiu Deitsch 3110f265a9 FILE_SET: Evaluate usage requirements per consumer
$<TARGET_PROPERTY:prop> in the interface compile requirements of a file
set read the owner's property, and the result was shared by all
consumers. Evaluate with the consumer as head target and the owner as
current target, and cache per consumer.

Fixes: #28207
2026-10-30 22:45:22 +01:00
Sergiu Deitsch cafd167ba3 cmTargetPropertyEntry: Accept a file set
Evaluate entries of a file set with its owner as current target, so that
its requirements can be evaluated for a consumer.
2026-10-30 22:44:45 +01:00
Brad King e34b57cfa3 Merge branch 'upstream-LibArchive' into update-libarchive
* upstream-LibArchive:
  LibArchive 2026-10-30 (03036ffa)
2026-10-30 17:39:33 -04:00
LibArchive Upstream f8fb0c1cd8 LibArchive 2026-10-30 (03036ffa)
Code extracted from:

    https://github.com/libarchive/libarchive.git

at commit 03036ffa409a2aa1c5bbad35be2202641a040fda (v3.8.11).
2026-10-30 17:37:26 -04:00
Brad King 12de6af2d1 libarchive: Update script to get 3.8.11 2026-10-30 17:37:17 -04:00
Roger Leigh 192199fae0 Evaluate generator expressions in test and install BUILD_DEPENDS
The `BUILD_DEPENDS` options of `add_test`, `discover_tests` and `install`,
and the `CMAKE_TEST_BUILD_DEPENDS` directory property, took their entries
literally, so a dependency could not be computed per configuration or made
conditional, unlike the test `COMMAND`, from whose generator expressions
the test's target dependencies are already taken.

Evaluate an entry that contains a generator expression, as the test
`COMMAND` is evaluated: targets the expression references become target
dependencies, an evaluated value naming an artifact of such a target is
built by that dependency, any other evaluated value is a target or file
as before, and an entry evaluating to an empty string is ignored.  The
directory property is evaluated as a whole, so that an expression may
produce a list.  `install()` rules are configuration-independent, so an
`install(... BUILD_DEPENDS)` entry is evaluated for each configuration
and the rule depends on the union of the results.  Entries without
generator expressions are resolved exactly as before.

Closes: #28223
2026-10-30 16:39:48 -04:00
Daniel Nicoletti d9f1f4c346 CPack/AppImage: Add CPACK_APPIMAGE_APPRUN_FILE and ignore directories
Installing a custom AppRun to the AppDir top level depends on
CPACK_PACKAGING_INSTALL_PREFIX, so add a variable to provide it instead.

Also skip directories when looking up the desktop file's Exec and Icon,
as they could match a directory with the same name.

Issue: #27478
2026-10-30 17:34:00 -03:00
Sergiu Deitsch 1abe59f5d4 GenerateExportHeader: Fix name of example function definition
The usage example declares a deprecated internal function but defines it
under a different name, so the example would not link.
2026-10-30 20:16:43 +01:00
Aiden Woodruff fcce694567 CMAKE_TOOLCHAIN_FILE: Account for empty values when detecting changes
Initially empty CMAKE_TOOLCHAIN_FILE values should not result in an
include() statement but should be recorded to later detect changes.

Fixes: #28231
2026-10-30 13:05:16 -04:00
Marc Chevrier 809aacdd5c source_group: TREE with empty string must be supported
Fixes: #28230
2026-10-30 17:18:22 +01:00
Taylor Sasser 2d732c85de cmSbom: Export uninstalled libraries / references to private static deps
install(SBOM) could crash for dependencies outside an export set and
mishandle private dependencies expressed through LINK_ONLY.

Resolve link expressions before target lookup, traverse unexported
dependencies transitively, and isolate document state per configuration.
Preserve target license precedence and align document metadata inheritance
with CPS. Add regression coverage for these cases.

Fixes: #28141
Fixes: #28210
2026-10-30 11:12:21 -04:00
Christoph Grüninger bd7f73e210 cmDependsJavaLexer: Match newlines inside string literals
In the string start condition a newline matched no rule and reached
flex's default rule, which `flex -s` reports as "default rule can be
matched".  Consume it explicitly like the comment start condition does.
The input is still discarded as before.
2026-10-30 10:54:50 -04:00
Christoph Grüninger 5eab16cef5 cmExprLexer: Treat newline as whitespace explicitly
Newlines matched no rule, so they reached flex's default rule.  It
discards them only because cmStandardLexer.h defines ECHO as empty, and
`flex -s` warns "default rule can be matched".  Add the newline to the
whitespace rule to make the existing behavior of math(EXPR) explicit.
2026-10-30 10:54:30 -04:00
Christoph Grüninger 168c36e6b3 Utilities/Scripts: Drop stale extra flex arguments from lexer script
regenerate-lexers.bash still carried extra flex arguments for the
CommandArgument lexer, which no longer exists. No remaining lexer uses
per-lexer extra arguments, so remove the variable and the eval that
looked it up. The generated lexers are unchanged.
2026-10-30 10:54:26 -04:00
Brad King 173b0da32d Merge topic 'aix-so-version-symlinks'
06440c35f6 AIX: support VERSION/SOVERSION symlinks for plain shared objects
edd2712a34 cmGeneratorTarget: Replace GetFullPath realname parameter with an enum
84a54323d3 Tests: Do not run LinkStatic test on AIX

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12643
2026-10-30 10:49:38 -04:00
Brad King cb84784c94 Merge topic 'link-info-fix'
2ac0d35159 Genex: Diagnose cyclic link information

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12736
2026-10-30 10:46:40 -04:00
Brad King 69e5558cd0 Merge topic 'ccmake-memory-leak'
e67a011e90 ccmake: Do not leak long message forms
952a327c7b ccmake: Delete main form on exit after a failed configure
5532f2c69d ccmake: Free main form before destroying cache entry fields
1835cffe66 ccmake: Free long message form before its field

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12734
2026-10-30 10:44:14 -04:00
Brad King 70e6c66729 Merge topic 'cps-version-edges'
c5898ce603 CPS: Fix crashes on invalid versions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12739
2026-10-30 10:38:23 -04:00
Brad King a6f8e09e51 Merge topic 'FindOpenMP-offload-target'
14d7dd02d2 FindOpenMP: Add OpenMP::OpenMP_<lang>_Offload targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12718
2026-10-30 10:31:51 -04:00
Brad King 1470e613a1 Merge topic 'doc-ctest-dashboard'
0d4e76e882 Help: Add CTest Dashboard Client Guide
6a507e9ae9 Help/ctest: Document remaining script variables for dashboard settings
b827b48c74 Help/ctest: Add Dashboard Client workflow overview
64ca71c578 CTest: Document target names reserved for the dashboard
d31409f51f Help/ctest: Add some clarifications for Dashboard Client mode

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12695
2026-10-30 10:30:21 -04:00
Brad King 3a13dc4108 Merge topic 'cmake-delayload'
a14c8ff8ea cmake, ctest, cpack: Delay-load Windows system libraries

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12733
2026-10-30 10:25:51 -04:00
Brad King 85a9af6d6b Merge branch 'release-4.5' 2026-10-30 10:22:43 -04:00
Brad King 51aa1331a2 Merge branch 'release-4.4' 2026-10-30 10:22:37 -04:00
Brad King fee9b41a40 Merge branch 'release-4.3' 2026-10-30 10:22:32 -04:00
Brad King be82723c6a Merge branch 'release-4.4' into release-4.5 2026-10-30 10:22:03 -04:00
Brad King fad166cdb8 Merge branch 'release-4.5' 2026-10-30 10:21:34 -04:00
Brad King 92aba64fa4 Merge topic 'std-filesystem-windows'
57c68e39ea cm::filesystem: Restore detection of std::filesystem support on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12729
2026-10-30 10:21:33 -04:00
Brad King 86535dc4d8 Merge topic 'std-filesystem-windows' into release-4.5
57c68e39ea cm::filesystem: Restore detection of std::filesystem support on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12729
2026-10-30 10:21:32 -04:00
Brad King 10b3da9ee8 Merge branch 'release-4.3' into release-4.4 2026-10-30 10:19:57 -04:00
Brad King b5928d14a5 Merge topic 'std-filesystem-windows' into release-4.4
57c68e39ea cm::filesystem: Restore detection of std::filesystem support on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12729
2026-10-30 10:19:45 -04:00
Brad King c52f37782d Merge topic 'std-filesystem-windows' into release-4.3
57c68e39ea cm::filesystem: Restore detection of std::filesystem support on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12729
2026-10-30 10:19:10 -04:00
Brad King 258a66676b Merge branch 'release-4.5' 2026-10-30 10:17:52 -04:00
Brad King 3fbf6a14fe Merge topic 'python3.16'
959098d148 FindPython: Add support for Python 3.16

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12738
2026-10-30 10:17:52 -04:00
Brad King 4f7dbc9408 Merge topic 'python3.16' into release-4.5
959098d148 FindPython: Add support for Python 3.16

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12738
2026-10-30 10:17:49 -04:00
Brad King cb0c3e33b6 Merge topic 'cmp0199-null-fix'
b4e408d7d9 cmGeneratorExpressionNode: Fix check to CMP0199

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12735
2026-10-30 10:16:05 -04:00
Brad King 0cef54e701 Merge branch 'release-4.5' 2026-10-30 10:14:32 -04:00
Brad King 517427ca1e Merge topic 'doxygen-defined-fix'
63e7673d0b FindDoxygen: Tolerate empty output formats
bc7346c06b Help/if: Fix indentation level of if(DEFINED)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12737
2026-10-30 10:14:32 -04:00
Brad King 2b6a1e403e Merge topic 'doxygen-defined-fix' into release-4.5
63e7673d0b FindDoxygen: Tolerate empty output formats
bc7346c06b Help/if: Fix indentation level of if(DEFINED)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12737
2026-10-30 10:14:30 -04:00
Vito Gamberini 8e127aa243 c++modules: Make interface object BMIs static Ninja outputs
Fixes: #28228
2026-10-30 06:29:19 -04:00
Roger Leigh 7047fa76f6 cmTestGenerator,cmInstallGenerator: Factor out BUILD_DEPENDS entry resolution
Move the resolution of a single `BUILD_DEPENDS` entry to a target or file
into a local helper in `cmTestGenerator::EvaluateBuildDependencies` and
`cmInstallGenerator::ResolveBuildDepends`, in preparation for also using
it on values evaluated from generator expressions.  No change in behavior.
2026-10-30 08:16:54 +00:00