summaryrefslogtreecommitdiffstats
path: root/Source/cmVisualStudio10TargetGenerator.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/cmVisualStudio10TargetGenerator.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/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx23
1 files changed, 12 insertions, 11 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 90155b4..7c55f64 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -19,6 +19,7 @@
#include "cmSourceFile.h"
#include "cmVisualStudioGeneratorOptions.h"
#include "cmLocalVisualStudio7Generator.h"
+#include "cmCustomCommandGenerator.h"
#include "cmVS10CLFlagTable.h"
#include "cmVS10LinkFlagTable.h"
#include "cmVS10LibFlagTable.h"
@@ -616,8 +617,6 @@ cmVisualStudio10TargetGenerator::WriteCustomRule(cmSourceFile* source,
}
}
cmLocalVisualStudio7Generator* lg = this->LocalGenerator;
- std::string comment = lg->ConstructComment(command);
- comment = cmVS10EscapeComment(comment);
std::vector<std::string> *configs =
static_cast<cmGlobalVisualStudio7Generator *>
(this->GlobalGenerator)->GetConfigurations();
@@ -627,8 +626,11 @@ cmVisualStudio10TargetGenerator::WriteCustomRule(cmSourceFile* source,
for(std::vector<std::string>::iterator i = configs->begin();
i != configs->end(); ++i)
{
+ cmCustomCommandGenerator ccg(command, *i, this->Makefile);
+ std::string comment = lg->ConstructComment(ccg);
+ comment = cmVS10EscapeComment(comment);
std::string script =
- cmVS10EscapeXML(lg->ConstructScript(command, i->c_str()));
+ cmVS10EscapeXML(lg->ConstructScript(ccg));
this->WritePlatformConfigTag("Message",i->c_str(), 3);
(*this->BuildFileStream ) << cmVS10EscapeXML(comment) << "</Message>\n";
this->WritePlatformConfigTag("Command", i->c_str(), 3);
@@ -637,8 +639,8 @@ cmVisualStudio10TargetGenerator::WriteCustomRule(cmSourceFile* source,
(*this->BuildFileStream ) << source->GetFullPath();
for(std::vector<std::string>::const_iterator d =
- command.GetDepends().begin();
- d != command.GetDepends().end();
+ ccg.GetDepends().begin();
+ d != ccg.GetDepends().end();
++d)
{
std::string dep;
@@ -652,8 +654,8 @@ cmVisualStudio10TargetGenerator::WriteCustomRule(cmSourceFile* source,
this->WritePlatformConfigTag("Outputs", i->c_str(), 3);
const char* sep = "";
for(std::vector<std::string>::const_iterator o =
- command.GetOutputs().begin();
- o != command.GetOutputs().end();
+ ccg.GetOutputs().begin();
+ o != ccg.GetOutputs().end();
++o)
{
std::string out = *o;
@@ -1835,13 +1837,12 @@ void cmVisualStudio10TargetGenerator::WriteEvent(
for(std::vector<cmCustomCommand>::const_iterator i = commands.begin();
i != commands.end(); ++i)
{
- const cmCustomCommand& command = *i;
+ cmCustomCommandGenerator ccg(*i, configName, this->Makefile);
comment += pre;
- comment += lg->ConstructComment(command);
+ comment += lg->ConstructComment(ccg);
script += pre;
pre = "\n";
- script +=
- cmVS10EscapeXML(lg->ConstructScript(command, configName.c_str()));
+ script += cmVS10EscapeXML(lg->ConstructScript(ccg));
}
comment = cmVS10EscapeComment(comment);
this->WriteString("<Message>",3);