diff options
author | Duncan Barber <7744-dunquan@users.noreply.gitlab.kitware.com> | 2021-04-04 11:21:59 (GMT) |
---|---|---|
committer | Duncan Barber <7744-dunquan@users.noreply.gitlab.kitware.com> | 2021-04-04 11:29:59 (GMT) |
commit | e8ddc1e268d2db78a2f3edde1f6edb05d9243ada (patch) | |
tree | 58dcfa924b2ef7f3ffedb2554fba44e83fe74660 /Source | |
parent | 7f0151dc91805617cbc1d538ec9df2b34e0477d6 (diff) | |
download | CMake-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.cxx | 8 |
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; |