summaryrefslogtreecommitdiffstats
path: root/Source/cmCacheManager.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-04-05 08:28:34 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-04-06 15:58:55 (GMT)
commit9ada4c04335fc070f3f670df72bd9943eabec464 (patch)
tree42f6a6254608314b4052ba3ad0cc86a756ecbf4d /Source/cmCacheManager.cxx
parent1fe7f24c2b62734d501427750586d8063149ea58 (diff)
downloadCMake-9ada4c04335fc070f3f670df72bd9943eabec464.zip
CMake-9ada4c04335fc070f3f670df72bd9943eabec464.tar.gz
CMake-9ada4c04335fc070f3f670df72bd9943eabec464.tar.bz2
cmCacheManager: Rename GetCacheValue to GetInitializedCacheValue.
Being initialized is a requirement for this method to return something, and is what differentiates it from using GetIterator with it.GetValue.
Diffstat (limited to 'Source/cmCacheManager.cxx')
-rw-r--r--Source/cmCacheManager.cxx16
1 files changed, 10 insertions, 6 deletions
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx
index fa7eff3..f8f2dbd 100644
--- a/Source/cmCacheManager.cxx
+++ b/Source/cmCacheManager.cxx
@@ -284,14 +284,16 @@ bool cmCacheManager::LoadCache(const std::string& path,
}
this->CacheMajorVersion = 0;
this->CacheMinorVersion = 0;
- if(const char* cmajor = this->GetCacheValue("CMAKE_CACHE_MAJOR_VERSION"))
+ if(const char* cmajor =
+ this->GetInitializedCacheValue("CMAKE_CACHE_MAJOR_VERSION"))
{
unsigned int v=0;
if(sscanf(cmajor, "%u", &v) == 1)
{
this->CacheMajorVersion = v;
}
- if(const char* cminor = this->GetCacheValue("CMAKE_CACHE_MINOR_VERSION"))
+ if(const char* cminor =
+ this->GetInitializedCacheValue("CMAKE_CACHE_MINOR_VERSION"))
{
if(sscanf(cminor, "%u", &v) == 1)
{
@@ -313,10 +315,11 @@ bool cmCacheManager::LoadCache(const std::string& path,
}
// check to make sure the cache directory has not
// been moved
- if ( internal && this->GetCacheValue("CMAKE_CACHEFILE_DIR") )
+ const char* oldDir = this->GetInitializedCacheValue("CMAKE_CACHEFILE_DIR");
+ if (internal && oldDir)
{
std::string currentcwd = path;
- std::string oldcwd = this->GetCacheValue("CMAKE_CACHEFILE_DIR");
+ std::string oldcwd = oldDir;
cmSystemTools::ConvertToUnixSlashes(currentcwd);
currentcwd += "/CMakeCache.txt";
oldcwd += "/CMakeCache.txt";
@@ -325,7 +328,7 @@ bool cmCacheManager::LoadCache(const std::string& path,
std::string message =
std::string("The current CMakeCache.txt directory ") +
currentcwd + std::string(" is different than the directory ") +
- std::string(this->GetCacheValue("CMAKE_CACHEFILE_DIR")) +
+ std::string(this->GetInitializedCacheValue("CMAKE_CACHEFILE_DIR")) +
std::string(" where CMakeCache.txt was created. This may result "
"in binaries being created in the wrong place. If you "
"are not sure, reedit the CMakeCache.txt");
@@ -655,7 +658,8 @@ cmCacheManager::CacheIterator cmCacheManager::GetCacheIterator(
return CacheIterator(*this, key);
}
-const char* cmCacheManager::GetCacheValue(const std::string& key) const
+const char*
+cmCacheManager::GetInitializedCacheValue(const std::string& key) const
{
CacheEntryMap::const_iterator i = this->Cache.find(key);
if(i != this->Cache.end() &&