summaryrefslogtreecommitdiffstats
path: root/Source/cmCPluginAPI.cxx
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2003-06-03 14:30:23 (GMT)
committerKen Martin <ken.martin@kitware.com>2003-06-03 14:30:23 (GMT)
commitba68f771b369e65476e7ce12aa8dd1cf18d7f529 (patch)
tree4580bb0cd83663ac32e7234b47f1a03881a2b709 /Source/cmCPluginAPI.cxx
parent4f55e4870d0dea6f700943ccd4bac958c478cff4 (diff)
downloadCMake-ba68f771b369e65476e7ce12aa8dd1cf18d7f529.zip
CMake-ba68f771b369e65476e7ce12aa8dd1cf18d7f529.tar.gz
CMake-ba68f771b369e65476e7ce12aa8dd1cf18d7f529.tar.bz2
yikes added new custom command support
Diffstat (limited to 'Source/cmCPluginAPI.cxx')
-rw-r--r--Source/cmCPluginAPI.cxx53
1 files changed, 53 insertions, 0 deletions
diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx
index 4bec426..90be276 100644
--- a/Source/cmCPluginAPI.cxx
+++ b/Source/cmCPluginAPI.cxx
@@ -239,6 +239,56 @@ void cmAddCustomCommand(void *arg, const char* source,
mf->AddCustomCommand(source, command, args2, depends2, outputs2, target);
}
+void cmAddCustomCommandToOutput(void *arg, const char* output,
+ const char* command,
+ int numArgs, const char **args,
+ const char* main_dependency,
+ int numDepends, const char **depends)
+{
+ cmMakefile *mf = static_cast<cmMakefile *>(arg);
+ int i;
+ std::vector<std::string> args2;
+ for (i = 0; i < numArgs; ++i)
+ {
+ args2.push_back(args[i]);
+ }
+ std::vector<std::string> depends2;
+ for (i = 0; i < numDepends; ++i)
+ {
+ depends2.push_back(depends[i]);
+ }
+ mf->AddCustomCommandToOutput(output, command, args2, main_dependency,
+ depends2);
+}
+
+void cmAddCustomCommandToTarget(void *arg, const char* target,
+ const char* command,
+ int numArgs, const char **args,
+ int commandType)
+{
+ cmMakefile *mf = static_cast<cmMakefile *>(arg);
+ int i;
+ std::vector<std::string> args2;
+ for (i = 0; i < numArgs; ++i)
+ {
+ args2.push_back(args[i]);
+ }
+ switch (commandType)
+ {
+ case CM_PRE_BUILD:
+ mf->AddCustomCommandToTarget(target, command, args2,
+ cmTarget::PRE_BUILD);
+ break;
+ case CM_PRE_LINK:
+ mf->AddCustomCommandToTarget(target, command, args2,
+ cmTarget::PRE_LINK);
+ break;
+ case CM_POST_BUILD:
+ mf->AddCustomCommandToTarget(target, command, args2,
+ cmTarget::POST_BUILD);
+ break;
+ }
+}
void cmAddLinkLibraryForTarget(void *arg, const char *tgt, const char*value,
int libtype)
@@ -546,5 +596,8 @@ cmCAPI cmStaticCAPI =
cmGetFilenamePath,
cmRemoveFile,
cmFree,
+
+ cmAddCustomCommandToOutput,
+ cmAddCustomCommandToTarget,
};