summaryrefslogtreecommitdiffstats
path: root/Source/cmExportInstallFileGenerator.cxx
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2023-09-21 18:04:54 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2023-11-15 14:10:58 (GMT)
commit256bb0cc40a9f9f20452f0c0b2480886a577e7cb (patch)
treecc07534f951465698ace7fefc0bebfc12a456029 /Source/cmExportInstallFileGenerator.cxx
parenta90968e044d04839e610da9a1adf7b6f390e144a (diff)
downloadCMake-256bb0cc40a9f9f20452f0c0b2480886a577e7cb.zip
CMake-256bb0cc40a9f9f20452f0c0b2480886a577e7cb.tar.gz
CMake-256bb0cc40a9f9f20452f0c0b2480886a577e7cb.tar.bz2
install(EXPORT): Add ability to point to .xcframework file
Issue: #25262
Diffstat (limited to 'Source/cmExportInstallFileGenerator.cxx')
-rw-r--r--Source/cmExportInstallFileGenerator.cxx23
1 files changed, 20 insertions, 3 deletions
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index b829edd..64e694c 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -375,9 +375,26 @@ void cmExportInstallFileGenerator::GenerateImportTargetsConfig(
// properties);
// Generate code in the export file.
- this->GenerateImportPropertyCode(os, config, gtgt, properties);
- this->GenerateImportedFileChecksCode(os, gtgt, properties,
- importedLocations);
+ std::string importedXcFrameworkLocation = te->XcFrameworkLocation;
+ if (!importedXcFrameworkLocation.empty()) {
+ importedXcFrameworkLocation = cmGeneratorExpression::Preprocess(
+ importedXcFrameworkLocation,
+ cmGeneratorExpression::PreprocessContext::InstallInterface, true);
+ importedXcFrameworkLocation = cmGeneratorExpression::Evaluate(
+ importedXcFrameworkLocation, te->Target->GetLocalGenerator(), config,
+ te->Target, nullptr, te->Target);
+ if (!importedXcFrameworkLocation.empty() &&
+ !cmSystemTools::FileIsFullPath(importedXcFrameworkLocation) &&
+ !cmHasLiteralPrefix(importedXcFrameworkLocation,
+ "${_IMPORT_PREFIX}/")) {
+ importedXcFrameworkLocation =
+ cmStrCat("${_IMPORT_PREFIX}/", importedXcFrameworkLocation);
+ }
+ }
+ this->GenerateImportPropertyCode(os, config, suffix, gtgt, properties,
+ importedXcFrameworkLocation);
+ this->GenerateImportedFileChecksCode(
+ os, gtgt, properties, importedLocations, importedXcFrameworkLocation);
}
}
}