summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalUnixMakefileGenerator3.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-04-11 15:06:19 (GMT)
committerBrad King <brad.king@kitware.com>2006-04-11 15:06:19 (GMT)
commitd5719f22c1dca3e100f1e3b5dfaa4fe7d26796a0 (patch)
tree714a99bed97290f96ff8f846fa6864cebbdc0a28 /Source/cmGlobalUnixMakefileGenerator3.h
parentb613cf0be806cc1d37d2b590f1a5ba7898236ae8 (diff)
downloadCMake-d5719f22c1dca3e100f1e3b5dfaa4fe7d26796a0.zip
CMake-d5719f22c1dca3e100f1e3b5dfaa4fe7d26796a0.tar.gz
CMake-d5719f22c1dca3e100f1e3b5dfaa4fe7d26796a0.tar.bz2
ENH: Added support for multiple outputs generated by a single custom command. For Visual Studio generators the native tool provides support. For Xcode and Makefile generators a simple trick is used. The first output is considered primary and has the build rule attached. Other outputs simply depend on the first output with no build rule. During cmake_check_build_system CMake detects when a secondary output is missing and removes the primary output to make sure all outputs are regenerated. This approach always builds the custom command at the right time and only once even during parallel builds.
Diffstat (limited to 'Source/cmGlobalUnixMakefileGenerator3.h')
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h
index 60ca2da..3f8dbc2 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.h
+++ b/Source/cmGlobalUnixMakefileGenerator3.h
@@ -97,6 +97,19 @@ public:
void WriteConvenienceRules(std::ostream& ruleFileStream,
std::set<cmStdString> &emitted);
+ /** In order to support parallel builds for custom commands with
+ multiple outputs the outputs are given a serial order, and only
+ the first output actually has the build rule. Other outputs
+ just depend on the first one. The check-build-system step must
+ remove a dependee if the depender is missing to make sure both
+ are regenerated properly. This method is used by the local
+ makefile generators to register such pairs. */
+ void AddMultipleOutputPair(const char* depender, const char* dependee);
+
+ /** Support for multiple custom command outputs. Called during
+ check-build-system step. */
+ virtual void CheckMultipleOutputs(cmMakefile* mf, bool verbose);
+
protected:
void WriteMainMakefile2();
void WriteMainCMakefile();
@@ -137,6 +150,9 @@ protected:
// added later. If non-empty this variable holds a fake dependency
// that can be added.
std::string EmptyRuleHackDepends;
+
+ typedef std::map<cmStdString, cmStdString> MultipleOutputPairsType;
+ MultipleOutputPairsType MultipleOutputPairs;
};
#endif