diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-04-05 08:48:04 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-04-06 15:58:55 (GMT) |
commit | 9410e24a4ad3a21b2c27d057798f723e88d14d45 (patch) | |
tree | 9259e248faee43f15b544e1fa7ee61f3ce23e0c4 /Source/cmSetPropertyCommand.cxx | |
parent | 7b7ae3b1a1d1c664eeef48392759883aa4040657 (diff) | |
download | CMake-9410e24a4ad3a21b2c27d057798f723e88d14d45.zip CMake-9410e24a4ad3a21b2c27d057798f723e88d14d45.tar.gz CMake-9410e24a4ad3a21b2c27d057798f723e88d14d45.tar.bz2 |
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.cxx | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/Source/cmSetPropertyCommand.cxx b/Source/cmSetPropertyCommand.cxx index 1150bc7..77f9fb9 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; |