test-build-dependenciesΒΆ
The Ninja Generators now support generating a build target named
test_prep/<test-name>for each test added byadd_test(), which builds all dependencies for that test. Build dependencies are registered for an executable target invoked by the test, targets referenced in generator expressions in the test command, and explicit dependencies added using the newBUILD_DEPENDSoption. This behavior is enabled by the newCMAKE_TEST_BUILD_DEPENDSvariable. Atest_prep/alltarget is also generated to depend on everytest_prep/<test-name>target. Tests with names that are not valid target names are excluded from this behavior. If multiple tests in different directories share the same name, their dependencies are merged into onetest_prep/<test-name>target.