BUG: Fixed crash when CMAKE_ROOT cannot be found.
This commit is contained in:
parent
c7b5bb6d2c
commit
486454ef78
|
@ -127,7 +127,15 @@ int main(int argc, char** argv)
|
||||||
cmCursesMainForm* myform;
|
cmCursesMainForm* myform;
|
||||||
|
|
||||||
myform = new cmCursesMainForm(args, x);
|
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);
|
cmSystemTools::SetErrorCallback(CMakeErrorHandler, myform);
|
||||||
|
|
||||||
|
|
|
@ -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);
|
m_CMakeInstance->SetCacheArgs(m_Args);
|
||||||
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -101,7 +101,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Used by main program
|
* Used by main program
|
||||||
*/
|
*/
|
||||||
void LoadCache(const char *dir);
|
int LoadCache(const char *dir);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Progress callback
|
* Progress callback
|
||||||
|
|
|
@ -924,7 +924,11 @@ int cmake::Run(const std::vector<std::string>& args)
|
||||||
m_CMakeCommand = args[0];
|
m_CMakeCommand = args[0];
|
||||||
|
|
||||||
// load the cache
|
// load the cache
|
||||||
this->LoadCache();
|
if(this->LoadCache() < 0)
|
||||||
|
{
|
||||||
|
cmSystemTools::Error("Error executing cmake::LoadCache(). Aborting.\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
// Add any cache args
|
// Add any cache args
|
||||||
this->SetCacheArgs(args);
|
this->SetCacheArgs(args);
|
||||||
|
|
Loading…
Reference in New Issue