cmake: Port away from trivial cmCacheManager use.
This commit is contained in:
parent
3d8c299f3e
commit
2afadb0d5a
|
@ -1086,10 +1086,10 @@ int cmake::DoPreConfigureChecks()
|
||||||
}
|
}
|
||||||
|
|
||||||
// do a sanity check on some values
|
// do a sanity check on some values
|
||||||
if(this->CacheManager->GetInitializedCacheValue("CMAKE_HOME_DIRECTORY"))
|
if(this->State->GetInitializedCacheValue("CMAKE_HOME_DIRECTORY"))
|
||||||
{
|
{
|
||||||
std::string cacheStart =
|
std::string cacheStart =
|
||||||
this->CacheManager->GetInitializedCacheValue("CMAKE_HOME_DIRECTORY");
|
this->State->GetInitializedCacheValue("CMAKE_HOME_DIRECTORY");
|
||||||
cacheStart += "/CMakeLists.txt";
|
cacheStart += "/CMakeLists.txt";
|
||||||
std::string currentStart = this->GetHomeDirectory();
|
std::string currentStart = this->GetHomeDirectory();
|
||||||
currentStart += "/CMakeLists.txt";
|
currentStart += "/CMakeLists.txt";
|
||||||
|
@ -1146,12 +1146,12 @@ int cmake::HandleDeleteCacheVariables(const std::string& var)
|
||||||
save.value = *i;
|
save.value = *i;
|
||||||
warning << *i << "\n";
|
warning << *i << "\n";
|
||||||
const char* existingValue =
|
const char* existingValue =
|
||||||
this->CacheManager->GetCacheEntryValue(save.key);
|
this->State->GetCacheEntryValue(save.key);
|
||||||
if(existingValue)
|
if(existingValue)
|
||||||
{
|
{
|
||||||
save.type = this->CacheManager->GetCacheEntryType(save.key);
|
save.type = this->State->GetCacheEntryType(save.key);
|
||||||
if(const char* help =
|
if(const char* help =
|
||||||
this->CacheManager->GetCacheEntryProperty(save.key, "HELPSTRING"))
|
this->State->GetCacheEntryProperty(save.key, "HELPSTRING"))
|
||||||
{
|
{
|
||||||
save.help = help;
|
save.help = help;
|
||||||
}
|
}
|
||||||
|
@ -1160,7 +1160,7 @@ int cmake::HandleDeleteCacheVariables(const std::string& var)
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove the cache
|
// remove the cache
|
||||||
this->CacheManager->DeleteCache(this->GetHomeOutputDirectory());
|
this->DeleteCache(this->GetHomeOutputDirectory());
|
||||||
// load the empty cache
|
// load the empty cache
|
||||||
this->LoadCache();
|
this->LoadCache();
|
||||||
// restore the changed compilers
|
// restore the changed compilers
|
||||||
|
@ -1241,9 +1241,9 @@ int cmake::ActualConfigure()
|
||||||
if(!this->GlobalGenerator)
|
if(!this->GlobalGenerator)
|
||||||
{
|
{
|
||||||
const char* genName =
|
const char* genName =
|
||||||
this->CacheManager->GetInitializedCacheValue("CMAKE_GENERATOR");
|
this->State->GetInitializedCacheValue("CMAKE_GENERATOR");
|
||||||
const char* extraGenName =
|
const char* extraGenName =
|
||||||
this->CacheManager->GetInitializedCacheValue("CMAKE_EXTRA_GENERATOR");
|
this->State->GetInitializedCacheValue("CMAKE_EXTRA_GENERATOR");
|
||||||
if(genName)
|
if(genName)
|
||||||
{
|
{
|
||||||
std::string fullName = cmExternalMakefileProjectGenerator::
|
std::string fullName = cmExternalMakefileProjectGenerator::
|
||||||
|
@ -1321,7 +1321,7 @@ int cmake::ActualConfigure()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* genName = this->CacheManager
|
const char* genName = this->State
|
||||||
->GetInitializedCacheValue("CMAKE_GENERATOR");
|
->GetInitializedCacheValue("CMAKE_GENERATOR");
|
||||||
if(genName)
|
if(genName)
|
||||||
{
|
{
|
||||||
|
@ -1338,7 +1338,7 @@ int cmake::ActualConfigure()
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!this->CacheManager->GetInitializedCacheValue("CMAKE_GENERATOR"))
|
if(!this->State->GetInitializedCacheValue("CMAKE_GENERATOR"))
|
||||||
{
|
{
|
||||||
this->AddCacheEntry("CMAKE_GENERATOR",
|
this->AddCacheEntry("CMAKE_GENERATOR",
|
||||||
this->GlobalGenerator->GetName().c_str(),
|
this->GlobalGenerator->GetName().c_str(),
|
||||||
|
@ -1351,7 +1351,7 @@ int cmake::ActualConfigure()
|
||||||
}
|
}
|
||||||
|
|
||||||
if(const char* platformName =
|
if(const char* platformName =
|
||||||
this->CacheManager->GetInitializedCacheValue("CMAKE_GENERATOR_PLATFORM"))
|
this->State->GetInitializedCacheValue("CMAKE_GENERATOR_PLATFORM"))
|
||||||
{
|
{
|
||||||
if(this->GeneratorPlatform.empty())
|
if(this->GeneratorPlatform.empty())
|
||||||
{
|
{
|
||||||
|
@ -1379,7 +1379,7 @@ int cmake::ActualConfigure()
|
||||||
}
|
}
|
||||||
|
|
||||||
if(const char* tsName =
|
if(const char* tsName =
|
||||||
this->CacheManager->GetInitializedCacheValue("CMAKE_GENERATOR_TOOLSET"))
|
this->State->GetInitializedCacheValue("CMAKE_GENERATOR_TOOLSET"))
|
||||||
{
|
{
|
||||||
if(this->GeneratorToolset.empty())
|
if(this->GeneratorToolset.empty())
|
||||||
{
|
{
|
||||||
|
@ -1462,7 +1462,7 @@ int cmake::ActualConfigure()
|
||||||
// only save the cache if there were no fatal errors
|
// only save the cache if there were no fatal errors
|
||||||
if ( this->GetWorkingMode() == NORMAL_MODE )
|
if ( this->GetWorkingMode() == NORMAL_MODE )
|
||||||
{
|
{
|
||||||
this->CacheManager->SaveCache(this->GetHomeOutputDirectory());
|
this->SaveCache(this->GetHomeOutputDirectory());
|
||||||
}
|
}
|
||||||
if(cmSystemTools::GetErrorOccuredFlag())
|
if(cmSystemTools::GetErrorOccuredFlag())
|
||||||
{
|
{
|
||||||
|
@ -1632,7 +1632,7 @@ int cmake::Generate()
|
||||||
// for the Visual Studio and Xcode generators.)
|
// for the Visual Studio and Xcode generators.)
|
||||||
if ( this->GetWorkingMode() == NORMAL_MODE )
|
if ( this->GetWorkingMode() == NORMAL_MODE )
|
||||||
{
|
{
|
||||||
this->CacheManager->SaveCache(this->GetHomeOutputDirectory());
|
this->SaveCache(this->GetHomeOutputDirectory());
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1641,14 +1641,14 @@ void cmake::AddCacheEntry(const std::string& key, const char* value,
|
||||||
const char* helpString,
|
const char* helpString,
|
||||||
int type)
|
int type)
|
||||||
{
|
{
|
||||||
this->CacheManager->AddCacheEntry(key, value,
|
this->State->AddCacheEntry(key, value,
|
||||||
helpString,
|
helpString,
|
||||||
cmState::CacheEntryType(type));
|
cmState::CacheEntryType(type));
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* cmake::GetCacheDefinition(const std::string& name) const
|
const char* cmake::GetCacheDefinition(const std::string& name) const
|
||||||
{
|
{
|
||||||
return this->CacheManager->GetInitializedCacheValue(name);
|
return this->State->GetInitializedCacheValue(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmake::AddDefaultCommands()
|
void cmake::AddDefaultCommands()
|
||||||
|
@ -1834,7 +1834,7 @@ void cmake::UpdateConversionPathTable()
|
||||||
{
|
{
|
||||||
// Update the path conversion table with any specified file:
|
// Update the path conversion table with any specified file:
|
||||||
const char* tablepath =
|
const char* tablepath =
|
||||||
this->CacheManager
|
this->State
|
||||||
->GetInitializedCacheValue("CMAKE_PATH_TRANSLATION_FILE");
|
->GetInitializedCacheValue("CMAKE_PATH_TRANSLATION_FILE");
|
||||||
|
|
||||||
if(tablepath)
|
if(tablepath)
|
||||||
|
|
Loading…
Reference in New Issue