summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaUtilityTargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-03-10 19:47:19 (GMT)
committerBrad King <brad.king@kitware.com>2014-03-12 14:44:01 (GMT)
commitbc993f277ebd44fabe8312a85c5682eed011336d (patch)
tree3f385f5257072c0eb18aa64badfe282eb41e3996 /Source/cmNinjaUtilityTargetGenerator.cxx
parent9a5c55441418ef79415b9a1b99c35192d2b8c1b0 (diff)
downloadCMake-bc993f277ebd44fabe8312a85c5682eed011336d.zip
CMake-bc993f277ebd44fabe8312a85c5682eed011336d.tar.gz
CMake-bc993f277ebd44fabe8312a85c5682eed011336d.tar.bz2
Generalize cmCustomCommandGenerator to more fields
Until now the cmCustomCommandGenerator was used only to compute the command lines of a custom command. Generalize it to get the comment, working directory, dependencies, and outputs of custom commands. Update use in all generators to support this.
Diffstat (limited to 'Source/cmNinjaUtilityTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaUtilityTargetGenerator.cxx11
1 files changed, 8 insertions, 3 deletions
diff --git a/Source/cmNinjaUtilityTargetGenerator.cxx b/Source/cmNinjaUtilityTargetGenerator.cxx
index 1a7b445..0fb40c0 100644
--- a/Source/cmNinjaUtilityTargetGenerator.cxx
+++ b/Source/cmNinjaUtilityTargetGenerator.cxx
@@ -17,6 +17,7 @@
#include "cmMakefile.h"
#include "cmSourceFile.h"
#include "cmTarget.h"
+#include "cmCustomCommandGenerator.h"
cmNinjaUtilityTargetGenerator::cmNinjaUtilityTargetGenerator(
cmGeneratorTarget *target)
@@ -37,8 +38,10 @@ void cmNinjaUtilityTargetGenerator::Generate()
for (unsigned i = 0; i != 2; ++i) {
for (std::vector<cmCustomCommand>::const_iterator
ci = cmdLists[i]->begin(); ci != cmdLists[i]->end(); ++ci) {
- this->GetLocalGenerator()->AppendCustomCommandDeps(&*ci, deps);
- this->GetLocalGenerator()->AppendCustomCommandLines(&*ci, commands);
+ cmCustomCommandGenerator ccg(*ci, this->GetConfigName(),
+ this->GetMakefile());
+ this->GetLocalGenerator()->AppendCustomCommandDeps(ccg, deps);
+ this->GetLocalGenerator()->AppendCustomCommandLines(ccg, commands);
}
}
@@ -49,10 +52,12 @@ void cmNinjaUtilityTargetGenerator::Generate()
{
if(cmCustomCommand* cc = (*source)->GetCustomCommand())
{
+ cmCustomCommandGenerator ccg(*cc, this->GetConfigName(),
+ this->GetMakefile());
this->GetLocalGenerator()->AddCustomCommandTarget(cc, this->GetTarget());
// Depend on all custom command outputs.
- const std::vector<std::string>& ccOutputs = cc->GetOutputs();
+ const std::vector<std::string>& ccOutputs = ccg.GetOutputs();
std::transform(ccOutputs.begin(), ccOutputs.end(),
std::back_inserter(deps), MapToNinjaPath());
}