mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
Add `test_prep/<test_name>` convenience targets to the ninja generator to build dependencies of tests, and `test_prep/all` to build the dependencies of all tests. Build dependencies of a test include: - Executables directly invoked by test `COMMAND`. - Targets mentioned in generator expressionf os test `COMMAND`. - Anything explicitly listed with the new `BUILD_DEPENDS` argument of `add_test`. Issue: #27613
21 lines
497 B
CMake
21 lines
497 B
CMake
cmake_minimum_required(VERSION 4.3)
|
|
set(CMAKE_TEST_BUILD_DEPENDS ON)
|
|
|
|
project(TestDependencyInvalidTestName C)
|
|
|
|
enable_testing()
|
|
|
|
add_custom_target(TestDependencyPrereq
|
|
COMMAND
|
|
"${CMAKE_COMMAND}" -E touch
|
|
"${CMAKE_CURRENT_BINARY_DIR}/TestDependencyPrereq-built.txt"
|
|
BYPRODUCTS
|
|
"${CMAKE_CURRENT_BINARY_DIR}/TestDependencyPrereq-built.txt"
|
|
VERBATIM)
|
|
|
|
add_test(NAME "Target Build Test Invalid Name"
|
|
COMMAND
|
|
"${CMAKE_COMMAND}" -E true
|
|
BUILD_DEPENDS
|
|
TestDependencyPrereq)
|