diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2006-03-29 20:02:35 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2006-03-29 20:02:35 (GMT) |
commit | 32ec28ad00bdb31eddce4dd5f91c414a35b7efa0 (patch) | |
tree | 50fc438dfd3f3af055fab137a22dea989b7d3ae4 | |
parent | 4fd3292d04a8d6934d2d821767bf26baf7deaa90 (diff) | |
download | CMake-32ec28ad00bdb31eddce4dd5f91c414a35b7efa0.zip CMake-32ec28ad00bdb31eddce4dd5f91c414a35b7efa0.tar.gz CMake-32ec28ad00bdb31eddce4dd5f91c414a35b7efa0.tar.bz2 |
ENH: Add copy stages for bundle files
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 43 | ||||
-rw-r--r-- | Source/cmXCodeObject.cxx | 1 | ||||
-rw-r--r-- | Source/cmXCodeObject.h | 1 |
3 files changed, 45 insertions, 0 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index cf7a96d..250dc7d 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -616,6 +616,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen, // add all the sources std::vector<cmXCodeObject*> externalObjFiles; std::vector<cmXCodeObject*> headerFiles; + std::vector<cmXCodeObject*> specialBundleFiles; for(std::vector<cmSourceFile*>::iterator i = classes.begin(); i != classes.end(); ++i) { @@ -674,6 +675,48 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen, headerBuildPhase, frameworkBuildPhase, cmtarget); targets.push_back(this->CreateXCodeTarget(l->second, buildPhases)); + + // copy files build phase + typedef std::map<cmStdString, std::vector<cmSourceFile*> > + mapOfVectorOfSourceFiles; + mapOfVectorOfSourceFiles bundleFiles; + for(std::vector<cmSourceFile*>::iterator i = classes.begin(); + i != classes.end(); ++i) + { + const char* resLoc = (*i)->GetProperty("MACOSX_PACKAGE_LOCATION"); + if ( !resLoc ) + { + continue; + } + bundleFiles[resLoc].push_back(*i); + } + 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")); + copyFilesBuildPhase->AddAttribute("runOnlyForDeploymentPostprocessing", + this->CreateString("0")); + cmOStringStream ostr; + ostr << "../" << mit->first.c_str(); + copyFilesBuildPhase->AddAttribute("dstPath", + this->CreateString(ostr.str().c_str())); + buildFiles = this->CreateObject(cmXCodeObject::OBJECT_LIST); + copyFilesBuildPhase->AddAttribute("files", buildFiles); + std::vector<cmSourceFile*>::iterator sfIt; + for ( sfIt = mit->second.begin(); sfIt != mit->second.end(); ++ sfIt ) + { + cmXCodeObject* xsf = + this->CreateXCodeSourceFile(this->CurrentLocalGenerator, *sfIt, cmtarget); + buildFiles->AddObject(xsf); + } + } } } diff --git a/Source/cmXCodeObject.cxx b/Source/cmXCodeObject.cxx index 6f9af35..bd0d8d6 100644 --- a/Source/cmXCodeObject.cxx +++ b/Source/cmXCodeObject.cxx @@ -10,6 +10,7 @@ const char* cmXCodeObject::PBXTypeNames[] = { "PBXExecutableFileReference", "PBXLibraryReference", "PBXToolTarget", "PBXLibraryTarget", "PBXAggregateTarget", "XCBuildConfiguration", "XCConfigurationList", + "PBXCopyFilesBuildPhase", "None" }; diff --git a/Source/cmXCodeObject.h b/Source/cmXCodeObject.h index 8db8f45..04d1f93 100644 --- a/Source/cmXCodeObject.h +++ b/Source/cmXCodeObject.h @@ -16,6 +16,7 @@ public: PBXApplicationReference, PBXExecutableFileReference, PBXLibraryReference, PBXToolTarget, PBXLibraryTarget, PBXAggregateTarget,XCBuildConfiguration,XCConfigurationList, + PBXCopyFilesBuildPhase, None }; class StringVec: public std::vector<cmStdString> {}; |