1
0
Эх сурвалжийг харах

ENH: Abstract pre configure check in a separate method

Andy Cedilnik 22 жил өмнө
parent
commit
1e09bc5dde
2 өөрчлөгдсөн 18 нэмэгдсэн , 1 устгасан
  1. 15 1
      Source/cmake.cxx
  2. 3 0
      Source/cmake.h

+ 15 - 1
Source/cmake.cxx

@@ -784,7 +784,7 @@ void cmake::SetGlobalGenerator(cmGlobalGenerator *gg)
   gg->SetCMakeInstance(this);
 }
 
-int cmake::Configure()
+int cmake::DoPreConfigureChecks()
 {
   // do a sanity check on some values
   if(m_CacheManager->GetCacheValue("CMAKE_HOME_DIRECTORY"))
@@ -806,6 +806,20 @@ int cmake::Configure()
       }
     }
   else
+    {
+    return 0;
+    }
+  return 1;
+}
+
+int cmake::Configure()
+{
+  int res = this->DoPreConfigureChecks();
+  if ( res < 0 )
+    {
+    return -2;
+    }
+  if ( !res )
     {
     m_CacheManager->AddCacheEntry("CMAKE_HOME_DIRECTORY", 
                                   this->GetHomeDirectory(),

+ 3 - 0
Source/cmake.h

@@ -235,6 +235,9 @@ class cmake
   cmVariableWatch* GetVariableWatch() { return m_VariableWatch; }
 
   void GetCommandDocumentation(std::vector<cmDocumentationEntry>&) const;
+
+  ///! Do all the checks before running configure
+  int DoPreConfigureChecks();
   
 protected:
   typedef std::map<cmStdString, cmCommand*> RegisteredCommandsMap;