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
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).
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
$<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
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
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
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: #28141Fixes: #28210
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.
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.
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.
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
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
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.