summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorDuncan Barber <7744-dunquan@users.noreply.gitlab.kitware.com>2021-04-04 11:21:59 (GMT)
committerDuncan Barber <7744-dunquan@users.noreply.gitlab.kitware.com>2021-04-04 11:29:59 (GMT)
commite8ddc1e268d2db78a2f3edde1f6edb05d9243ada (patch)
tree58dcfa924b2ef7f3ffedb2554fba44e83fe74660 /Source
parent7f0151dc91805617cbc1d538ec9df2b34e0477d6 (diff)
downloadCMake-e8ddc1e268d2db78a2f3edde1f6edb05d9243ada.zip
CMake-e8ddc1e268d2db78a2f3edde1f6edb05d9243ada.tar.gz
CMake-e8ddc1e268d2db78a2f3edde1f6edb05d9243ada.tar.bz2
Autogen: Fix a bug in setting the UIC source group
If the relative path to a UI file was empty then the source group for the corresponding autogen header file would not apply because of a double slash in the path.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmQtAutoGenInitializer.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index 6528687..e96ec63 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -943,8 +943,14 @@ bool cmQtAutoGenInitializer::InitScanFiles()
this->LocalGen->GetCurrentSourceDirectory(),
cmSystemTools::GetFilenamePath(fullPath));
+ // Avoid creating a path containing adjacent slashes
+ if (!uiHeaderRelativePath.empty() &&
+ uiHeaderRelativePath.back() != '/') {
+ uiHeaderRelativePath += '/';
+ }
+
auto uiHeaderFilePath = cmStrCat(
- '/', uiHeaderRelativePath, '/', "ui_"_s,
+ '/', uiHeaderRelativePath, "ui_"_s,
cmSystemTools::GetFilenameWithoutLastExtension(fullPath), ".h"_s);
ConfigString uiHeader;