Files
CMake/Tests/RunCMake/TestDependency/DirectoryGeneratedFile.cmake
Matthew Woehlke 4bbdabae74 Ninja, Makefile, FASTBuild: Enable test_prep by default
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
2026-10-14 16:10:45 -04:00

13 lines
484 B
CMake

project(TestDependencyDirectoryGeneratedFile NONE)
enable_testing()
set(output "${CMAKE_CURRENT_BINARY_DIR}/directory-generated.txt")
add_custom_command(OUTPUT "${output}"
COMMAND "${CMAKE_COMMAND}" -E touch "${output}"
VERBATIM)
add_custom_target(directory_generated_owner DEPENDS "${output}")
set_property(DIRECTORY PROPERTY CMAKE_TEST_BUILD_DEPENDS "${output}")
add_test(NAME DirectoryGeneratedFileBuilt
COMMAND "${CMAKE_COMMAND}" -E compare_files "${output}" "${output}")