summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileExecutableTargetGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmMakefileExecutableTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileExecutableTargetGenerator.cxx45
1 files changed, 15 insertions, 30 deletions
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index 78278cb..ab5150a 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -29,13 +29,19 @@ cmMakefileExecutableTargetGenerator
this->TargetNameOut, this->TargetNameReal, this->TargetNameImport,
this->TargetNamePDB, this->ConfigName);
- if(this->Target->IsAppBundleOnApple())
- {
- this->MacContentDirectory = this->Target->GetDirectory(this->ConfigName);
- this->MacContentDirectory += "/";
- this->MacContentDirectory += this->TargetNameOut;
- this->MacContentDirectory += ".app/Contents/";
- }
+ this->OSXBundleGenerator = new cmOSXBundleGenerator(this->Target,
+ this->TargetNameOut,
+ this->ConfigName);
+ this->OSXBundleGenerator->SetMacContentFolders(&this->MacContentFolders);
+ this->MacContentDirectory =
+ this->OSXBundleGenerator->GetMacContentDirectory();
+}
+
+//----------------------------------------------------------------------------
+cmMakefileExecutableTargetGenerator
+::~cmMakefileExecutableTargetGenerator()
+{
+ delete this->OSXBundleGenerator;
}
//----------------------------------------------------------------------------
@@ -100,7 +106,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
outpath += "/";
if(this->Target->IsAppBundleOnApple())
{
- this->CreateAppBundle(targetName, outpath);
+ this->OSXBundleGenerator->CreateAppBundle(targetName, outpath);
}
std::string outpathImp;
if(relink)
@@ -129,7 +135,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
std::string targetFullPathReal = outpath + targetNameReal;
std::string targetFullPathPDB = outpath + targetNamePDB;
std::string targetFullPathImport = outpathImp + targetNameImport;
- std::string targetOutPathPDB =
+ std::string targetOutPathPDB =
this->Convert(targetFullPathPDB.c_str(),
cmLocalGenerator::NONE,
cmLocalGenerator::SHELL);
@@ -440,24 +446,3 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
exeCleanFiles.begin(),
exeCleanFiles.end());
}
-
-//----------------------------------------------------------------------------
-void
-cmMakefileExecutableTargetGenerator::CreateAppBundle(std::string& targetName,
- std::string& outpath)
-{
- // Compute bundle directory names.
- outpath = this->MacContentDirectory;
- outpath += "MacOS";
- cmSystemTools::MakeDirectory(outpath.c_str());
- this->Makefile->AddCMakeOutputFile(outpath.c_str());
- outpath += "/";
-
- // Configure the Info.plist file. Note that it needs the executable name
- // to be set.
- std::string plist = this->MacContentDirectory + "Info.plist";
- this->LocalGenerator->GenerateAppleInfoPList(this->Target,
- targetName.c_str(),
- plist.c_str());
- this->Makefile->AddCMakeOutputFile(plist.c_str());
-}