When CTEST_USE_LAUNCHERS is set to ON in a ctest -S script, the configure step fails with the error message:
CMake Error:
CTEST_USE_LAUNCHERS is enabled, but the RULE_LAUNCH_COMPILE global property
is not defined.
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.
#!/usr/bin/env -S ctest -VV -S
set(CTEST_SOURCE_DIRECTORY "/path/to/secp256k1")
set(CTEST_BINARY_DIRECTORY "/path/to/secp256k1-build")
set(CTEST_CMAKE_GENERATOR "Ninja")
set(CTEST_USE_LAUNCHERS ON)
ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})
ctest_start("Experimental")
ctest_configure()
ctest_build()