|
|
@@ -406,6 +406,7 @@ std::vector<std::string> cmState::GetCommandNames() const
|
|
|
|
|
|
void cmState::RemoveUserDefinedCommands()
|
|
|
{
|
|
|
+ std::vector<cmCommand*> renamedCommands;
|
|
|
for(std::map<std::string, cmCommand*>::iterator j = this->Commands.begin();
|
|
|
j != this->Commands.end(); )
|
|
|
{
|
|
|
@@ -415,11 +416,21 @@ void cmState::RemoveUserDefinedCommands()
|
|
|
delete j->second;
|
|
|
this->Commands.erase(j++);
|
|
|
}
|
|
|
+ else if (j->first != j->second->GetName())
|
|
|
+ {
|
|
|
+ renamedCommands.push_back(j->second);
|
|
|
+ this->Commands.erase(j++);
|
|
|
+ }
|
|
|
else
|
|
|
{
|
|
|
++j;
|
|
|
}
|
|
|
}
|
|
|
+ for (std::vector<cmCommand*>::const_iterator it = renamedCommands.begin();
|
|
|
+ it != renamedCommands.end(); ++it)
|
|
|
+ {
|
|
|
+ this->Commands[cmSystemTools::LowerCase((*it)->GetName())] = *it;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
void cmState::SetGlobalProperty(const std::string& prop, const char* value)
|