diff options
author | Nicolas Despres <nicolas.despres@gmail.com> | 2012-07-07 17:54:16 (GMT) |
---|---|---|
committer | Peter Kümmel <syntheticpp@gmx.net> | 2012-07-17 12:03:07 (GMT) |
commit | a1b803349b51a9a814cd8e309832991306ef2cf0 (patch) | |
tree | 81e3c385a33cdc834cc2930d2b7da13283b2d045 /Source/cmMakefileExecutableTargetGenerator.cxx | |
parent | 3ba74ad9d586816f7c60cc6f527148edf982871c (diff) | |
download | CMake-a1b803349b51a9a814cd8e309832991306ef2cf0.zip CMake-a1b803349b51a9a814cd8e309832991306ef2cf0.tar.gz CMake-a1b803349b51a9a814cd8e309832991306ef2cf0.tar.bz2 |
Re-factor OS X bundle and framework generation.
Diffstat (limited to 'Source/cmMakefileExecutableTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileExecutableTargetGenerator.cxx | 46 |
1 files changed, 16 insertions, 30 deletions
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index 36e366e..d9ab334 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -18,24 +18,31 @@ #include "cmSourceFile.h" #include "cmTarget.h" #include "cmake.h" +#include "cmOSXBundleGenerator.h" //---------------------------------------------------------------------------- cmMakefileExecutableTargetGenerator ::cmMakefileExecutableTargetGenerator(cmTarget* target): - cmMakefileTargetGenerator(target) + cmMakefileTargetGenerator(target), + OSXBundleGenerator(0) { this->CustomCommandDriver = OnDepends; this->Target->GetExecutableNames( 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->MacContentDirectory = + this->OSXBundleGenerator->GetMacContentDirectory(); +} + +//---------------------------------------------------------------------------- +cmMakefileExecutableTargetGenerator +::~cmMakefileExecutableTargetGenerator() +{ + delete this->OSXBundleGenerator; } //---------------------------------------------------------------------------- @@ -100,7 +107,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) @@ -440,24 +447,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()); -} |