From 087efb572ace9cbb864c1aab7357916cb7b0428b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 8 Oct 2012 17:19:14 +0200 Subject: Modularize documenation build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ø --- src/tools/qdoc/doc/config/qdoc-project.qdocconf | 1 - src/tools/qdoc/main.cpp | 12 ++++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'src/tools') 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 +#include #include #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++) { -- cgit v1.2.3