From e8ddc1e268d2db78a2f3edde1f6edb05d9243ada Mon Sep 17 00:00:00 2001 From: Duncan Barber <7744-dunquan@users.noreply.gitlab.kitware.com> Date: Sun, 4 Apr 2021 12:21:59 +0100 Subject: 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. --- Source/cmQtAutoGenInitializer.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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; -- cgit v0.12