error out if CTEST_USE_LAUNCHERS is TRUE but RULE_LAUNCH_* are not set

Otherwise, CTEST_USE_LAUNCHERS can be set to true in a driving ctest
script, and everything looks like it would work and reports 0 build errors,
but actually there can be any amount of errors and they are just not reported.
By adding this check cmake now errors out if CTEST_USE_LAUNCHERS is enabled, but
the RULE properties are not set, which would lead to a not-working ctest run.

Alex
This commit is contained in:
Alex Neundorf 2012-08-20 23:19:44 +02:00
parent c4306dc805
commit 95e502ee7c
1 changed files with 11 additions and 0 deletions

View File

@ -2326,6 +2326,17 @@ int cmake::ActualConfigure()
this->CacheManager->RemoveCacheEntry("CMAKE_GENERATOR");
this->CacheManager->RemoveCacheEntry("CMAKE_EXTRA_GENERATOR");
}
cmMakefile* mf=this->GlobalGenerator->GetLocalGenerators()[0]->GetMakefile();
if (mf->IsOn("CTEST_USE_LAUNCHERS")
&& !this->GetProperty("RULE_LAUNCH_COMPILE", cmProperty::GLOBAL))
{
cmSystemTools::Error("CTEST_USE_LAUNCHERS is enabled, but the "
"RULE_LAUNCH_COMPILE global property is not defined.\n"
"Did you forget to include(CTest) in the toplevel "
"CMakeLists.txt ?");
}
// only save the cache if there were no fatal errors
if ( this->GetWorkingMode() == NORMAL_MODE )
{