Files
cmake/Tests/RunCMake/GeneratorExpression/ListTransformPredicateLinkLibraries-check.cmake
Mickaël Germain d2ad140ef9 GenEx: add PREDICATE selector to $<LIST:TRANSFORM>
Add a PREDICATE selector to $<LIST:TRANSFORM> that chooses which elements to
transform by evaluating a <body> per element (with $<_0> bound) and acting on
those for which it yields "1".  This selects by computed condition instead of
the fixed AT/FOR/REGEX positions, so any generator expression -- including
target queries -- can decide where an action applies.  It works with both the
canned actions and APPLY.

Issue: #27892
2026-06-23 21:31:20 -07:00

13 lines
533 B
CMake

file(READ "${RunCMake_TEST_BINARY_DIR}/filtered.txt" actual)
file(READ "${RunCMake_TEST_BINARY_DIR}/expected.txt" expected)
string(STRIP "${actual}" actual)
string(STRIP "${expected}" expected)
# PREDICATE over app's LINK_LIBRARIES must prefix only STATIC_LIBRARY targets
# and leave INTERFACE_LIBRARY targets unchanged.
if(NOT actual STREQUAL expected)
set(RunCMake_TEST_FAILED
"PREDICATE-over-LINK_LIBRARIES output does not match the expected list:\n"
" actual: [${actual}]\n"
" expected: [${expected}]")
endif()