ENH: When the initially configured generator is invalid, allow the user to change the generator without deleting the cache by hand.
This commit is contained in:
parent
a30148e640
commit
20b198835c
@ -57,11 +57,11 @@ void cmGlobalGenerator::EnableLanguage(const char* lang,
|
|||||||
if(!mf->GetDefinition("CMAKE_MAKE_PROGRAM")
|
if(!mf->GetDefinition("CMAKE_MAKE_PROGRAM")
|
||||||
|| cmSystemTools::IsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM")))
|
|| cmSystemTools::IsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM")))
|
||||||
{
|
{
|
||||||
cmSystemTools::Error("CMake was unable to find a build program "
|
cmOStringStream err;
|
||||||
"corresponding to the generator you have selected. "
|
err << "CMake was unable to find a build program corresponding to \""
|
||||||
"CMAKE_MAKE_PROGRAM is not set. You probably "
|
<< this->GetName() << "\". CMAKE_MAKE_PROGRAM is not set. You "
|
||||||
"need to re-run CMake and select a different "
|
<< "probably need to select a different build tool.";
|
||||||
"generator.");
|
cmSystemTools::Error(err.str().c_str());
|
||||||
cmSystemTools::SetFatalErrorOccured();
|
cmSystemTools::SetFatalErrorOccured();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -890,6 +890,14 @@ int cmake::Configure()
|
|||||||
cmCacheManager::PATH);
|
cmCacheManager::PATH);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(cmSystemTools::GetFatalErrorOccured() &&
|
||||||
|
(!this->m_CacheManager->GetCacheValue("CMAKE_MAKE_PROGRAM") ||
|
||||||
|
cmSystemTools::IsOff(this->m_CacheManager->GetCacheValue("CMAKE_MAKE_PROGRAM"))))
|
||||||
|
{
|
||||||
|
// We must have a bad generator selection. Wipe the cache entry so the
|
||||||
|
// user can select another.
|
||||||
|
m_CacheManager->RemoveCacheEntry("CMAKE_GENERATOR");
|
||||||
|
}
|
||||||
this->m_CacheManager->SaveCache(this->GetHomeOutputDirectory());
|
this->m_CacheManager->SaveCache(this->GetHomeOutputDirectory());
|
||||||
if(cmSystemTools::GetErrorOccuredFlag())
|
if(cmSystemTools::GetErrorOccuredFlag())
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user