summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/CursesDialog/ccmake.cxx10
-rw-r--r--Source/CursesDialog/cmCursesMainForm.cxx9
-rw-r--r--Source/CursesDialog/cmCursesMainForm.h2
-rw-r--r--Source/cmake.cxx6
4 files changed, 22 insertions, 5 deletions
diff --git a/Source/CursesDialog/ccmake.cxx b/Source/CursesDialog/ccmake.cxx
index e46278a..fad6315 100644
--- a/Source/CursesDialog/ccmake.cxx
+++ b/Source/CursesDialog/ccmake.cxx
@@ -127,7 +127,15 @@ int main(int argc, char** argv)
cmCursesMainForm* myform;
myform = new cmCursesMainForm(args, x);
- myform->LoadCache(cacheDir.c_str());
+ if(myform->LoadCache(cacheDir.c_str()))
+ {
+ curses_clear();
+ touchwin(stdscr);
+ endwin();
+ delete myform;
+ std::cerr << "Error running cmake::LoadCache(). Aboriting.\n";
+ return 1;
+ }
cmSystemTools::SetErrorCallback(CMakeErrorHandler, myform);
diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx
index f13d4a2..26e3bcc 100644
--- a/Source/CursesDialog/cmCursesMainForm.cxx
+++ b/Source/CursesDialog/cmCursesMainForm.cxx
@@ -1058,11 +1058,16 @@ void cmCursesMainForm::HandleInput()
}
}
-void cmCursesMainForm::LoadCache(const char *)
+int cmCursesMainForm::LoadCache(const char *)
{
- m_CMakeInstance->LoadCache();
+ int r = m_CMakeInstance->LoadCache();
+ if(r < 0)
+ {
+ return r;
+ }
m_CMakeInstance->SetCacheArgs(m_Args);
+ return r;
}
diff --git a/Source/CursesDialog/cmCursesMainForm.h b/Source/CursesDialog/cmCursesMainForm.h
index 3281e18..08d8f7e 100644
--- a/Source/CursesDialog/cmCursesMainForm.h
+++ b/Source/CursesDialog/cmCursesMainForm.h
@@ -101,7 +101,7 @@ public:
/**
* Used by main program
*/
- void LoadCache(const char *dir);
+ int LoadCache(const char *dir);
/**
* Progress callback
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 0b3e7cb..aa5984b 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -924,7 +924,11 @@ int cmake::Run(const std::vector<std::string>& args)
m_CMakeCommand = args[0];
// load the cache
- this->LoadCache();
+ if(this->LoadCache() < 0)
+ {
+ cmSystemTools::Error("Error executing cmake::LoadCache(). Aborting.\n");
+ return -1;
+ }
// Add any cache args
this->SetCacheArgs(args);