浏览代码

Merge topic 'ErrorIfCTEST_USE_LAUNCHERSSetButLauncherRuleNotSet'

95e502e error out if CTEST_USE_LAUNCHERS is TRUE but RULE_LAUNCH_* are not set
Brad King 13 年之前
父节点
当前提交
907019b338
共有 1 个文件被更改,包括 11 次插入0 次删除
  1. 11 0
      Source/cmake.cxx

+ 11 - 0
Source/cmake.cxx

@@ -2326,6 +2326,17 @@ int cmake::ActualConfigure()
     this->CacheManager->RemoveCacheEntry("CMAKE_GENERATOR");
     this->CacheManager->RemoveCacheEntry("CMAKE_GENERATOR");
     this->CacheManager->RemoveCacheEntry("CMAKE_EXTRA_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
   // only save the cache if there were no fatal errors
   if ( this->GetWorkingMode() == NORMAL_MODE )
   if ( this->GetWorkingMode() == NORMAL_MODE )
     {
     {