summaryrefslogtreecommitdiffstats
path: root/Source/cmExportInstallFileGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-06-23 14:59:50 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-06-23 15:00:02 (GMT)
commit4995017c2611d264355ed4d220bb2e5b284639cf (patch)
tree11066f24d4a8a0e42d68b04a74ff749a0aee08ce /Source/cmExportInstallFileGenerator.cxx
parent81f4ede96aaebe28e372f4a8e45f83ae9aaf58ab (diff)
parent70f36de1e54e072cc3f241f7d1fe8333aad2296e (diff)
downloadCMake-4995017c2611d264355ed4d220bb2e5b284639cf.zip
CMake-4995017c2611d264355ed4d220bb2e5b284639cf.tar.gz
CMake-4995017c2611d264355ed4d220bb2e5b284639cf.tar.bz2
Merge topic 'export-file-set-absolute-cmake-install-includedir'
70f36de1e5 File set: Allow absolute CMAKE_INSTALL_INCLUDEDIR Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !8577
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(),