cmGeneratorTarget: Move IsBundleOnApple from cmTarget.

This commit is contained in:
Stephen Kelly 2015-08-04 19:19:49 +02:00
parent c8a5f5ae60
commit ee26add4f4
6 changed files with 14 additions and 13 deletions

View File

@ -909,6 +909,14 @@ cmGeneratorTarget::GetAppBundleDirectory(const std::string& config,
return fpath; return fpath;
} }
//----------------------------------------------------------------------------
bool cmGeneratorTarget::IsBundleOnApple() const
{
return this->Target->IsFrameworkOnApple()
|| this->Target->IsAppBundleOnApple()
|| this->Target->IsCFBundleOnApple();
}
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
std::string cmGeneratorTarget::GetCFBundleDirectory(const std::string& config, std::string cmGeneratorTarget::GetCFBundleDirectory(const std::string& config,
bool contentOnly) const bool contentOnly) const

View File

@ -119,6 +119,10 @@ public:
std::string GetAppBundleDirectory(const std::string& config, std::string GetAppBundleDirectory(const std::string& config,
bool contentOnly) const; 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 /** Get the full name of the target according to the settings in its
makefile. */ makefile. */
std::string GetFullName(const std::string& config="", std::string GetFullName(const std::string& config="",

View File

@ -313,7 +313,7 @@ cmMakefileTargetGenerator::MacOSXContentGeneratorType::operator()
(cmSourceFile const& source, const char* pkgloc) (cmSourceFile const& source, const char* pkgloc)
{ {
// Skip OS X content when not building a Framework or Bundle. // Skip OS X content when not building a Framework or Bundle.
if(!this->Generator->GetTarget()->IsBundleOnApple()) if(!this->Generator->GetGeneratorTarget()->IsBundleOnApple())
{ {
return; return;
} }

View File

@ -742,7 +742,7 @@ cmNinjaTargetGenerator::MacOSXContentGeneratorType::operator()(
cmSourceFile const& source, const char* pkgloc) cmSourceFile const& source, const char* pkgloc)
{ {
// Skip OS X content when not building a Framework or Bundle. // Skip OS X content when not building a Framework or Bundle.
if(!this->Generator->GetTarget()->IsBundleOnApple()) if(!this->Generator->GetGeneratorTarget()->IsBundleOnApple())
{ {
return; return;
} }

View File

@ -589,13 +589,6 @@ bool cmTarget::IsXCTestOnApple() const
this->GetPropertyAsBool("XCTEST")); this->GetPropertyAsBool("XCTEST"));
} }
//----------------------------------------------------------------------------
bool cmTarget::IsBundleOnApple() const
{
return this->IsFrameworkOnApple() || this->IsAppBundleOnApple() ||
this->IsCFBundleOnApple();
}
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
static bool processSources(cmTarget const* tgt, static bool processSources(cmTarget const* tgt,
const std::vector<cmTargetInternals::TargetPropertyEntry*> &entries, const std::vector<cmTargetInternals::TargetPropertyEntry*> &entries,

View File

@ -424,10 +424,6 @@ public:
/** Return whether this target is an executable Bundle on Apple. */ /** Return whether this target is an executable Bundle on Apple. */
bool IsAppBundleOnApple() const; 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 /** Return the framework version string. Undefined if
IsFrameworkOnApple returns false. */ IsFrameworkOnApple returns false. */
std::string GetFrameworkVersion() const; std::string GetFrameworkVersion() const;