|
|
@@ -271,28 +271,32 @@ void cmDSPMakefile::WriteDSPFile(std::ostream& fout,
|
|
|
|
|
|
// Loop through every custom command generating code from the
|
|
|
// current source.
|
|
|
+ // build up the depends and outputs and commands
|
|
|
+ cmSourceGroup::CommandFiles totalCommand;
|
|
|
+ std::string totalCommandStr;
|
|
|
for(cmSourceGroup::Commands::const_iterator c = commands.begin();
|
|
|
c != commands.end(); ++c)
|
|
|
{
|
|
|
- std::string command = c->first;
|
|
|
- const cmSourceGroup::CommandFiles& commandFiles = c->second;
|
|
|
- this->WriteCustomRule(fout, source.c_str(), command.c_str(), commandFiles.m_Depends,
|
|
|
- commandFiles.m_Outputs);
|
|
|
- // Create a dummy file with the name of the source if it does
|
|
|
- // not exist
|
|
|
- if(commandFiles.m_Outputs.size() == 0)
|
|
|
- {
|
|
|
- std::string dummyFile = m_Makefile->GetStartOutputDirectory();
|
|
|
- dummyFile += "/";
|
|
|
- dummyFile += source;
|
|
|
- if(!cmSystemTools::FileExists(dummyFile.c_str()))
|
|
|
- {
|
|
|
- std::ofstream fout(dummyFile.c_str());
|
|
|
- fout << "Dummy file created by cmake as unused source for utility command.\n";
|
|
|
- }
|
|
|
- }
|
|
|
+ totalCommandStr += "\n\t";
|
|
|
+ totalCommandStr += c->first;
|
|
|
+ totalCommand.Merge(c->second);
|
|
|
}
|
|
|
-
|
|
|
+ // Create a dummy file with the name of the source if it does
|
|
|
+ // not exist
|
|
|
+ if(totalCommand.m_Outputs.empty())
|
|
|
+ {
|
|
|
+ std::string dummyFile = m_Makefile->GetStartOutputDirectory();
|
|
|
+ dummyFile += "/";
|
|
|
+ dummyFile += source;
|
|
|
+ if(!cmSystemTools::FileExists(dummyFile.c_str()))
|
|
|
+ {
|
|
|
+ std::ofstream fout(dummyFile.c_str());
|
|
|
+ fout << "Dummy file created by cmake as unused source for utility command.\n";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this->WriteCustomRule(fout, source.c_str(), totalCommandStr.c_str(),
|
|
|
+ totalCommand.m_Depends,
|
|
|
+ totalCommand.m_Outputs);
|
|
|
fout << "# End Source File\n";
|
|
|
}
|
|
|
|
|
|
@@ -341,7 +345,7 @@ void cmDSPMakefile::WriteCustomRule(std::ostream& fout,
|
|
|
if(outputs.size() == 0)
|
|
|
{
|
|
|
fout << source << "_force : \"$(SOURCE)\" \"$(INTDIR)\" \"$(OUTDIR)\"";
|
|
|
- fout << "\n " << command << "\n\n";
|
|
|
+ fout << command << "\n\n";
|
|
|
}
|
|
|
|
|
|
// Write a rule for every output generated by this command.
|
|
|
@@ -356,7 +360,7 @@ void cmDSPMakefile::WriteCustomRule(std::ostream& fout,
|
|
|
{
|
|
|
fout << " \"" << d->c_str() << "\"";
|
|
|
}
|
|
|
- fout << "\n " << command << "\n\n";
|
|
|
+ fout << command << "\n\n";
|
|
|
}
|
|
|
|
|
|
fout << "# End Custom Build\n\n";
|