浏览代码

ENH: On envocation of ccmake check if directories are correct, but do not rerun configure

Andy Cedilnik 22 年之前
父节点
当前提交
dfd22fdf23
共有 3 个文件被更改,包括 22 次插入7 次删除
  1. 5 2
      Source/CursesDialog/ccmake.cxx
  2. 14 3
      Source/CursesDialog/cmCursesMainForm.cxx
  3. 3 2
      Source/CursesDialog/cmCursesMainForm.h

+ 5 - 2
Source/CursesDialog/ccmake.cxx

@@ -189,8 +189,11 @@ int main(int argc, char** argv)
   cmCursesForm::CurrentForm = myform;
 
   myform->InitializeUI();
-  myform->Render(1, 1, x, y);
-  myform->HandleInput();
+  if ( myform->Configure(1) == 0 )
+    {
+    myform->Render(1, 1, x, y);
+    myform->HandleInput();
+    }
   
   // Need to clean-up better
   curses_clear();

+ 14 - 3
Source/CursesDialog/cmCursesMainForm.cxx

@@ -624,9 +624,8 @@ void cmCursesMainForm::UpdateProgress(const char *msg, float prog, void* vp)
   refresh();
 }
 
-int cmCursesMainForm::Configure()
+int cmCursesMainForm::Configure(int noconfigure)
 {
-
   int xi,yi;
   getmaxyx(stdscr, yi, xi);
 
@@ -648,7 +647,19 @@ int cmCursesMainForm::Configure()
 
   // run the generate process
   m_OkToGenerate = true;
-  int retVal = this->m_CMakeInstance->Configure();
+  int retVal;
+  if ( noconfigure )
+    {
+    retVal = this->m_CMakeInstance->DoPreConfigureChecks();
+    if ( retVal > 0 )
+      {
+      retVal = 0;
+      }
+    }
+  else
+    {
+    retVal = this->m_CMakeInstance->Configure();
+    }
   this->m_CMakeInstance->SetProgressCallback(0, 0);
 
   keypad(stdscr,TRUE); /* Use key symbols as 

+ 3 - 2
Source/CursesDialog/cmCursesMainForm.h

@@ -89,9 +89,10 @@ public:
   virtual void AddError(const char* message, const char* title);
 
   /**
-   * Used to do a configure.
+   * Used to do a configure. If argument is specified, it does only the check
+   * and not configure.
    */
-  int Configure();
+  int Configure(int noconfigure=0);
 
   /**
    * Used to generate