export: Fix IMPORTED_LOCATION of iOS flat app bundles

iOS/tvOS app bundles are flat and do not include the `Contents/MacOS/`
layers, so they should not be in the `IMPORTED_LOCATION`.  Use the same
logic that commit 34f5ef564a (iOS: Fix App Bundle layout, 2015-12-10,
v3.5.0-rc1~129^2~1) added for the installation layout.

Fixes: #23963
This commit is contained in:
Harry Mallon
2022-09-14 19:21:42 +01:00
committed by Brad King
parent c3e68020d6
commit d26c520f4b

View File

@@ -436,7 +436,10 @@ void cmExportInstallFileGenerator::SetImportLocationProperty(
// Append the installed file name.
if (target->IsAppBundleOnApple()) {
value += cmInstallTargetGenerator::GetInstallFilename(target, config);
value += ".app/Contents/MacOS/";
value += ".app/";
if (!target->Makefile->PlatformIsAppleEmbedded()) {
value += "Contents/MacOS/";
}
value += cmInstallTargetGenerator::GetInstallFilename(target, config);
} else {
value += cmInstallTargetGenerator::GetInstallFilename(