mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
The TEST_INCLUDE_FILE(S) directory properties were written verbatim into CTestTestfile.cmake, so a $<CONFIG>-parameterized include path could not select a per-configuration script and failed at ctest time. Evaluate generator expressions per include entry in cmLocalGenerator::GenerateTestFiles(): * Entries without a generator expression are emitted unchanged. * On single-config generators a genex entry is evaluated once and emitted as one unconditional include. * On multi-config generators it is evaluated for every configuration; a config-independent result collapses to one unconditional include, otherwise each non-empty per-config result is guarded by a CTEST_CONFIGURATION_TYPE branch, mirroring add_test(). An entry that evaluates to empty adds no include. Promote cmScriptGenerator::CreateConfigTest to a public static helper so the include guards reuse the exact add_test() config-test encoding; the instance overloads now delegate to it. Evaluated results are quoted via cmScriptGenerator::Quote, while plain entries keep their raw serialization. Fixes: #27941
7 lines
278 B
CMake
7 lines
278 B
CMake
enable_testing()
|
|
|
|
# An unknown generator expression in the include path must fail at generate
|
|
# time (diagnostics are best-effort: they need not name the set_property call).
|
|
set_property(DIRECTORY PROPERTY TEST_INCLUDE_FILE
|
|
"${CMAKE_CURRENT_BINARY_DIR}/x_$<NOTAGENEX>.cmake")
|