diff options
author | Berk Geveci <berk.geveci@kitware.com> | 2002-04-23 20:16:48 (GMT) |
---|---|---|
committer | Berk Geveci <berk.geveci@kitware.com> | 2002-04-23 20:16:48 (GMT) |
commit | 77bb62e00c5ba7a77cbee2cc710b7631891c0518 (patch) | |
tree | d9724a4d470221c7b27337ec5163897edb5c1891 /Source/CursesDialog | |
parent | b3b3281b7f4f52419d511a4025a4e45959c92732 (diff) | |
download | CMake-77bb62e00c5ba7a77cbee2cc710b7631891c0518.zip CMake-77bb62e00c5ba7a77cbee2cc710b7631891c0518.tar.gz CMake-77bb62e00c5ba7a77cbee2cc710b7631891c0518.tar.bz2 |
Exit ccmake on fatal errors.
Diffstat (limited to 'Source/CursesDialog')
-rw-r--r-- | Source/CursesDialog/ccmake.cxx | 9 | ||||
-rw-r--r-- | Source/CursesDialog/cmCursesMainForm.cxx | 9 | ||||
-rw-r--r-- | Source/CursesDialog/cmCursesMainForm.h | 2 |
3 files changed, 14 insertions, 6 deletions
diff --git a/Source/CursesDialog/ccmake.cxx b/Source/CursesDialog/ccmake.cxx index 7d9e348..5cc5db6 100644 --- a/Source/CursesDialog/ccmake.cxx +++ b/Source/CursesDialog/ccmake.cxx @@ -124,10 +124,11 @@ int main(int argc, char** argv) cmCursesForm::CurrentForm = myform; myform->InitializeUI(); - myform->RunCMake(false); - - myform->Render(1, 1, x, y); - myform->HandleInput(); + if (myform->RunCMake(false) == 0 ) + { + myform->Render(1, 1, x, y); + myform->HandleInput(); + } // Need to clean-up better curses_clear(); diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index e8e9199..503dc58 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -504,7 +504,7 @@ void cmCursesMainForm::UpdateStatusBar() pos_form_cursor(m_Form); } -void cmCursesMainForm::RunCMake(bool generateMakefiles) +int cmCursesMainForm::RunCMake(bool generateMakefiles) { int x,y; @@ -557,6 +557,12 @@ void cmCursesMainForm::RunCMake(bool generateMakefiles) CurrentForm = msgs; msgs->Render(1,1,x,y); msgs->HandleInput(); + // If they typed the wrong source directory, we report + // an error and exit + if ( retVal == -2 ) + { + return retVal; + } CurrentForm = this; this->Render(1,1,x,y); } @@ -565,6 +571,7 @@ void cmCursesMainForm::RunCMake(bool generateMakefiles) this->InitializeUI(); this->Render(1, 1, x, y); + return 0; } void cmCursesMainForm::AddError(const char* message, const char* title) diff --git a/Source/CursesDialog/cmCursesMainForm.h b/Source/CursesDialog/cmCursesMainForm.h index 72238e8..3a15f58 100644 --- a/Source/CursesDialog/cmCursesMainForm.h +++ b/Source/CursesDialog/cmCursesMainForm.h @@ -85,7 +85,7 @@ public: /** * Used to run cmake. */ - void RunCMake(bool generateMakefiles); + int RunCMake(bool generateMakefiles); protected: cmCursesMainForm(const cmCursesMainForm& from); |