summaryrefslogtreecommitdiff
path: root/Source/cmGlobalXCodeGenerator.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2006-01-05 09:13:06 -0500
committerBill Hoffman <bill.hoffman@kitware.com>2006-01-05 09:13:06 -0500
commit7b1440ab9fef6d240eb5beb333ac606f966486a4 (patch)
tree6726bf3178e42757fedb06ce1623c76f29d7eb59 /Source/cmGlobalXCodeGenerator.cxx
parent11cd7b0b3f20b384220e65c4ef9de5afea0b1618 (diff)
downloadcmake-7b1440ab9fef6d240eb5beb333ac606f966486a4.tar.gz
ENH: fix bundles for Mac and Xcode
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx28
1 files changed, 28 insertions, 0 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index e4754b3f25..f8c4f5aadf 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -505,6 +505,10 @@ cmGlobalXCodeGenerator::CreateXCodeSourceFile(cmLocalGenerator* lg,
{
sourcecode += ".cpp.objc";
}
+ else if(ext == "plist")
+ {
+ sourcecode += ".text.plist";
+ }
else if(!lang)
{
sourcecode += ext;
@@ -1146,7 +1150,20 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
fileType = "compiled.mach-o.executable";
if(target.GetPropertyAsBool("MACOSX_BUNDLE"))
{
+ std::string f1 = m_CurrentMakefile->GetModulesFile("MacOSXBundleInfo.plist.in");
+ if ( f1.size() == 0 )
+ {
+ cmSystemTools::Error("could not find Mac OSX bundle template file.");
+ }
+ std::string f2 = m_CurrentMakefile->GetCurrentOutputDirectory();
+ f2 += "/Info.plist";
+ m_CurrentMakefile->ConfigureFile(f1.c_str(), f2.c_str(), false, false, false);
productType = "com.apple.product-type.application";
+ std::string path =
+ this->ConvertToRelativeForXCode(f2.c_str());
+ buildSettings->AddAttribute("INFOPLIST_FILE",
+ this->CreateString(path.c_str()));
+
}
else
{
@@ -1777,6 +1794,17 @@ void cmGlobalXCodeGenerator::CreateGroups(cmLocalGenerator* root,
for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); l++)
{
cmTarget& cmtarget = l->second;
+ // add the soon to be generated Info.plist file as a source for a MACOSX_BUNDLE
+ // file
+ if(cmtarget.GetPropertyAsBool("MACOSX_BUNDLE"))
+ {
+ cmSourceFile file;
+ file.SetName("Info.plist", m_CurrentMakefile->GetCurrentOutputDirectory(),
+ m_CurrentMakefile->GetSourceExtensions(),
+ m_CurrentMakefile->GetHeaderExtensions());
+ cmtarget.GetSourceFiles().push_back(m_CurrentMakefile->AddSource(file));
+ }
+
std::vector<cmSourceFile*> & classes = cmtarget.GetSourceFiles();
for(std::vector<cmSourceFile*>::const_iterator s = classes.begin();
s != classes.end(); s++)