summaryrefslogtreecommitdiff
path: root/Source/cmLocalVisualStudio6Generator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmLocalVisualStudio6Generator.cxx')
-rw-r--r--Source/cmLocalVisualStudio6Generator.cxx39
1 files changed, 23 insertions, 16 deletions
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index d7130248b0..2ab25cc52c 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -16,6 +16,7 @@
#include "cmSourceFile.h"
#include "cmCacheManager.h"
#include "cmGeneratorTarget.h"
+#include "cmCustomCommandGenerator.h"
#include "cmake.h"
#include "cmComputeLinkInformation.h"
@@ -59,6 +60,7 @@ public:
}
void Write(cmCustomCommand const& cc)
{
+ cmCustomCommandGenerator ccg(cc, this->Config, this->LG->GetMakefile());
if(this->First)
{
this->Code += this->Event + "_Cmds=";
@@ -68,7 +70,7 @@ public:
{
this->Code += "\\\n\t";
}
- this->Code += this->LG->ConstructScript(cc, this->Config, "\\\n\t");
+ this->Code += this->LG->ConstructScript(ccg, "\\\n\t");
}
private:
cmLocalVisualStudio6Generator* LG;
@@ -575,14 +577,18 @@ cmLocalVisualStudio6Generator
target.GetName().size() + 30)];
sprintf(output,"%s/%s_force_%i", this->Makefile->GetStartOutputDirectory(),
target.GetName().c_str(), count);
- std::string comment = this->ConstructComment(origCommand, "<hack>");
+ const char* comment = origCommand.GetComment();
+ if(!comment && origCommand.GetOutputs().empty())
+ {
+ comment = "<hack>";
+ }
// Add the rule with the given dependencies and commands.
std::string no_main_dependency = "";
if(cmSourceFile* outsf =
this->Makefile->AddCustomCommandToOutput(
output, depends, no_main_dependency,
- origCommand.GetCommandLines(), comment.c_str(),
+ origCommand.GetCommandLines(), comment,
origCommand.GetWorkingDirectory().c_str()))
{
target.AddSourceFile(outsf);
@@ -604,20 +610,21 @@ cmLocalVisualStudio6Generator
const cmCustomCommand& command,
const char* flags)
{
- std::string comment =
- this->ConstructComment(command, "Building Custom Rule $(InputPath)");
- if(comment == "<hack>")
- {
- comment = "";
- }
-
// Write the rule for each configuration.
std::vector<std::string>::iterator i;
for(i = this->Configurations.begin(); i != this->Configurations.end(); ++i)
{
std::string config = this->GetConfigName(*i);
+ cmCustomCommandGenerator ccg(command, config, this->Makefile);
+ std::string comment =
+ this->ConstructComment(ccg, "Building Custom Rule $(InputPath)");
+ if(comment == "<hack>")
+ {
+ comment = "";
+ }
+
std::string script =
- this->ConstructScript(command, config.c_str(), "\\\n\t");
+ this->ConstructScript(ccg, "\\\n\t");
if (i == this->Configurations.begin())
{
@@ -634,8 +641,8 @@ cmLocalVisualStudio6Generator
// Write out the dependencies for the rule.
fout << "USERDEP__HACK=";
for(std::vector<std::string>::const_iterator d =
- command.GetDepends().begin();
- d != command.GetDepends().end();
+ ccg.GetDepends().begin();
+ d != ccg.GetDepends().end();
++d)
{
// Lookup the real name of the dependency in case it is a CMake target.
@@ -655,7 +662,7 @@ cmLocalVisualStudio6Generator
fout << " " << comment.c_str();
}
fout << "\n\n";
- if(command.GetOutputs().empty())
+ if(ccg.GetOutputs().empty())
{
fout << source
<< "_force : \"$(SOURCE)\" \"$(INTDIR)\" \"$(OUTDIR)\"\n\t";
@@ -664,8 +671,8 @@ cmLocalVisualStudio6Generator
else
{
for(std::vector<std::string>::const_iterator o =
- command.GetOutputs().begin();
- o != command.GetOutputs().end();
+ ccg.GetOutputs().begin();
+ o != ccg.GetOutputs().end();
++o)
{
// Write a rule for every output generated by this command.