17094eb572 ALIAS: Add test for generator expressions with ALIAS targets
5f8cc64695 ALIAS: Add support for add_dependencies for ALIAS targets
79e421b053 ALIAS: Add support for target_* commands
3b327695aa ALIASED_TARGET: Make property read-only
a121419908 ALIAS: Add support for set_property and set_target_properties commands
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12207
When the build is invoked under the native build tool's (commonly
spelled) `-C` option to change from the current working directory to a
given build tree, the default path to a snippet's `-ftime-trace` file
under its corresponding target's object directory was incorrectly
stored based on the path from the working directory.
The install handler runs `cmake --install -j` in parallel only when the
CMakeFiles/InstallScripts.json index is at least as new as
CMakeFiles/cmake.check_cache. Both files are written during a single
generate step, so any ordering between them is sub-second. On
filesystems that do not order two near-simultaneous writes by their
sub-second modification time (e.g. NFS on AIX), a fresh index can appear
older than the marker and the install spuriously falls back to serial.
Compare the two modification times at whole-second resolution. This
ignores sub-second jitter within one generate step while still detecting
a genuinely stale index from an older CMake reconfigure, which is always
at least a configure run older.
Fixes: #27919
File sets currently have issues with files containing semicolons;
particularly, names get mangled differently in different contexts. This
can result in failing to find a file's file set. Prior to dee8799d16
(FileSet management: Introduce dedicated classes for generation,
2026-02-16, v4.4.0-rc1~691^2), we guarded against this, but the
aforementioned commit introduced code that would try to use the found
fileset object without checking if it was valid. Add the missing checks
so that we do not crash trying to dereference a null pointer. Also,
refactor `cmGeneratorTarget::GetSourceFilePaths` to avoid unnecessary
work.
Fixes: #27924
Generator expressions already correctly get properties of an ALIAS from
the referenced target. Adds a test to verify a more complicated case
that a generator expression set on an ALIAS target to a transitive
property that gets a property from the ALIAS evaluates correctly.
The add_dependencies command currently accepts ALIAS targets for
<target-dependencies> which resolve to the referenced target. This further
relaxes the command to accept an ALIAS <target> where the command will
add the dependencies to the target which the alias references.
Now that set_property and set_target_properties support ALIAS targets,
we need to extend support to all the target_* type commands that modify
target properties.
Relaxes target_compile_definitions, target_compile_features,
target_compile_options, target_include_directories,
target_link_directories, target_link_libraries, target_link_options,
target_precompile_headers, and target_sources to now accept ALIAS
targets. These commands set properties on the target which the alias
references.
895f83d019 Merge branch 'backport-4.2-fix-cmp194-policy-warning'
e733da51ba CMP0194: Fix policy number in warning text
b88cade899 Merge branch 'backport-4.1-fix-cmp194-policy-warning'
26681a69d2 CMP0194: Fix policy number in warning text
2eb1361cc2 CMP0194: Fix policy number in warning text
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12252
Currently, getting properties from an ALIAS target retrieves the property
from the target which the alias references while setting properties results
in an error. This relaxes set_property and set_target_properties to
accept ALIAS targets and act on the referenced target, mirroring the get
behavior.
An error is raised when setting ALIAS_GLOBAL or ALIASED_TARGET on an ALIAS
target.
Closes: #19445
cmCTestLaunch, which backs ctest --launch and ctest --instrument,
derived its exit code from the child's SpawnResult and ExitStatus but
ignored TermSignal. On POSIX a command killed by a signal reports
ExitStatus 0 and TermSignal N, so the launcher reported success for a
crashed or killed command, masking failed compile/link/custom rules on
the dashboard and in instrumentation snippets.
Classify the child with the ordered triple SpawnResult, TermSignal,
ExitStatus, mapping a signal-killed child to a non-zero exit code.
Native Windows is unaffected: abnormal termination already arrives as a
non-zero exit code there.
Fixes: #27921
With instrumentation enabled, interrupting `cmake --install` (Ctrl+C)
terminated the process before its overall `cmakeInstall` envelope
snippet was written, orphaning the per-script `install` snippets.
Extend the `cmake --build` interrupt handling to the install site: wrap
the `cmakeInstall` command in `HandleInterrupt`, skip the post-install
hook, and re-raise so the exit status reflects the signal. Add
cooperative cancellation so the command unwinds -- serial-loop and
parallel `queueScripts` guards stop launching further scripts, and the
parallel failure aggregation is scoped to dispatched runners so
un-launched scripts are not counted as failed. Force a non-zero result
on interrupt (Windows cannot re-raise), and write the envelope
atomically so a second Ctrl+C cannot truncate it.
Issue: #27859
The test suite can be simplified now that command line arguments are
restored after resetting the cache due to a compiler change. Previously
the test case name had to be set in the environment and now that is not
required.
Refactor CTest's logging to replace custom color code handling with the
infrastructure introduced in commit 329d755dbd (StdIo: Add a Terminal
abstraction to print color text, 2025-05-06).
Avoid ANSI escape sequences in files passed to `--output-log-file`.
Fixes: #27915
Replace __CMAKE_DELETE_CACHE_CHANGE_VARS_ with a set of changed
variables in cmState to avoid interference from scripts and simplify
handling of changed variables.
Errors during configure step will block re-configure when the toolchain
file has changed. Downstream errors can be caused by failing in
EnableLanguage without an error, behavior introduced in 7a989ed58a
(CMAKE_TOOLCHAIN_FILE: Detect path changes and reset cache, 2026-06-24).
Errors directly related to a changed toolchain file should be fixed by
using the new one.
Trigger a fatal error when the toolchain file change is detected to
avoid wasteful configure that will be reset anyway, then re-configure
only for that specific case. Avoid re-configuring multiple times.
Fixes: #27867
Extend the `time` field check from commit c829f0cfca (trace: Add time
and stack level to JSON output format, 2020-01-20, v3.17.0-rc1~105^2) to
accept a timestamp that happens to be formatted as an exact integer.
Move some target related enumeration types from `cmStateTypes.h` to a
new header, as these really aren't "state" types. Also, make
`TargetType` a strongly-typed enumeration.
d781e3b477 Tests: Update https-is-disabled error message for curl 8.21
b5b8651a68 curl: Set build options the way we need for CMake
0ac4d03eca Merge branch 'upstream-curl' into update-curl
ecbccb29a7 curl 2026-06-24 (68720b48)
25d2d31002 curl: Update script to get curl 8.21.0
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12230
1853cd2bc1 Tests: Add option to control bootstrap arguments in BootstrapTest
da073c667f ci: Update name of option to skip BootstrapTest
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12234
Add (partial) file set export to CPS. For now, only headers ("includes")
are supported, as that is the only overlap with the specification.
(Source file sets are not supported by CPS at this time, and the hope is
that C++ modules will never be supported, as that information should
already be available via the `cpp_module_metadata` information.) CPS
also supports "embeds", but CMake doesn't (yet).
This also introduces our first official use of CPS extensions, used to
record the CMake file set name.
`cmake --install` did not propagate per-script failures into its
process exit code.
In parallel mode, cmInstallScriptHandler::Install spawned each install
script as a child process but never inspected the child exit status or
termination signal, and always returned 0. It now reads each child's
status after the event loop, prints the failing script's exit code or
signal, and returns non-zero if any script failed. A failed parallel
install also no longer writes the combined install_manifest.txt, so a
partial manifest is not mistaken for a complete install.
In serial mode, GetScripts() returns the top-level cmake_install.cmake
once per component and per configuration, so multiple scripts run only
when installing several components or configurations at once. The loop
overwrote its result on every iteration, so an earlier script that
failed via cmake_language(EXIT) was masked by a later one that
succeeded. The loop now stops at the first failure. This is a no-op
for a single component and configuration; it changes only installs of
multiple components or configurations, which now stop at the first
failed script and report it instead of attempting the rest.
Fixes: #27906
Add an --out-of-date option to ctest which runs only those tests with
recorded build dependencies whose timestamps are newer than the timestamp
at which the test last finished.
Fixes: #27614
Add a COMPARATOR form to $<LIST:SORT> that orders the list by a caller-defined
rule: a <body> evaluated per comparison with the two elements bound to $<_0>
and $<_1>, yielding "1" when the first should sort before the second. This
brings the custom ordering of list(SORT ... COMPARATOR) to generate time, so
elements can be ordered by target properties or any other generator expression.
CASE: and ORDER: still apply, while COMPARE: is rejected because the body
defines the ordering.
Fixes: #27892
Allow a binding operation to bind more than one operand at once, exposed as
$<_0>, $<_1>, .... A single value remains the common case, but the upcoming
SORT COMPARATOR must bind the two elements being compared, so the binding
becomes an indexed frame and $<_1> is added. Referencing an index the active
binding does not provide is reported as an error.
Issue: #27892
660684c333 FindPkgConfig: Batch pkg-config flag queries
9555f80ea8 FindPkgConfig: Tolerate include directory order in test
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12204