summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@qt.io>2018-03-06 14:37:19 +0100
committerTopi Reiniƶ <topi.reinio@qt.io>2018-03-06 14:09:54 +0000
commitdc10d71b180a4ac55dcf62a03f627183ce611c31 (patch)
tree4b661fba977672e9ed41923c825b89220b8836a6
parent63967389145a4f957de329091fd7dda1428b19cf (diff)
downloadqttools-dc10d71b180a4ac55dcf62a03f627183ce611c31.tar.gz
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 <martin.smith@qt.io>
-rw-r--r--src/qdoc/clangcodeparser.cpp9
1 files changed, 9 insertions, 0 deletions
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();
+ }
+ }
}
/*!