diff options
author | Brad King <brad.king@kitware.com> | 2015-07-13 13:17:46 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-07-13 13:17:46 (GMT) |
commit | e30fe3eba211056491f832d469a5176653071c9e (patch) | |
tree | 5c0e4b13fae486a925f2fb38b0506b04fae4c87c /Source | |
parent | 93bd1540756ec9cfb60cf9bbac57beedf9bd3433 (diff) | |
parent | d4f032b5460afce396dcc5ce3b0af9eb0619812b (diff) | |
download | CMake-e30fe3eba211056491f832d469a5176653071c9e.zip CMake-e30fe3eba211056491f832d469a5176653071c9e.tar.gz CMake-e30fe3eba211056491f832d469a5176653071c9e.tar.bz2 |
Merge topic 'fix-command-rename'
d4f032b5 cmState: Restore renamed commands on cleanup.
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 d918f65..2d8b935 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -430,6 +430,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(); ) { @@ -439,11 +440,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) |