diff options
Diffstat (limited to 'Source/cmOptionCommand.cxx')
| -rw-r--r-- | Source/cmOptionCommand.cxx | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/Source/cmOptionCommand.cxx b/Source/cmOptionCommand.cxx index e505440..92be5f1 100644 --- a/Source/cmOptionCommand.cxx +++ b/Source/cmOptionCommand.cxx @@ -34,11 +34,7 @@ bool cmOptionCommand if(argError) { std::string m = "called with incorrect number of arguments: "; - for(size_t i =0; i < args.size(); ++i) - { - m += args[i]; - m += " "; - } + m += cmJoin(args, " "); this->SetError(m); return false; } @@ -46,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::CacheIterator it = - this->Makefile->GetCacheManager()->GetCacheIterator(args[0].c_str()); - if(!it.IsAtEnd()) + cmState* state = this->Makefile->GetState(); + const char* existingValue = state->GetCacheEntryValue(args[0]); + if(existingValue) { - if ( it.GetType() != cmCacheManager::UNINITIALIZED ) + if (state->GetCacheEntryType(args[0]) != cmState::UNINITIALIZED) { - it.SetProperty("HELPSTRING", args[1].c_str()); + state->SetCacheEntryProperty(args[0], "HELPSTRING", args[1]); return true; } - initialValue = it.GetValue(); + initialValue = existingValue; } if(args.size() == 3) { @@ -63,6 +59,6 @@ bool cmOptionCommand } bool init = cmSystemTools::IsOn(initialValue.c_str()); this->Makefile->AddCacheDefinition(args[0], init? "ON":"OFF", - args[1].c_str(), cmCacheManager::BOOL); + args[1].c_str(), cmState::BOOL); return true; } |
