diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index ab0d02bcc..7e457bb8a 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -1587,7 +1587,7 @@ std::string cmGeneratorTarget::GetCFBundleDirectory(const std::string& config, const char *ext = this->GetProperty("BUNDLE_EXTENSION"); if (!ext) { - if (this->Target->IsXCTestOnApple()) + if (this->IsXCTestOnApple()) { ext = "xctest"; } @@ -5962,3 +5962,10 @@ bool cmGeneratorTarget::IsAppBundleOnApple() const this->Makefile->IsOn("APPLE") && this->GetPropertyAsBool("MACOSX_BUNDLE")); } + +//---------------------------------------------------------------------------- +bool cmGeneratorTarget::IsXCTestOnApple() const +{ + return (this->Target->IsCFBundleOnApple() && + this->GetPropertyAsBool("XCTEST")); +} diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 24a1c2c5a..ce2f42e78 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -422,6 +422,9 @@ public: /** Return whether this target is an executable Bundle on Apple. */ bool IsAppBundleOnApple() const; + /** Return whether this target is a XCTest on Apple. */ + bool IsXCTestOnApple() const; + struct SourceFileFlags GetTargetSourceFileFlags(const cmSourceFile* sf) const; diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 527a84fcc..a489767c7 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -2651,7 +2651,7 @@ const char* cmGlobalXCodeGenerator::GetTargetFileType( case cmState::STATIC_LIBRARY: return "archive.ar"; case cmState::MODULE_LIBRARY: - if (target->Target->IsXCTestOnApple()) + if (target->IsXCTestOnApple()) return "wrapper.cfbundle"; else if (target->Target->IsCFBundleOnApple()) return "wrapper.plug-in"; @@ -2678,7 +2678,7 @@ const char* cmGlobalXCodeGenerator::GetTargetProductType( case cmState::STATIC_LIBRARY: return "com.apple.product-type.library.static"; case cmState::MODULE_LIBRARY: - if (target->Target->IsXCTestOnApple()) + if (target->IsXCTestOnApple()) return "com.apple.product-type.bundle.unit-test"; else if (target->Target->IsCFBundleOnApple()) return "com.apple.product-type.bundle"; diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 761267dfc..02a5ea68c 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -376,13 +376,6 @@ bool cmTarget::IsCFBundleOnApple() const this->GetPropertyAsBool("BUNDLE")); } -//---------------------------------------------------------------------------- -bool cmTarget::IsXCTestOnApple() const -{ - return (this->IsCFBundleOnApple() && - this->GetPropertyAsBool("XCTEST")); -} - //---------------------------------------------------------------------------- void cmTarget::AddTracedSources(std::vector const& srcs) { diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 51e97fd30..7cf480875 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -238,9 +238,6 @@ public: /** Return whether this target is a CFBundle (plugin) on Apple. */ bool IsCFBundleOnApple() const; - /** Return whether this target is a XCTest on Apple. */ - bool IsXCTestOnApple() const; - /** Return whether this target is an executable Bundle on Apple. */ bool IsAppBundleOnApple() const;