Commit 88d10d55 authored by Stephen Kelly's avatar Stephen Kelly

cmGeneratorTarget: Copy IsAppBundleOnApple from cmTarget.

Leave the cmTarget method behind for now to implement cmInstallCommand.
parent b5f5de70
......@@ -202,7 +202,7 @@ cmExportBuildFileGenerator
std::string prop = "IMPORTED_LOCATION";
prop += suffix;
std::string value;
if(target->Target->IsAppBundleOnApple())
if(target->IsAppBundleOnApple())
{
value = target->GetFullPath(config, false);
}
......
......@@ -1089,7 +1089,7 @@ cmExportFileGenerator
}
// Mark the imported executable if it is an application bundle.
if(target->Target->IsAppBundleOnApple())
if(target->IsAppBundleOnApple())
{
os << "set_property(TARGET " << targetName
<< " PROPERTY MACOSX_BUNDLE 1)\n";
......
......@@ -433,7 +433,7 @@ cmExportInstallFileGenerator
prop += suffix;
// Append the installed file name.
if(target->Target->IsAppBundleOnApple())
if(target->IsAppBundleOnApple())
{
value += itgen->GetInstallFilename(target, config);
value += ".app/Contents/MacOS/";
......
......@@ -851,7 +851,7 @@ const char* cmGeneratorTarget::GetLocationForBuild() const
location += cfgid;
}
if(this->Target->IsAppBundleOnApple())
if(this->IsAppBundleOnApple())
{
std::string macdir = this->BuildMacContentDirectory("", "",
false);
......@@ -1573,7 +1573,7 @@ cmGeneratorTarget::GetAppBundleDirectory(const std::string& config,
bool cmGeneratorTarget::IsBundleOnApple() const
{
return this->IsFrameworkOnApple()
|| this->Target->IsAppBundleOnApple()
|| this->IsAppBundleOnApple()
|| this->Target->IsCFBundleOnApple();
}
......@@ -1935,7 +1935,7 @@ cmGeneratorTarget::BuildMacContentDirectory(const std::string& base,
bool contentOnly) const
{
std::string fpath = base;
if(this->Target->IsAppBundleOnApple())
if(this->IsAppBundleOnApple())
{
fpath += this->GetAppBundleDirectory(config, contentOnly);
}
......@@ -3143,7 +3143,7 @@ std::string cmGeneratorTarget::NormalGetFullPath(const std::string& config,
{
std::string fpath = this->GetDirectory(config, implib);
fpath += "/";
if(this->Target->IsAppBundleOnApple())
if(this->IsAppBundleOnApple())
{
fpath = this->BuildMacContentDirectory(fpath, config, false);
fpath += "/";
......@@ -3438,8 +3438,7 @@ void cmGeneratorTarget::GetFullNameInternal(const std::string& config,
configPostfix = this->GetProperty(configProp);
// Mac application bundles and frameworks have no postfix.
if(configPostfix &&
(this->Target->IsAppBundleOnApple()
|| this->IsFrameworkOnApple()))
(this->IsAppBundleOnApple() || this->IsFrameworkOnApple()))
{
configPostfix = 0;
}
......@@ -5955,3 +5954,11 @@ bool cmGeneratorTarget::IsFrameworkOnApple() const
this->Makefile->IsOn("APPLE") &&
this->GetPropertyAsBool("FRAMEWORK"));
}
//----------------------------------------------------------------------------
bool cmGeneratorTarget::IsAppBundleOnApple() const
{
return (this->GetType() == cmState::EXECUTABLE &&
this->Makefile->IsOn("APPLE") &&
this->GetPropertyAsBool("MACOSX_BUNDLE"));
}
......@@ -419,6 +419,9 @@ public:
Apple. */
bool IsFrameworkOnApple() const;
/** Return whether this target is an executable Bundle on Apple. */
bool IsAppBundleOnApple() const;
struct SourceFileFlags
GetTargetSourceFileFlags(const cmSourceFile* sf) const;
......
......@@ -150,7 +150,7 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(std::ostream& os,
std::string to1 = toDir + targetName;
// Handle OSX Bundles.
if(this->Target->Target->IsAppBundleOnApple())
if(this->Target->IsAppBundleOnApple())
{
// Install the whole app bundle directory.
type = cmInstallType_DIRECTORY;
......
......@@ -100,7 +100,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
// Construct the full path version of the names.
std::string outpath = this->GeneratorTarget->GetDirectory(this->ConfigName);
if(this->Target->IsAppBundleOnApple())
if(this->GeneratorTarget->IsAppBundleOnApple())
{
this->OSXBundleGenerator->CreateAppBundle(targetName, outpath);
}
......
......@@ -412,7 +412,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
gt.GetFullPath(cfgName,
/*implib=*/true));
if (target.IsAppBundleOnApple())
if (gt.IsAppBundleOnApple())
{
// Create the app bundle
std::string outpath = gt.GetDirectory(cfgName);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment