summaryrefslogtreecommitdiffstats
path: root/Source/cmQtAutoMocUic.cxx
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@web.de>2019-10-30 10:09:28 (GMT)
committerBrad King <brad.king@kitware.com>2019-10-30 13:34:06 (GMT)
commit90d643c31221a1b1e3841a0a1f7a2b2f8d16d2d8 (patch)
tree9fc16ac2ae157a16929885b8ea6ef9562133746a /Source/cmQtAutoMocUic.cxx
parent92780281c2e8a46223b262b152caa9c8329373b1 (diff)
downloadCMake-90d643c31221a1b1e3841a0a1f7a2b2f8d16d2d8.zip
CMake-90d643c31221a1b1e3841a0a1f7a2b2f8d16d2d8.tar.gz
CMake-90d643c31221a1b1e3841a0a1f7a2b2f8d16d2d8.tar.bz2
Autogen: Fix ambiguity in header file detection on Windows
On Windows, `CollapseFullPath` called with a path that ends with a dot might return a file with the same base name but any extension. To make sure we get only the file with the requested header extension, pass the complete file name to `CollapseFullPath`. Fixes: #19892
Diffstat (limited to 'Source/cmQtAutoMocUic.cxx')
-rw-r--r--Source/cmQtAutoMocUic.cxx8
1 files changed, 3 insertions, 5 deletions
diff --git a/Source/cmQtAutoMocUic.cxx b/Source/cmQtAutoMocUic.cxx
index 127421a..f8b8981 100644
--- a/Source/cmQtAutoMocUic.cxx
+++ b/Source/cmQtAutoMocUic.cxx
@@ -1342,10 +1342,9 @@ bool cmQtAutoMocUicT::JobEvalCacheMocT::FindIncludedHeader(
auto findHeader = [this,
&headerHandle](std::string const& basePath) -> bool {
bool found = false;
- std::string const baseCollapsed =
- this->Gen()->CollapseFullPathTS(cmStrCat(basePath, '.'));
for (std::string const& ext : this->BaseConst().HeaderExtensions) {
- std::string const testPath = cmStrCat(baseCollapsed, ext);
+ std::string const testPath =
+ this->Gen()->CollapseFullPathTS(cmStrCat(basePath, '.', ext));
cmFileTime fileTime;
if (!fileTime.Load(testPath)) {
// File not found
@@ -1377,8 +1376,7 @@ bool cmQtAutoMocUicT::JobEvalCacheMocT::FindIncludedHeader(
}
}
if (!found) {
- this->SearchLocations.emplace_back(
- cmQtAutoGen::ParentDir(baseCollapsed));
+ this->SearchLocations.emplace_back(cmQtAutoGen::ParentDir(basePath));
}
return found;
};