cpack only knows the host CMAKE_SYSTEM_PROCESSOR, so cross-compiled
AppImages got the host architecture. Set the default in the CPack
module instead, where the project's target processor is known.
Closes: #27556
Verify that the `X-AppImage-Version` entry that appimagetool writes to
the desktop file defaults to `CPACK_PACKAGE_VERSION` and that it can be
overridden with `CPACK_APPIMAGE_VERSION`.
The following options were added to complement what is possible
to control of appimagetool:
- CPACK_APPIMAGE_ARCH
- CPACK_APPIMAGE_SIGN_PASSPHRASE
- CPACK_APPIMAGE_VERSION
Issue: #27556
The CMake find_package command emits a diagnostic (default action: warn) when
reading a CPS file from a location not listed in the CPS package searching
specification.
The configure and build wrapper scripts ignored the result of
`execute_process`, so a failure in the MinGW project (e.g. a gfortran
compilation error) was not reported and the parent build continued,
failing later at link time or not at all.
Closes: #28240
Read compared each record key with string literals in an if chain, and
kept a second list of the records that belong in the block of a file.
Write spelled the same keys a third time.
Give each record type a name in an enum and keep the keys in one table.
Read looks up the key once and switches on the type, and the compiler
checks that each switch handles every type. Write and the error
messages take the keys from the same table.
Issue: #28192
The CPack generator modules, the CPack configuration file and the install
scripts that cpack runs to make a package are CMake language code, but
only cpack runs them. Start recording when cpack starts its work, as
ctest does, and write the tracefile on every return. The help and
version options record nothing.
Issue: #28192
Add a handler that reads the `<test-name>.cmake-coverage.info` files
that the `CMAKE` coverage tool writes for each test. It searches the
build tree for them, without following symbolic links, and merges them
with the lcov tracefile code that ctest uses for the per-test merge.
The merge is needed because many tests run the same listfile, and the
lcov parser keeps only the first record of each file. A file that
cannot be read is skipped with a warning.
The handler reports only files in the source tree. It leaves out files
in the build tree, also when the build tree is inside the source tree,
unless the two trees are the same. This keeps the modules of CMake
itself and generated files out of the report. It also leaves out files
that no longer exist, because the report step would log an error for
them, and an error makes `ctest -S` fail.
Teach the lcov parser to count `FN` and `FNDA` records when asked, and
write `FunctionsTested` and `FunctionsUnTested` for CMake coverage. The
Clang handler does not ask, so its output does not change. The parser
now also ignores `DA` and `BRDA` records for a line past the end of the
source file, instead of writing out of range. This protects the Clang
handler too.
Issue: #28192
Add a `CMAKE` value for the `CoverageTool` setting, next to `LLVM-COV`.
With it, ctest gives each test its own scratch folder,
`<test-name>_cmake-coverage`, next to the `CTestTestfile.cmake` that
describes the test, and runs the test with CMAKE_LISTFILE_COVERAGE_DIR
set to that folder. An ambient value of the variable is replaced.
Before the test, ctest removes the folder and the merged file of an
earlier run.
After the test, ctest merges the tracefiles in the folder into one
`<test-name>.cmake-coverage.info` file with a `TN:` record, and removes
the folder. Coverage problems are warnings and never change the test
result: a folder that cannot be created, an unreadable file, a merged
file that cannot be written, and a test that timed out. The folder is
kept for inspection when a file was skipped or the write failed.
The merge leaves out the files under ctest's build directory, such as
generated files and `try_compile` projects, unless the build directory
is the source directory. If no file is left, the test gets no merged
file, as for a test that runs no CMake code.
ctest now also records coverage of the CMake code that it runs itself,
such as `CTestTestfile.cmake` files and dashboard scripts, when
CMAKE_LISTFILE_COVERAGE_DIR is set at startup. ctest reads the top
`CTestTestfile.cmake` by a relative path, so the collector now makes a
relative listfile path absolute with the current working directory.
Document the tool and add a recipe for CMake's own test suite to
`Tests/RunCMake/README.rst`.
Issue: #28192
The `<testsuite timestamp>` attribute of the `--output-junit` report was
written in local time with no time zone designator, so downstream tools
parsing the JUnit XML could not determine the actual instant without
knowing the producing machine's time zone. Two reports produced in
different time zones could not be compared.
Write the timestamp in UTC with a trailing `Z` (ISO 8601 / xs:dateTime),
making it an unambiguous instant.
The MinGW external project produces the import libraries of the
imported targets, but did not declare them, so Ninja failed with
"missing and no known rule to make it".
Declare them as byproducts, and pass --clean-first to the inner build
when any of them is missing, since cleaning the outer project deletes
them but the inner build would otherwise consider itself up to date and
not relink.
Closes: #28239
07dbb31e69 GenerateExportHeader: Support deprecation messages
1abe59f5d4 GenerateExportHeader: Fix name of example function definition
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12741
bd7f73e210 cmDependsJavaLexer: Match newlines inside string literals
5eab16cef5 cmExprLexer: Treat newline as whitespace explicitly
168c36e6b3 Utilities/Scripts: Drop stale extra flex arguments from lexer script
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12743
When a string is concatenated to the beginning and/or end of a
`$<LINK_GROUP:...>` generator expression without a semicolon, the
internal group marker is disrupted, leading to a crash after
evaluation.