Bläddra i källkod

*** empty log message ***

Brad King 23 år sedan
förälder
incheckning
94ff97ceed
2 ändrade filer med 14 tillägg och 0 borttagningar
  1. 7 0
      Source/cmEndIfCommand.cxx
  2. 7 0
      Source/cmIfCommand.cxx

+ 7 - 0
Source/cmEndIfCommand.cxx

@@ -19,6 +19,13 @@
 
 bool cmEndIfCommand::InitialPass(std::vector<std::string> const&)
 {
+  const char* versionValue
+    = m_Makefile->GetDefinition("CMAKE_MINIMUM_REQUIRED_VERSION");
+  if (!versionValue || (atof(versionValue) <= 1.4))
+    {
+    return true;
+    }
+  
   this->SetError("An ENDIF command was found outside of a proper IF ENDIF structure. Or its arguments did not match the opening IF command.");
   return false;
 }

+ 7 - 0
Source/cmIfCommand.cxx

@@ -81,6 +81,13 @@ ShouldRemove(const char *name, const std::vector<std::string> &args,
 void cmIfFunctionBlocker::
 ScopeEnded(cmMakefile &mf)
 {
+  const char* versionValue
+    = mf.GetDefinition("CMAKE_MINIMUM_REQUIRED_VERSION");
+  if (!versionValue || (atof(versionValue) <= 1.4))
+    {
+    return;
+    }
+  
   std::string errmsg = "The end of a CMakeLists file was reached with an IF statement that was not closed properly.\nWithin the directory: ";
   errmsg += mf.GetCurrentDirectory();
   errmsg += "\nThe arguments are: ";