BUG: Fix LOCATION property for Mac AppBundles
Previously cmTarget::GetLocation and cmTarget::GetFullPath would return for Mac AppBundles the top-level bundle directory but without the .app extension. We worked around this at the call sites. This fixes the methods and removes the work-arounds. See issue #8406.
This commit is contained in:
parent
2c81e5fb5c
commit
acb0e8fb85
|
@ -106,16 +106,10 @@ cmExportBuildFileGenerator
|
|||
std::string prop = "IMPORTED_LOCATION";
|
||||
prop += suffix;
|
||||
std::string value;
|
||||
if(target->IsFrameworkOnApple())
|
||||
if(target->IsFrameworkOnApple() || target->IsAppBundleOnApple())
|
||||
{
|
||||
value = target->GetFullPath(config, false);
|
||||
}
|
||||
else if(target->IsAppBundleOnApple())
|
||||
{
|
||||
value = target->GetFullPath(config, false);
|
||||
value += ".app/Contents/MacOS/";
|
||||
value += target->GetFullName(config, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
value = target->GetFullPath(config, false, true);
|
||||
|
|
|
@ -2607,11 +2607,6 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
|
|||
t->GetType() == cmTarget::MODULE_LIBRARY)
|
||||
{
|
||||
std::string tfull = t->GetFullPath(configName);
|
||||
if(t->IsAppBundleOnApple())
|
||||
{
|
||||
tfull += ".app/Contents/MacOS/";
|
||||
tfull += t->GetFullName(configName);
|
||||
}
|
||||
makefileStream << "\\\n\t" <<
|
||||
this->ConvertToRelativeForMake(tfull.c_str());
|
||||
}
|
||||
|
@ -2669,11 +2664,6 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
|
|||
{
|
||||
// Create a rule for this target.
|
||||
std::string tfull = t->GetFullPath(configName);
|
||||
if(t->IsAppBundleOnApple())
|
||||
{
|
||||
tfull += ".app/Contents/MacOS/";
|
||||
tfull += t->GetFullName(configName);
|
||||
}
|
||||
makefileStream << this->ConvertToRelativeForMake(tfull.c_str())
|
||||
<< ":";
|
||||
|
||||
|
|
|
@ -1932,6 +1932,11 @@ const char* cmTarget::NormalGetLocation(const char* config)
|
|||
this->Location += cfgid;
|
||||
this->Location += "/";
|
||||
}
|
||||
if(this->IsAppBundleOnApple())
|
||||
{
|
||||
this->Location += this->GetFullName(config, false);
|
||||
this->Location += ".app/Contents/MacOS/";
|
||||
}
|
||||
if(this->IsFrameworkOnApple())
|
||||
{
|
||||
this->Location += this->GetFullName(config, false);
|
||||
|
@ -2446,6 +2451,11 @@ std::string cmTarget::NormalGetFullPath(const char* config, bool implib,
|
|||
std::string fpath = this->GetDirectory(config, implib);
|
||||
fpath += "/";
|
||||
|
||||
if(this->IsAppBundleOnApple())
|
||||
{
|
||||
fpath += this->GetFullName(config, false);
|
||||
fpath += ".app/Contents/MacOS/";
|
||||
}
|
||||
if(this->IsFrameworkOnApple())
|
||||
{
|
||||
fpath += this->GetFullName(config, false);
|
||||
|
|
Loading…
Reference in New Issue