BUG: hack fix for problem of MS vs 6 and custom target commands

This commit is contained in:
Bill Hoffman 2003-11-03 15:57:56 -05:00
parent 271f4be42a
commit eff0a824c4
2 changed files with 27 additions and 3 deletions

View File

@ -253,6 +253,11 @@ void cmLocalVisualStudio6Generator::WriteDSPFile(std::ostream& fout,
m_Makefile->GetStartOutputDirectory(), m_Makefile->GetStartOutputDirectory(),
libName, count); libName, count);
std::vector<std::string> args; std::vector<std::string> args;
// This is a hack to fix a problem with cmCustomCommand
// The cmCustomCommand should store the arguments as a vector
// and not a string, and the cmAddCustomTargetCommand should
// not EscapeSpaces.
args.push_back("This is really a single argument do not escape spaces");
args.push_back(cc.GetArguments()); args.push_back(cc.GetArguments());
m_Makefile->AddCustomCommandToOutput(output, m_Makefile->AddCustomCommandToOutput(output,
cc.GetCommand().c_str(), cc.GetCommand().c_str(),

View File

@ -570,12 +570,31 @@ AddCustomCommandToOutput(const char* outputIn,
command = cmSystemTools::EscapeSpaces(command.c_str()); command = cmSystemTools::EscapeSpaces(command.c_str());
unsigned int i; unsigned int i;
bool escapeSpaces = true;
for (i = 0; i < commandArgs.size(); ++i) for (i = 0; i < commandArgs.size(); ++i)
{ {
expandC = commandArgs[i].c_str(); expandC = commandArgs[i].c_str();
this->ExpandVariablesInString(expandC); // This is a hack to fix a problem with cmCustomCommand
combinedArgs += cmSystemTools::EscapeSpaces(expandC.c_str()); // The cmCustomCommand should store the arguments as a vector
combinedArgs += " "; // and not a string, and the cmAddCustomTargetCommand should
// not EscapeSpaces.
if(expandC == "This is really a single argument do not escape spaces")
{
escapeSpaces = false;
}
else
{
this->ExpandVariablesInString(expandC);
if(escapeSpaces)
{
combinedArgs += cmSystemTools::EscapeSpaces(expandC.c_str());
}
else
{
combinedArgs += expandC;
}
combinedArgs += " ";
}
} }
cmSourceFile *file = 0; cmSourceFile *file = 0;