summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalXCodeGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-10-28 13:12:38 (GMT)
committerBrad King <brad.king@kitware.com>2009-10-28 13:12:38 (GMT)
commit95038439ea5abc88a330ad36c4e25d1afdc9f0e0 (patch)
tree094d19ba0a386179c82ffd02c4d5d4ef87096987 /Source/cmGlobalXCodeGenerator.cxx
parente0d0d5db0f45e6b86e70916200999562cb877026 (diff)
downloadCMake-95038439ea5abc88a330ad36c4e25d1afdc9f0e0.zip
CMake-95038439ea5abc88a330ad36c4e25d1afdc9f0e0.tar.gz
CMake-95038439ea5abc88a330ad36c4e25d1afdc9f0e0.tar.bz2
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 "<proj>.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.
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx16
1 files 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/";