From c2da47550734575dc5fe17ce1d02e8ca37e09f4b Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Wed, 29 Mar 2006 16:34:52 -0500 Subject: [PATCH] ENH: Use PBXResourcesBuildPhase for resrources --- Source/cmGlobalXCodeGenerator.cxx | 39 +++++++++++++++++++------------ 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index e199857a04..3d5dce70ed 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -693,23 +693,32 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen, mapOfVectorOfSourceFiles::iterator mit; for ( mit = bundleFiles.begin(); mit != bundleFiles.end(); ++ mit ) { - cmXCodeObject* copyFilesBuildPhase - = this->CreateObject(cmXCodeObject::PBXCopyFilesBuildPhase); - buildPhases->AddObject(copyFilesBuildPhase); - copyFilesBuildPhase->SetComment("Copy files"); - copyFilesBuildPhase->AddAttribute("buildActionMask", - this->CreateString("2147483647")); - copyFilesBuildPhase->AddAttribute("dstSubfolderSpec", - this->CreateString("6")); + cmXCodeObject* copyFilesBuildPhase; + if ( mit->first == "Resources" ) + { + copyFilesBuildPhase + = this->CreateObject(cmXCodeObject::PBXResourcesBuildPhase); + } + else + { + copyFilesBuildPhase + = this->CreateObject(cmXCodeObject::PBXCopyFilesBuildPhase); + copyFilesBuildPhase->SetComment("Copy files"); + copyFilesBuildPhase->AddAttribute("buildActionMask", + this->CreateString("2147483647")); + copyFilesBuildPhase->AddAttribute("dstSubfolderSpec", + this->CreateString("6")); + cmOStringStream ostr; + if ( mit->first != "MacOS" ) + { + ostr << "../" << mit->first.c_str(); + } + copyFilesBuildPhase->AddAttribute("dstPath", + this->CreateString(ostr.str().c_str())); + } copyFilesBuildPhase->AddAttribute("runOnlyForDeploymentPostprocessing", this->CreateString("0")); - cmOStringStream ostr; - if ( mit->first != "MacOS" ) - { - ostr << "../" << mit->first.c_str(); - } - copyFilesBuildPhase->AddAttribute("dstPath", - this->CreateString(ostr.str().c_str())); + buildPhases->AddObject(copyFilesBuildPhase); buildFiles = this->CreateObject(cmXCodeObject::OBJECT_LIST); copyFilesBuildPhase->AddAttribute("files", buildFiles); std::vector::iterator sfIt;