From dc10d71b180a4ac55dcf62a03f627183ce611c31 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Tue, 6 Mar 2018 14:37:19 +0100 Subject: qdoc: Canonicalize include paths Resolve canonical include paths from the ones passed to QDoc from the command line and .qdocconf variable 'includepaths'. This allows adding include paths that are relative to the documentation project (.qdocconf file): includepaths = -I . which is useful for modules where we do not have a complete set of include paths provided by qmake. Change-Id: Ieaf0816e8c26857c873e4b521164c70bb1f5e5b3 Reviewed-by: Martin Smith --- src/qdoc/clangcodeparser.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/qdoc/clangcodeparser.cpp b/src/qdoc/clangcodeparser.cpp index 61a5fd639..5342bb34b 100644 --- a/src/qdoc/clangcodeparser.cpp +++ b/src/qdoc/clangcodeparser.cpp @@ -1144,6 +1144,15 @@ void ClangCodeParser::getMoreArgs() else { moreArgs_ = includePaths_; } + + // Canonicalize include paths + for (int i = 0; i < moreArgs_.size(); ++i) { + if (!moreArgs_.at(i).startsWith("-")) { + QFileInfo fi(QDir::current(), moreArgs_[i]); + if (fi.exists()) + moreArgs_[i] = fi.canonicalFilePath().toLatin1(); + } + } } /*! -- cgit v1.2.3