diff options
Diffstat (limited to 'Source/cmMakefileExecutableTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileExecutableTargetGenerator.cxx | 50 |
1 files changed, 34 insertions, 16 deletions
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index d13895a..c1c3b63 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -25,9 +25,22 @@ #include "cmake.h" //---------------------------------------------------------------------------- -cmMakefileExecutableTargetGenerator::cmMakefileExecutableTargetGenerator() +cmMakefileExecutableTargetGenerator +::cmMakefileExecutableTargetGenerator(cmTarget* target): + cmMakefileTargetGenerator(target) { this->CustomCommandDriver = OnDepends; + this->Target->GetExecutableNames( + this->TargetNameOut, this->TargetNameReal, this->TargetNameImport, + this->TargetNamePDB, this->LocalGenerator->ConfigurationName.c_str()); + + if(this->Target->IsAppBundleOnApple()) + { + this->MacContentDirectory = this->Target->GetDirectory(); + this->MacContentDirectory += "/"; + this->MacContentDirectory += this->TargetNameOut; + this->MacContentDirectory += ".app/Contents/"; + } } //---------------------------------------------------------------------------- @@ -117,21 +130,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) outpath += "/"; if(this->Target->IsAppBundleOnApple()) { - // Compute bundle directory names. - std::string macdir = outpath; - macdir += targetName; - macdir += ".app/Contents/"; - outpath = macdir; - outpath += "MacOS"; - cmSystemTools::MakeDirectory(outpath.c_str()); - outpath += "/"; - - // Configure the Info.plist file. Note that it needs the executable name - // to be set. - std::string plist = macdir + "Info.plist"; - this->LocalGenerator->GenerateAppleInfoPList(this->Target, - targetName.c_str(), - plist.c_str()); + this->CreateAppBundle(targetName, outpath); } std::string outpathImp; if(relink) @@ -469,3 +468,22 @@ 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()); + 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()); +} |