浏览代码

cmGeneratorTarget: Move IsBundleOnApple from cmTarget.

Stephen Kelly 10 年之前
父节点
当前提交
ee26add4f4

+ 8 - 0
Source/cmGeneratorTarget.cxx

@@ -909,6 +909,14 @@ cmGeneratorTarget::GetAppBundleDirectory(const std::string& config,
   return fpath;
 }
 
+//----------------------------------------------------------------------------
+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

+ 4 - 0
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="",

+ 1 - 1
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;
     }

+ 1 - 1
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;
     }

+ 0 - 7
Source/cmTarget.cxx

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

+ 0 - 4
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;