diff options
author | Brad King <brad.king@kitware.com> | 2015-04-07 21:14:41 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-04-07 21:15:04 (GMT) |
commit | 3347c5e4f9fcdd36c06067d6c7cd5a985a9c5d94 (patch) | |
tree | d0372265c5b1f07f9b1a8a6cc9bedf96bed2dbcb /Source/cmOptionCommand.cxx | |
parent | 9410e24a4ad3a21b2c27d057798f723e88d14d45 (diff) | |
download | CMake-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/cmOptionCommand.cxx')
-rw-r--r-- | Source/cmOptionCommand.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/cmOptionCommand.cxx b/Source/cmOptionCommand.cxx index baf5b1e..60728ea 100644 --- a/Source/cmOptionCommand.cxx +++ b/Source/cmOptionCommand.cxx @@ -42,16 +42,16 @@ bool cmOptionCommand std::string initialValue = "Off"; // Now check and see if the value has been stored in the cache // already, if so use that value and don't look for the program - cmCacheManager* manager = this->Makefile->GetCacheManager(); - const char* existingValue = manager->GetCacheEntryValue(args[0]); - if(existingValue) + cmCacheManager::CacheIterator it = + this->Makefile->GetCacheManager()->GetCacheIterator(args[0].c_str()); + if(!it.IsAtEnd()) { - if (manager->GetCacheEntryType(args[0]) != cmCacheManager::UNINITIALIZED) + if ( it.GetType() != cmCacheManager::UNINITIALIZED ) { - manager->SetCacheEntryProperty(args[0], "HELPSTRING", args[1]); + it.SetProperty("HELPSTRING", args[1].c_str()); return true; } - initialValue = existingValue; + initialValue = it.GetValue(); } if(args.size() == 3) { |