diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2005-06-14 16:48:59 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2005-06-14 16:48:59 (GMT) |
commit | 24a5c0a72e5a50637a285c1dd5427a6bb498ca06 (patch) | |
tree | 197a1d1b6ea27e0004445773afdd3f439a1b220a /Source/cmake.cxx | |
parent | a95a4b000db076d7a7c1dff163508b1922344339 (diff) | |
download | CMake-24a5c0a72e5a50637a285c1dd5427a6bb498ca06.zip CMake-24a5c0a72e5a50637a285c1dd5427a6bb498ca06.tar.gz CMake-24a5c0a72e5a50637a285c1dd5427a6bb498ca06.tar.bz2 |
ENH: Save command that macro overwrites
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r-- | Source/cmake.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index dcc4c05..a8006d8 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -173,6 +173,20 @@ cmCommand *cmake::GetCommand(const char *name) return rm; } +void cmake::RenameCommand(const char*oldName, const char* newName) +{ + // if the command already exists, free the old one + RegisteredCommandsMap::iterator pos = m_Commands.find(oldName); + if ( pos == m_Commands.end() ) + { + return; + } + + m_Commands.insert(RegisteredCommandsMap::value_type(newName, pos->second)); + pos = m_Commands.find(oldName); + m_Commands.erase(pos); +} + void cmake::AddCommand(cmCommand* wg) { std::string name = wg->GetName(); |