summaryrefslogtreecommitdiffstats
path: root/Source/cmFindBase.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-04-07 21:14:41 (GMT)
committerBrad King <brad.king@kitware.com>2015-04-07 21:15:04 (GMT)
commit3347c5e4f9fcdd36c06067d6c7cd5a985a9c5d94 (patch)
treed0372265c5b1f07f9b1a8a6cc9bedf96bed2dbcb /Source/cmFindBase.cxx
parent9410e24a4ad3a21b2c27d057798f723e88d14d45 (diff)
downloadCMake-3347c5e4f9fcdd36c06067d6c7cd5a985a9c5d94.zip
CMake-3347c5e4f9fcdd36c06067d6c7cd5a985a9c5d94.tar.gz
CMake-3347c5e4f9fcdd36c06067d6c7cd5a985a9c5d94.tar.bz2
Revert topic 'refactor-cache-api'
This topic was never tested without some follow-up commits. The GetCacheEntryValue API returns a pointer to memory freed on return. It will have to be revised along with the rest of the original topic.
Diffstat (limited to 'Source/cmFindBase.cxx')
-rw-r--r--Source/cmFindBase.cxx13
1 files changed, 6 insertions, 7 deletions
diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx
index cc08052..f63df61 100644
--- a/Source/cmFindBase.cxx
+++ b/Source/cmFindBase.cxx
@@ -366,18 +366,18 @@ bool cmFindBase::CheckForVariableInCache()
if(const char* cacheValue =
this->Makefile->GetDefinition(this->VariableName))
{
- cmCacheManager* manager = this->Makefile->GetCacheManager();
- const char* cacheEntry = manager->GetCacheEntryValue(this->VariableName);
+ cmCacheManager::CacheIterator it =
+ this->Makefile->GetCacheManager()->
+ GetCacheIterator(this->VariableName.c_str());
bool found = !cmSystemTools::IsNOTFOUND(cacheValue);
- bool cached = cacheEntry ? true : false;
+ bool cached = !it.IsAtEnd();
if(found)
{
// If the user specifies the entry on the command line without a
// type we should add the type and docstring but keep the
// original value. Tell the subclass implementations to do
// this.
- if(cached && manager->GetCacheEntryType(this->VariableName)
- == cmCacheManager::UNINITIALIZED)
+ if(cached && it.GetType() == cmCacheManager::UNINITIALIZED)
{
this->AlreadyInCacheWithoutMetaInfo = true;
}
@@ -385,8 +385,7 @@ bool cmFindBase::CheckForVariableInCache()
}
else if(cached)
{
- const char* hs = manager->GetCacheEntryProperty(this->VariableName,
- "HELPSTRING");
+ const char* hs = it.GetProperty("HELPSTRING");
this->VariableDocumentation = hs?hs:"(none)";
}
}