Exit ccmake on fatal errors.
This commit is contained in:
parent
b3b3281b7f
commit
77bb62e00c
|
@ -124,10 +124,11 @@ int main(int argc, char** argv)
|
||||||
cmCursesForm::CurrentForm = myform;
|
cmCursesForm::CurrentForm = myform;
|
||||||
|
|
||||||
myform->InitializeUI();
|
myform->InitializeUI();
|
||||||
myform->RunCMake(false);
|
if (myform->RunCMake(false) == 0 )
|
||||||
|
{
|
||||||
myform->Render(1, 1, x, y);
|
myform->Render(1, 1, x, y);
|
||||||
myform->HandleInput();
|
myform->HandleInput();
|
||||||
|
}
|
||||||
|
|
||||||
// Need to clean-up better
|
// Need to clean-up better
|
||||||
curses_clear();
|
curses_clear();
|
||||||
|
|
|
@ -504,7 +504,7 @@ void cmCursesMainForm::UpdateStatusBar()
|
||||||
pos_form_cursor(m_Form);
|
pos_form_cursor(m_Form);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmCursesMainForm::RunCMake(bool generateMakefiles)
|
int cmCursesMainForm::RunCMake(bool generateMakefiles)
|
||||||
{
|
{
|
||||||
|
|
||||||
int x,y;
|
int x,y;
|
||||||
|
@ -557,6 +557,12 @@ void cmCursesMainForm::RunCMake(bool generateMakefiles)
|
||||||
CurrentForm = msgs;
|
CurrentForm = msgs;
|
||||||
msgs->Render(1,1,x,y);
|
msgs->Render(1,1,x,y);
|
||||||
msgs->HandleInput();
|
msgs->HandleInput();
|
||||||
|
// If they typed the wrong source directory, we report
|
||||||
|
// an error and exit
|
||||||
|
if ( retVal == -2 )
|
||||||
|
{
|
||||||
|
return retVal;
|
||||||
|
}
|
||||||
CurrentForm = this;
|
CurrentForm = this;
|
||||||
this->Render(1,1,x,y);
|
this->Render(1,1,x,y);
|
||||||
}
|
}
|
||||||
|
@ -565,6 +571,7 @@ void cmCursesMainForm::RunCMake(bool generateMakefiles)
|
||||||
this->InitializeUI();
|
this->InitializeUI();
|
||||||
this->Render(1, 1, x, y);
|
this->Render(1, 1, x, y);
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmCursesMainForm::AddError(const char* message, const char* title)
|
void cmCursesMainForm::AddError(const char* message, const char* title)
|
||||||
|
|
|
@ -85,7 +85,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Used to run cmake.
|
* Used to run cmake.
|
||||||
*/
|
*/
|
||||||
void RunCMake(bool generateMakefiles);
|
int RunCMake(bool generateMakefiles);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
cmCursesMainForm(const cmCursesMainForm& from);
|
cmCursesMainForm(const cmCursesMainForm& from);
|
||||||
|
|
|
@ -370,7 +370,7 @@ int cmake::Generate(const std::vector<std::string>& args, bool buildMakefiles)
|
||||||
message += cacheStart;
|
message += cacheStart;
|
||||||
message += "\nRe-run cmake with a different source directory.";
|
message += "\nRe-run cmake with a different source directory.";
|
||||||
cmSystemTools::Error(message.c_str());
|
cmSystemTools::Error(message.c_str());
|
||||||
return -1;
|
return -2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mf.AddCacheDefinition("CMAKE_HOME_DIRECTORY", mf.GetHomeDirectory(),
|
mf.AddCacheDefinition("CMAKE_HOME_DIRECTORY", mf.GetHomeDirectory(),
|
||||||
|
|
Loading…
Reference in New Issue