summaryrefslogtreecommitdiff
path: root/Source/cmSetPropertyCommand.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-04-05 10:48:04 +0200
committerStephen Kelly <steveire@gmail.com>2015-04-06 17:58:55 +0200
commit9410e24a4ad3a21b2c27d057798f723e88d14d45 (patch)
tree9259e248faee43f15b544e1fa7ee61f3ce23e0c4 /Source/cmSetPropertyCommand.cxx
parent7b7ae3b1a1d1c664eeef48392759883aa4040657 (diff)
downloadcmake-9410e24a4ad3a21b2c27d057798f723e88d14d45.tar.gz
cmCacheManager: Port consumers to non-iterator API.
This simplifies reasoning about the follow-up commit which ports away from cmCacheManager to a class with the same method names.
Diffstat (limited to 'Source/cmSetPropertyCommand.cxx')
-rw-r--r--Source/cmSetPropertyCommand.cxx19
1 files changed, 11 insertions, 8 deletions
diff --git a/Source/cmSetPropertyCommand.cxx b/Source/cmSetPropertyCommand.cxx
index 1150bc7ad8..77f9fb90b9 100644
--- a/Source/cmSetPropertyCommand.cxx
+++ b/Source/cmSetPropertyCommand.cxx
@@ -452,11 +452,11 @@ bool cmSetPropertyCommand::HandleCacheMode()
// Get the source file.
cmMakefile* mf = this->GetMakefile();
cmake* cm = mf->GetCMakeInstance();
- cmCacheManager::CacheIterator it =
- cm->GetCacheManager()->GetCacheIterator(ni->c_str());
- if(!it.IsAtEnd())
+ const char* existingValue
+ = cm->GetCacheManager()->GetCacheEntryValue(*ni);
+ if(existingValue)
{
- if(!this->HandleCacheEntry(it))
+ if(!this->HandleCacheEntry(*ni))
{
return false;
}
@@ -474,22 +474,25 @@ bool cmSetPropertyCommand::HandleCacheMode()
}
//----------------------------------------------------------------------------
-bool cmSetPropertyCommand::HandleCacheEntry(cmCacheManager::CacheIterator& it)
+bool cmSetPropertyCommand::HandleCacheEntry(std::string const& cacheKey)
{
// Set or append the property.
const char* name = this->PropertyName.c_str();
const char* value = this->PropertyValue.c_str();
+ cmCacheManager* manager = this->Makefile->GetCacheManager();
if (this->Remove)
{
- value = 0;
+ manager->RemoveCacheEntryProperty(cacheKey, name);
+ return true;
}
if(this->AppendMode)
{
- it.AppendProperty(name, value, this->AppendAsString);
+ manager->AppendCacheEntryProperty(cacheKey, name, value,
+ this->AppendAsString);
}
else
{
- it.SetProperty(name, value);
+ manager->SetCacheEntryProperty(cacheKey, name, value);
}
return true;