When CTEST_USE_LAUNCHERS
is set to ON
in a ctest -S
script, the configure step fails with the error message:
0CMake Error:
1 CTEST_USE_LAUNCHERS is enabled, but the RULE_LAUNCH_COMPILE global property
2 is not defined.
3
4 Did you forget to include(CTest) in the toplevel CMakeLists.txt ?
However, include(CTest)
produces unwanted clutter. include(CTestUseLaunchers)
is a more lightweight alternative.
To reproduce the issue, run the following script with and without the PR applied.
0#!/usr/bin/env -S ctest -VV -S
1
2set(CTEST_SOURCE_DIRECTORY "/path/to/secp256k1")
3set(CTEST_BINARY_DIRECTORY "/path/to/secp256k1-build")
4
5set(CTEST_CMAKE_GENERATOR "Ninja")
6set(CTEST_USE_LAUNCHERS ON)
7
8ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})
9ctest_start("Experimental")
10ctest_configure()
11ctest_build()