From eff0a824c4b1330da985dff3b7b9fa3793937866 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Mon, 3 Nov 2003 15:57:56 -0500 Subject: BUG: hack fix for problem of MS vs 6 and custom target commands --- Source/cmLocalVisualStudio6Generator.cxx | 5 +++++ Source/cmMakefile.cxx | 25 ++++++++++++++++++++++--- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx index 61cce39..13891ba 100644 --- a/Source/cmLocalVisualStudio6Generator.cxx +++ b/Source/cmLocalVisualStudio6Generator.cxx @@ -253,6 +253,11 @@ void cmLocalVisualStudio6Generator::WriteDSPFile(std::ostream& fout, m_Makefile->GetStartOutputDirectory(), libName, count); std::vector 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()); m_Makefile->AddCustomCommandToOutput(output, cc.GetCommand().c_str(), diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index d7ec582..c1bb833 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -570,12 +570,31 @@ AddCustomCommandToOutput(const char* outputIn, command = cmSystemTools::EscapeSpaces(command.c_str()); unsigned int i; + bool escapeSpaces = true; for (i = 0; i < commandArgs.size(); ++i) { expandC = commandArgs[i].c_str(); - this->ExpandVariablesInString(expandC); - combinedArgs += cmSystemTools::EscapeSpaces(expandC.c_str()); - combinedArgs += " "; + // 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. + 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; -- cgit v0.12