cmGeneratorTarget: Copy IsAppBundleOnApple from cmTarget.

Leave the cmTarget method behind for now to implement cmInstallCommand.
This commit is contained in:
Stephen Kelly 2015-10-09 23:58:19 +02:00
parent b5f5de70c0
commit 88d10d55ac
8 changed files with 22 additions and 12 deletions

View File

@ -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);
}

View File

@ -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";

View File

@ -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/";

View File

@ -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"));
}

View File

@ -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;

View File

@ -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;

View File

@ -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);
}

View File

@ -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);