From 00e6b67e0c89ca25c5efd78f4a4b27fa53b64e77 Mon Sep 17 00:00:00 2001 From: Sebastian Holtermann Date: Thu, 6 Jun 2019 17:38:47 +0200 Subject: Autogen: Fix header detection for paths with symbolic links When Autogen searches the header for a source files in a target, the expanded real path is used and not the (possibly symbolic) original path of the source file. If the source file path contains symbolic links, then the correct `cmSourceFile` instance of the header won't be found, but a new one will be generated. This way all header source file properties get lost, which is problematic especially for the `SKIP_AUTOMOC/UIC/GEN` properties. This patch changes the header detection in Autogen to use the original source file path instead of the expanded real source file path. Fixes: #19346 --- Source/cmQtAutoGenInitializer.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index 265daf6..9985f93 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -721,9 +721,9 @@ bool cmQtAutoGenInitializer::InitScanFiles() MUFile const& muf = *pair.second; if (muf.MocIt || muf.UicIt) { // Search for the default header file and a private header - std::string const& realPath = muf.RealPath; - std::string basePath = cmQtAutoGen::SubDirPrefix(realPath); - basePath += cmSystemTools::GetFilenameWithoutLastExtension(realPath); + std::string const& srcPath = muf.SF->GetFullPath(); + std::string basePath = cmQtAutoGen::SubDirPrefix(srcPath); + basePath += cmSystemTools::GetFilenameWithoutLastExtension(srcPath); for (auto const& suffix : suffixes) { std::string const suffixedPath = basePath + suffix; for (auto const& ext : exts) { -- cgit v0.12