summaryrefslogtreecommitdiffstats
path: root/Source/cmMacroCommand.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2005-06-14 16:48:59 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2005-06-14 16:48:59 (GMT)
commit24a5c0a72e5a50637a285c1dd5427a6bb498ca06 (patch)
tree197a1d1b6ea27e0004445773afdd3f439a1b220a /Source/cmMacroCommand.cxx
parenta95a4b000db076d7a7c1dff163508b1922344339 (diff)
downloadCMake-24a5c0a72e5a50637a285c1dd5427a6bb498ca06.zip
CMake-24a5c0a72e5a50637a285c1dd5427a6bb498ca06.tar.gz
CMake-24a5c0a72e5a50637a285c1dd5427a6bb498ca06.tar.bz2
ENH: Save command that macro overwrites
Diffstat (limited to 'Source/cmMacroCommand.cxx')
-rw-r--r--Source/cmMacroCommand.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx
index 7780920..dea15bc 100644
--- a/Source/cmMacroCommand.cxx
+++ b/Source/cmMacroCommand.cxx
@@ -16,6 +16,8 @@
=========================================================================*/
#include "cmMacroCommand.h"
+#include "cmake.h"
+
// define the class for macro commands
class cmMacroHelperCommand : public cmCommand
{
@@ -38,6 +40,11 @@ public:
}
/**
+ * This determines if the command is invoked when in script mode.
+ */
+ virtual bool IsScriptable() { return true; }
+
+ /**
* This is called when the command is first encountered in
* the CMakeLists.txt file.
*/
@@ -265,6 +272,8 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf)
cmMacroHelperCommand *f = new cmMacroHelperCommand();
f->m_Args = this->m_Args;
f->m_Functions = this->m_Functions;
+ std::string newName = "_" + this->m_Args[0];
+ mf.GetCMakeInstance()->RenameCommand(this->m_Args[0].c_str(), newName.c_str());
mf.AddCommand(f);
// remove the function blocker now that the macro is defined