From ee26add4f4062d8b53f22e161027a573dc03399c Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 4 Aug 2015 19:19:49 +0200 Subject: cmGeneratorTarget: Move IsBundleOnApple from cmTarget. --- Source/cmGeneratorTarget.cxx | 8 ++++++++ Source/cmGeneratorTarget.h | 4 ++++ Source/cmMakefileTargetGenerator.cxx | 2 +- Source/cmNinjaTargetGenerator.cxx | 2 +- Source/cmTarget.cxx | 7 ------- Source/cmTarget.h | 4 ---- 6 files changed, 14 insertions(+), 13 deletions(-) diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index c314372..c68c2b9 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -910,6 +910,14 @@ cmGeneratorTarget::GetAppBundleDirectory(const std::string& config, } //---------------------------------------------------------------------------- +bool cmGeneratorTarget::IsBundleOnApple() const +{ + return this->Target->IsFrameworkOnApple() + || this->Target->IsAppBundleOnApple() + || this->Target->IsCFBundleOnApple(); +} + +//---------------------------------------------------------------------------- std::string cmGeneratorTarget::GetCFBundleDirectory(const std::string& config, bool contentOnly) const { diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index a1193a6..21e0900 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -119,6 +119,10 @@ public: std::string GetAppBundleDirectory(const std::string& config, bool contentOnly) const; + /** Return whether this target is an executable Bundle, a framework + or CFBundle on Apple. */ + bool IsBundleOnApple() const; + /** Get the full name of the target according to the settings in its makefile. */ std::string GetFullName(const std::string& config="", diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index d38cf4c..0b3df90 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -313,7 +313,7 @@ cmMakefileTargetGenerator::MacOSXContentGeneratorType::operator() (cmSourceFile const& source, const char* pkgloc) { // Skip OS X content when not building a Framework or Bundle. - if(!this->Generator->GetTarget()->IsBundleOnApple()) + if(!this->Generator->GetGeneratorTarget()->IsBundleOnApple()) { return; } diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 16e1f48..07efa16 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -742,7 +742,7 @@ cmNinjaTargetGenerator::MacOSXContentGeneratorType::operator()( cmSourceFile const& source, const char* pkgloc) { // Skip OS X content when not building a Framework or Bundle. - if(!this->Generator->GetTarget()->IsBundleOnApple()) + if(!this->Generator->GetGeneratorTarget()->IsBundleOnApple()) { return; } diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 62aa12a..e887ef3 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -590,13 +590,6 @@ bool cmTarget::IsXCTestOnApple() const } //---------------------------------------------------------------------------- -bool cmTarget::IsBundleOnApple() const -{ - return this->IsFrameworkOnApple() || this->IsAppBundleOnApple() || - this->IsCFBundleOnApple(); -} - -//---------------------------------------------------------------------------- static bool processSources(cmTarget const* tgt, const std::vector &entries, std::vector &srcs, diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 9a4915f..e53afff 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -424,10 +424,6 @@ public: /** Return whether this target is an executable Bundle on Apple. */ bool IsAppBundleOnApple() const; - /** Return whether this target is an executable Bundle, a framework - or CFBundle on Apple. */ - bool IsBundleOnApple() const; - /** Return the framework version string. Undefined if IsFrameworkOnApple returns false. */ std::string GetFrameworkVersion() const; -- cgit v0.12