summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@digia.com>2012-10-08 17:19:14 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-10 23:27:03 +0200
commit087efb572ace9cbb864c1aab7357916cb7b0428b (patch)
tree4896cf5091cff4c40291d23c94b2a1cf445338f2 /src/tools
parent9adf7fb708963c7bb27dc1fd54aa879395f6cf57 (diff)
Modularize documenation build
qdocconf files can now reference $QT_INSTALL_DOCS to pick up e.g. global includes, instead of using relative paths. Qt modules will automatically get a doc target that builds and installs into the right place (including supporting shadow-builds) if they set QMAKE_DOCS before loading(qt_module). Change-Id: Ia408385199e56e3ead0afa45645a059d1a8b0d48 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/qdoc/doc/config/qdoc-project.qdocconf1
-rw-r--r--src/tools/qdoc/main.cpp12
2 files changed, 12 insertions, 1 deletions
diff --git a/src/tools/qdoc/doc/config/qdoc-project.qdocconf b/src/tools/qdoc/doc/config/qdoc-project.qdocconf
index d48e132335..10cdfa417b 100644
--- a/src/tools/qdoc/doc/config/qdoc-project.qdocconf
+++ b/src/tools/qdoc/doc/config/qdoc-project.qdocconf
@@ -26,7 +26,6 @@ exampledirs = .. \
imagedirs = ../../../doc/src/templates/images \
images
-outputdir = ../html
tagfile = ../html/qdoc.tags
qhp.projects = QDoc
diff --git a/src/tools/qdoc/main.cpp b/src/tools/qdoc/main.cpp
index 8d35692a88..03974c5d04 100644
--- a/src/tools/qdoc/main.cpp
+++ b/src/tools/qdoc/main.cpp
@@ -40,6 +40,7 @@
****************************************************************************/
#include <qglobal.h>
+#include <qlibraryinfo.h>
#include <stdlib.h>
#include "codemarker.h"
#include "codeparser.h"
@@ -172,6 +173,12 @@ static void processQdocconfFile(const QString &fileName)
config.setStringList(CONFIG_NOLINKERRORS, QStringList(noLinkErrors ? "true" : "false"));
config.setStringList(CONFIG_OBSOLETELINKS, QStringList(obsoleteLinks ? "true" : "false"));
+ QString documentationPath = QLibraryInfo::rawLocation(QLibraryInfo::DocumentationPath,
+ QLibraryInfo::EffectivePaths);
+
+ // Set a few environment variables that can be used from the qdocconf file
+ qputenv("QT_INSTALL_DOCS", documentationPath.toLatin1());
+
/*
With the default configuration values in place, load
the qdoc configuration file. Note that the configuration
@@ -256,6 +263,11 @@ static void processQdocconfFile(const QString &fileName)
dependModules += config.getStringList(CONFIG_DEPENDS);
+ // Allow modules and third-party application/libraries to link
+ // to the Qt docs without having to explicitly pass --indexdir.
+ if (!indexDirs.contains(documentationPath))
+ indexDirs.append(documentationPath);
+
if (dependModules.size() > 0) {
if (indexDirs.size() > 0) {
for (int i = 0; i < indexDirs.size(); i++) {