mirror of
https://github.com/Kitware/CMake.git
synced 2026-11-06 05:16:58 +00:00
Enable test preparation targets by default. Add (better named) `CMAKE_SKIP_TEST_PREP_TARGETS` variable to control generation of the same, mirroring `CMAKE_SKIP_INSTALL_PREP_TARGETS`. Remove support for old `CMAKE_TEST_BUILD_DEPENDS` variable. Update and improve documentation. This improves consistency between test and install preparation targets. It also modifies the descriptions of preparation targets in the documentation of generators which support them to be consistent. (Previously, each generator described preparation targets in a manner unique to each generator.) Fixes: #28050
18 lines
616 B
CMake
18 lines
616 B
CMake
project(TestDependencyObjectLibrary C)
|
|
enable_testing()
|
|
|
|
add_executable(fake_discovery EXCLUDE_FROM_ALL fake_discovery.c)
|
|
add_library(dependency_objects OBJECT EXCLUDE_FROM_ALL fake_discovery.c)
|
|
file(GENERATE
|
|
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/dependency_objects-$<CONFIG>.txt"
|
|
CONTENT "$<TARGET_OBJECTS:dependency_objects>")
|
|
|
|
add_test(NAME OBJECT.direct COMMAND "${CMAKE_COMMAND}" -E true
|
|
BUILD_DEPENDS dependency_objects)
|
|
discover_tests(COMMAND fake_discovery
|
|
DISCOVERY_ARGS --list_tests
|
|
DISCOVERY_MATCH "^([^,]+),([^,]+)$"
|
|
TEST_NAME "OBJECT.\\1"
|
|
TEST_ARGS "\\1"
|
|
BUILD_DEPENDS dependency_objects)
|