cmGeneratorTarget: Move IsCFBundleOnApple from cmTarget.
This commit is contained in:
parent
7550879f57
commit
d8f8940bc6
|
@ -1095,7 +1095,7 @@ cmExportFileGenerator
|
|||
<< " PROPERTY MACOSX_BUNDLE 1)\n";
|
||||
}
|
||||
|
||||
if (target->Target->IsCFBundleOnApple())
|
||||
if (target->IsCFBundleOnApple())
|
||||
{
|
||||
os << "set_property(TARGET " << targetName
|
||||
<< " PROPERTY BUNDLE 1)\n";
|
||||
|
|
|
@ -1574,7 +1574,7 @@ bool cmGeneratorTarget::IsBundleOnApple() const
|
|||
{
|
||||
return this->IsFrameworkOnApple()
|
||||
|| this->IsAppBundleOnApple()
|
||||
|| this->Target->IsCFBundleOnApple();
|
||||
|| this->IsCFBundleOnApple();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
@ -1943,7 +1943,7 @@ cmGeneratorTarget::BuildMacContentDirectory(const std::string& base,
|
|||
{
|
||||
fpath += this->GetFrameworkDirectory(config, contentOnly);
|
||||
}
|
||||
if(this->Target->IsCFBundleOnApple())
|
||||
if(this->IsCFBundleOnApple())
|
||||
{
|
||||
fpath += this->GetCFBundleDirectory(config, contentOnly);
|
||||
}
|
||||
|
@ -3483,7 +3483,7 @@ void cmGeneratorTarget::GetFullNameInternal(const std::string& config,
|
|||
targetSuffix = 0;
|
||||
}
|
||||
|
||||
if(this->Target->IsCFBundleOnApple())
|
||||
if(this->IsCFBundleOnApple())
|
||||
{
|
||||
fw_prefix = this->GetCFBundleDirectory(config, false);
|
||||
fw_prefix += "/";
|
||||
|
@ -5966,6 +5966,14 @@ bool cmGeneratorTarget::IsAppBundleOnApple() const
|
|||
//----------------------------------------------------------------------------
|
||||
bool cmGeneratorTarget::IsXCTestOnApple() const
|
||||
{
|
||||
return (this->Target->IsCFBundleOnApple() &&
|
||||
return (this->IsCFBundleOnApple() &&
|
||||
this->GetPropertyAsBool("XCTEST"));
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool cmGeneratorTarget::IsCFBundleOnApple() const
|
||||
{
|
||||
return (this->GetType() == cmState::MODULE_LIBRARY &&
|
||||
this->Makefile->IsOn("APPLE") &&
|
||||
this->GetPropertyAsBool("BUNDLE"));
|
||||
}
|
||||
|
|
|
@ -425,6 +425,9 @@ public:
|
|||
/** Return whether this target is a XCTest on Apple. */
|
||||
bool IsXCTestOnApple() const;
|
||||
|
||||
/** Return whether this target is a CFBundle (plugin) on Apple. */
|
||||
bool IsCFBundleOnApple() const;
|
||||
|
||||
struct SourceFileFlags
|
||||
GetTargetSourceFileFlags(const cmSourceFile* sf) const;
|
||||
|
||||
|
|
|
@ -1197,7 +1197,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
|
|||
// some build phases only apply to bundles and/or frameworks
|
||||
bool isFrameworkTarget = gtgt->IsFrameworkOnApple();
|
||||
bool isBundleTarget = cmtarget.GetPropertyAsBool("MACOSX_BUNDLE");
|
||||
bool isCFBundleTarget = cmtarget.IsCFBundleOnApple();
|
||||
bool isCFBundleTarget = gtgt->IsCFBundleOnApple();
|
||||
|
||||
cmXCodeObject* buildFiles = 0;
|
||||
|
||||
|
@ -1993,7 +1993,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
|
|||
pndir = gtgt->GetDirectory(configName);
|
||||
}
|
||||
|
||||
if(gtgt->IsFrameworkOnApple() || target.IsCFBundleOnApple())
|
||||
if(gtgt->IsFrameworkOnApple() || gtgt->IsCFBundleOnApple())
|
||||
{
|
||||
pnprefix = "";
|
||||
}
|
||||
|
@ -2046,7 +2046,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
|
|||
{
|
||||
buildSettings->AddAttribute("LIBRARY_STYLE",
|
||||
this->CreateString("BUNDLE"));
|
||||
if (target.IsCFBundleOnApple())
|
||||
if (gtgt->IsCFBundleOnApple())
|
||||
{
|
||||
// It turns out that a BUNDLE is basically the same
|
||||
// in many ways as an application bundle, as far as
|
||||
|
@ -2653,7 +2653,7 @@ const char* cmGlobalXCodeGenerator::GetTargetFileType(
|
|||
case cmState::MODULE_LIBRARY:
|
||||
if (target->IsXCTestOnApple())
|
||||
return "wrapper.cfbundle";
|
||||
else if (target->Target->IsCFBundleOnApple())
|
||||
else if (target->IsCFBundleOnApple())
|
||||
return "wrapper.plug-in";
|
||||
else
|
||||
return ((this->XcodeVersion >= 22)?
|
||||
|
@ -2680,7 +2680,7 @@ const char* cmGlobalXCodeGenerator::GetTargetProductType(
|
|||
case cmState::MODULE_LIBRARY:
|
||||
if (target->IsXCTestOnApple())
|
||||
return "com.apple.product-type.bundle.unit-test";
|
||||
else if (target->Target->IsCFBundleOnApple())
|
||||
else if (target->IsCFBundleOnApple())
|
||||
return "com.apple.product-type.bundle";
|
||||
else
|
||||
return ((this->XcodeVersion >= 22)?
|
||||
|
|
|
@ -226,7 +226,7 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(std::ostream& os,
|
|||
filesFrom.push_back(from1);
|
||||
filesTo.push_back(to1);
|
||||
}
|
||||
else if(this->Target->Target->IsCFBundleOnApple())
|
||||
else if(this->Target->IsCFBundleOnApple())
|
||||
{
|
||||
// Install the whole app bundle directory.
|
||||
type = cmInstallType_DIRECTORY;
|
||||
|
|
|
@ -279,7 +279,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
|
|||
this->OSXBundleGenerator->CreateFramework(targetName, outpath);
|
||||
outpath += "/";
|
||||
}
|
||||
else if(this->Target->IsCFBundleOnApple())
|
||||
else if(this->GeneratorTarget->IsCFBundleOnApple())
|
||||
{
|
||||
outpath = this->GeneratorTarget->GetDirectory(this->ConfigName);
|
||||
this->OSXBundleGenerator->CreateCFBundle(targetName, outpath);
|
||||
|
@ -360,7 +360,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
|
|||
buildEcho += " shared library ";
|
||||
break;
|
||||
case cmState::MODULE_LIBRARY:
|
||||
if (this->Target->IsCFBundleOnApple())
|
||||
if (this->GeneratorTarget->IsCFBundleOnApple())
|
||||
buildEcho += " CFBundle";
|
||||
buildEcho += " shared module ";
|
||||
break;
|
||||
|
|
|
@ -139,7 +139,7 @@ const char *cmNinjaNormalTargetGenerator::GetVisibleTypeName() const
|
|||
case cmState::SHARED_LIBRARY:
|
||||
return "shared library";
|
||||
case cmState::MODULE_LIBRARY:
|
||||
if (this->GetTarget()->IsCFBundleOnApple())
|
||||
if (this->GetGeneratorTarget()->IsCFBundleOnApple())
|
||||
return "CFBundle shared module";
|
||||
else
|
||||
return "shared module";
|
||||
|
@ -434,7 +434,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
|
|||
this->OSXBundleGenerator->CreateFramework(this->TargetNameOut,
|
||||
gt.GetDirectory(cfgName));
|
||||
}
|
||||
else if(target.IsCFBundleOnApple())
|
||||
else if(gt.IsCFBundleOnApple())
|
||||
{
|
||||
// Create the core foundation bundle.
|
||||
this->OSXBundleGenerator->CreateCFBundle(this->TargetNameOut,
|
||||
|
|
|
@ -368,14 +368,6 @@ bool cmTarget::IsAppBundleOnApple() const
|
|||
this->GetPropertyAsBool("MACOSX_BUNDLE"));
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool cmTarget::IsCFBundleOnApple() const
|
||||
{
|
||||
return (this->GetType() == cmState::MODULE_LIBRARY &&
|
||||
this->Makefile->IsOn("APPLE") &&
|
||||
this->GetPropertyAsBool("BUNDLE"));
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
void cmTarget::AddTracedSources(std::vector<std::string> const& srcs)
|
||||
{
|
||||
|
|
|
@ -235,9 +235,6 @@ public:
|
|||
Apple. */
|
||||
bool IsFrameworkOnApple() const;
|
||||
|
||||
/** Return whether this target is a CFBundle (plugin) on Apple. */
|
||||
bool IsCFBundleOnApple() const;
|
||||
|
||||
/** Return whether this target is an executable Bundle on Apple. */
|
||||
bool IsAppBundleOnApple() const;
|
||||
|
||||
|
|
Loading…
Reference in New Issue