Parcourir la source

better error reporting

Ken Martin il y a 23 ans
Parent
commit
6b22b8c556
1 fichiers modifiés avec 8 ajouts et 2 suppressions
  1. 8 2
      Source/cmMacroCommand.cxx

+ 8 - 2
Source/cmMacroCommand.cxx

@@ -107,9 +107,15 @@ ShouldRemove(const cmListFileFunction&, cmMakefile &)
 }
 }
 
 
 void cmMacroFunctionBlocker::
 void cmMacroFunctionBlocker::
-ScopeEnded(cmMakefile &) 
+ScopeEnded(cmMakefile &mf) 
 {
 {
-  // macros never leave scope
+  // macros never leave scope but we should have seen the ENDMACRO call by now
+  if (m_Executing != true)
+    {
+    cmSystemTools::Error("The end of a CMakeLists file was reached with a MACRO statement that was not closed properly. Within the directory: ", 
+                         mf.GetCurrentDirectory(), " with macro ", 
+                         m_Args[0].c_str());
+    }
 }
 }
 
 
 bool cmMacroCommand::InitialPass(std::vector<std::string> const& args)
 bool cmMacroCommand::InitialPass(std::vector<std::string> const& args)