diff options
author | Brad King <brad.king@kitware.com> | 2015-07-13 12:51:06 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-07-13 12:51:06 (GMT) |
commit | b3a405badd88bb5c19ad4032e92284057f3cf916 (patch) | |
tree | 0b3bac7ab9cc53ce09006d6e1e375eb04f2fd174 /Source | |
parent | 13f5f066ff0cd004b74b10550237749984189b72 (diff) | |
parent | d4f032b5460afce396dcc5ce3b0af9eb0619812b (diff) | |
download | CMake-b3a405badd88bb5c19ad4032e92284057f3cf916.zip CMake-b3a405badd88bb5c19ad4032e92284057f3cf916.tar.gz CMake-b3a405badd88bb5c19ad4032e92284057f3cf916.tar.bz2 |
Merge branch 'fix-command-rename' into release
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmState.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/cmState.cxx b/Source/cmState.cxx index 58885d3..042fabe 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -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) |