diff options
author | Brad King <brad.king@kitware.com> | 2010-12-21 19:03:02 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2010-12-21 19:03:02 (GMT) |
commit | 533f5a20372829aa41a71ed4698cac2a50820a7e (patch) | |
tree | 076562bbb762e4fc61c0bce10a13b02528e0fcbe /Source/cmGlobalXCodeGenerator.cxx | |
parent | ea38628366634189502b57c53d866bc436eb7c7f (diff) | |
parent | 53ea8b32045ce4c8045b904407e7e57d8d9fd4ab (diff) | |
download | CMake-533f5a20372829aa41a71ed4698cac2a50820a7e.zip CMake-533f5a20372829aa41a71ed4698cac2a50820a7e.tar.gz CMake-533f5a20372829aa41a71ed4698cac2a50820a7e.tar.bz2 |
Merge topic 'custom-command-refactor'
53ea8b3 Merge branch 'imported-target-dependencies' into custom-command-refactor
1a29cca Remove cmLocalGenerator::GetRealLocation
542b517 Factor out common custom command generator
6fe5b3d Simplify VS generator ConstructScript interface
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 31 |
1 files changed, 6 insertions, 25 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index cc6c686..59ca38f 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -18,6 +18,7 @@ #include "cmGeneratedFileStream.h" #include "cmComputeLinkInformation.h" #include "cmSourceFile.h" +#include "cmCustomCommandGenerator.h" #include <cmsys/auto_ptr.hxx> @@ -1314,8 +1315,7 @@ void cmGlobalXCodeGenerator cmCustomCommand const& cc = *i; if(!cc.GetCommandLines().empty()) { - bool escapeOldStyle = cc.GetEscapeOldStyle(); - bool escapeAllowMakeVars = cc.GetEscapeAllowMakeVars(); + cmCustomCommandGenerator ccg(cc, configName, this->CurrentMakefile); makefileStream << "\n"; const std::vector<std::string>& outputs = cc.GetOutputs(); if(!outputs.empty()) @@ -1348,20 +1348,15 @@ void cmGlobalXCodeGenerator { std::string echo_cmd = "echo "; echo_cmd += (this->CurrentLocalGenerator-> - EscapeForShell(comment, escapeAllowMakeVars)); + EscapeForShell(comment, cc.GetEscapeAllowMakeVars())); makefileStream << "\t" << echo_cmd.c_str() << "\n"; } // Add each command line to the set of commands. - for(cmCustomCommandLines::const_iterator cl = - cc.GetCommandLines().begin(); - cl != cc.GetCommandLines().end(); ++cl) + for(unsigned int c = 0; c < ccg.GetNumberOfCommands(); ++c) { // Build the command line in a single string. - const cmCustomCommandLine& commandLine = *cl; - std::string cmd2 = this->CurrentLocalGenerator - ->GetRealLocation(commandLine[0].c_str(), configName); - + std::string cmd2 = ccg.GetCommand(c); cmSystemTools::ReplaceString(cmd2, "/./", "/"); cmd2 = this->ConvertToRelativeForMake(cmd2.c_str()); std::string cmd; @@ -1372,21 +1367,7 @@ void cmGlobalXCodeGenerator cmd += " && "; } cmd += cmd2; - for(unsigned int j=1; j < commandLine.size(); ++j) - { - cmd += " "; - if(escapeOldStyle) - { - cmd += (this->CurrentLocalGenerator - ->EscapeForShellOldStyle(commandLine[j].c_str())); - } - else - { - cmd += (this->CurrentLocalGenerator-> - EscapeForShell(commandLine[j].c_str(), - escapeAllowMakeVars)); - } - } + ccg.AppendArguments(c, cmd); makefileStream << "\t" << cmd.c_str() << "\n"; } } |