diff options
author | Nicolas Despres <nicolas.despres@gmail.com> | 2012-07-16 14:00:40 (GMT) |
---|---|---|
committer | Peter Kümmel <syntheticpp@gmx.net> | 2012-07-17 12:03:09 (GMT) |
commit | 7bb56c511eaabf2071cd311b6cf14453651127e4 (patch) | |
tree | c9c9d4938652d59af72835c68dcdc1e3f51306da /Source/cmNinjaNormalTargetGenerator.cxx | |
parent | 03bdaf545369d4438a8aece8d3cec603d3a99727 (diff) | |
download | CMake-7bb56c511eaabf2071cd311b6cf14453651127e4.zip CMake-7bb56c511eaabf2071cd311b6cf14453651127e4.tar.gz CMake-7bb56c511eaabf2071cd311b6cf14453651127e4.tar.bz2 |
Re-factor CFBundle generation.
Diffstat (limited to 'Source/cmNinjaNormalTargetGenerator.cxx')
-rw-r--r-- | Source/cmNinjaNormalTargetGenerator.cxx | 35 |
1 files changed, 3 insertions, 32 deletions
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index d4fc02b..8d0493f 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -36,12 +36,7 @@ cmNinjaNormalTargetGenerator(cmTarget* target) , TargetNamePDB() , TargetLinkLanguage(0) { - // TODO: Re-factor with cmMakefileLibraryTargetGenerator's constructor. - if(target->IsCFBundleOnApple()) - { - target->SetProperty("PREFIX", ""); - target->SetProperty("SUFFIX", ""); - } + cmOSXBundleGenerator::PrepareTargetProperties(target); this->TargetLinkLanguage = target->GetLinkerLanguage(this->GetConfigName()); if (target->GetType() == cmTarget::EXECUTABLE) @@ -383,13 +378,11 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() // Create the library framework. this->OSXBundleGenerator->CreateFramework(this->TargetNameOut); } - // TODO: Re-factor with cmMakefileLibraryTargetGenerator::WriteLibraryRules. else if(this->GetTarget()->IsCFBundleOnApple()) { + // Create the core foundation bundle. std::string outpath; - outpath = this->GetTarget()->GetDirectory(this->GetConfigName()); - outpath += "/"; - this->CreateCFBundle(this->TargetNameOut, outpath); + this->OSXBundleGenerator->CreateCFBundle(this->TargetNameOut, outpath); } // Write comments. @@ -617,25 +610,3 @@ void cmNinjaNormalTargetGenerator::WriteObjectLibStatement() this->GetGlobalGenerator()->AddTargetAlias(this->GetTargetName(), this->GetTarget()); } - -//---------------------------------------------------------------------------- -// TODO: Re-factor with cmMakefileLibraryTargetGenerator::CreateCFBundle. -void cmNinjaNormalTargetGenerator::CreateCFBundle(std::string& targetName, - std::string& outpath) -{ - // Compute bundle directory names. - outpath = this->OSXBundleGenerator->GetMacContentDirectory(); - outpath += "MacOS"; - cmSystemTools::MakeDirectory(outpath.c_str()); - this->GetMakefile()->AddCMakeOutputFile(outpath.c_str()); - outpath += "/"; - - // Configure the Info.plist file. Note that it needs the executable name - // to be set. - std::string plist = this->OSXBundleGenerator->GetMacContentDirectory(); - plist += "Info.plist"; - this->GetLocalGenerator()->GenerateAppleInfoPList(this->GetTarget(), - targetName.c_str(), - plist.c_str()); - this->GetMakefile()->AddCMakeOutputFile(plist.c_str()); -} |