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.
This commit is contained in:
Duncan Barber
2021-04-04 12:21:59 +01:00
parent 7f0151dc91
commit e8ddc1e268

View File

@@ -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;