diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2006-02-08 19:12:34 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2006-02-08 19:12:34 (GMT) |
commit | 55dd61946b6957e27c65690a0fe20ad4480a4cd5 (patch) | |
tree | 968b4fe2aa9476c621b886780c9c29fb38be28cc /Source/cmGlobalXCodeGenerator.cxx | |
parent | c6741363de141c0b4aa6bb214b7aea2b6aa2bc39 (diff) | |
download | CMake-55dd61946b6957e27c65690a0fe20ad4480a4cd5.zip CMake-55dd61946b6957e27c65690a0fe20ad4480a4cd5.tar.gz CMake-55dd61946b6957e27c65690a0fe20ad4480a4cd5.tar.bz2 |
ENH: working directory working for XCode
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 7e2a828..7ab9720 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -342,8 +342,9 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root, } cmCustomCommandLines commandLines; commandLines.push_back(makecommand); - mf->AddUtilityCommand("XCODE_DEPEND_HELPER", false, no_output, no_depends, + mf->AddUtilityCommand("XCODE_DEPEND_HELPER", false, no_output, no_working_directory, + no_depends, commandLines); // Add Re-Run CMake rules @@ -966,9 +967,17 @@ cmGlobalXCodeGenerator::AddCommandsToBuildPhase(cmXCodeObject* buildphase, { // Build the command line in a single string. const cmCustomCommandLine& commandLine = *cl; - std::string cmd = commandLine[0]; - cmSystemTools::ReplaceString(cmd, "/./", "/"); - cmd = this->ConvertToRelativeForMake(cmd.c_str()); + std::string cmd2 = commandLine[0]; + cmSystemTools::ReplaceString(cmd2, "/./", "/"); + cmd2 = this->ConvertToRelativeForMake(cmd2.c_str()); + std::string cmd; + if(cc.GetWorkingDirectory()) + { + cmd += "cd "; + cmd += this->ConvertToRelativeForMake(cc.GetWorkingDirectory()); + cmd += " && "; + } + cmd += cmd2; for(unsigned int j=1; j < commandLine.size(); ++j) { cmd += " "; |