summaryrefslogtreecommitdiffstats
path: root/Source/cmExportInstallFileGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmExportInstallFileGenerator.cxx')
-rw-r--r--Source/cmExportInstallFileGenerator.cxx23
1 files changed, 14 insertions, 9 deletions
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index 66cae64..264c947 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -591,10 +591,12 @@ std::string cmExportInstallFileGenerator::GetFileSetDirectories(
auto cge = ge.Parse(te->FileSetGenerators.at(fileSet)->GetDestination());
for (auto const& config : configs) {
- auto dest = cmStrCat("${_IMPORT_PREFIX}/",
- cmOutputConverter::EscapeForCMake(
- cge->Evaluate(gte->LocalGenerator, config, gte),
- cmOutputConverter::WrapQuotes::NoWrap));
+ auto unescapedDest = cge->Evaluate(gte->LocalGenerator, config, gte);
+ auto dest = cmOutputConverter::EscapeForCMake(
+ unescapedDest, cmOutputConverter::WrapQuotes::NoWrap);
+ if (!cmSystemTools::FileIsFullPath(unescapedDest)) {
+ dest = cmStrCat("${_IMPORT_PREFIX}/", dest);
+ }
auto const& type = fileSet->GetType();
// C++ modules do not support interface file sets which are dependent upon
@@ -646,11 +648,14 @@ std::string cmExportInstallFileGenerator::GetFileSetFiles(
fileSet->EvaluateFileEntry(directories, files, entry,
gte->LocalGenerator, config, gte);
}
- auto dest = cmStrCat("${_IMPORT_PREFIX}/",
- cmOutputConverter::EscapeForCMake(
- destCge->Evaluate(gte->LocalGenerator, config, gte),
- cmOutputConverter::WrapQuotes::NoWrap),
- '/');
+ auto unescapedDest = destCge->Evaluate(gte->LocalGenerator, config, gte);
+ auto dest =
+ cmStrCat(cmOutputConverter::EscapeForCMake(
+ unescapedDest, cmOutputConverter::WrapQuotes::NoWrap),
+ '/');
+ if (!cmSystemTools::FileIsFullPath(unescapedDest)) {
+ dest = cmStrCat("${_IMPORT_PREFIX}/", dest);
+ }
bool const contextSensitive = destCge->GetHadContextSensitiveCondition() ||
std::any_of(directoryEntries.begin(), directoryEntries.end(),