From 95038439ea5abc88a330ad36c4e25d1afdc9f0e0 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 28 Oct 2009 09:12:38 -0400 Subject: Keep Xcode intermediate files away from output dir Previously the Xcode generator set SYMROOT to be the target output directory. This told Xcode to put the ".build" directory in the output path too. This commit sets SYMROOT, CONFIGURATION_BUILD_DIR, and OBJROOT to put intermediate files in the build directory corresponding to the source directory that created each target. This is more consistent with the VS IDE generators. Now only the build output files (actual targets) go to the target output directory. --- Source/cmGlobalXCodeGenerator.cxx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index e0d6b5d..be21c6c 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1564,7 +1564,18 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, target.GetType() == cmTarget::MODULE_LIBRARY || target.GetType() == cmTarget::EXECUTABLE) { - pndir = target.GetDirectory(); + if(this->XcodeVersion >= 21) + { + std::string pncdir = target.GetDirectory(configName); + buildSettings->AddAttribute("CONFIGURATION_BUILD_DIR", + this->CreateString(pncdir.c_str())); + } + else + { + buildSettings->AddAttribute("OBJROOT", + this->CreateString(pndir.c_str())); + pndir = target.GetDirectory(configName); + } buildSettings->AddAttribute("EXECUTABLE_PREFIX", this->CreateString(pnprefix.c_str())); buildSettings->AddAttribute("EXECUTABLE_SUFFIX", @@ -2910,7 +2921,8 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget( // then remove those exectuables as well if(this->Architectures.size() > 1) { - std::string universal = t->GetDirectory(); + std::string universal = + t->GetMakefile()->GetCurrentOutputDirectory(); universal += "/"; universal += this->CurrentProject; universal += ".build/"; -- cgit v0.12