summaryrefslogtreecommitdiffstats
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
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>
-rwxr-xr-xconfigure6
-rw-r--r--mkspecs/features/default_post.prf1
-rw-r--r--mkspecs/features/qt_installs.prf8
-rw-r--r--mkspecs/features/qt_module.prf5
-rw-r--r--qtbase.pro4
-rw-r--r--src/concurrent/concurrent.pro5
-rw-r--r--src/concurrent/doc/qtconcurrent.qdocconf5
-rw-r--r--src/corelib/corelib.pro5
-rw-r--r--src/corelib/doc/qtcore.qdocconf5
-rw-r--r--src/dbus/dbus.pro4
-rw-r--r--src/dbus/doc/qtdbus.qdocconf5
-rw-r--r--src/gui/doc/qtgui.qdocconf5
-rw-r--r--src/gui/gui.pro5
-rw-r--r--src/network/doc/qtnetwork.qdocconf5
-rw-r--r--src/network/network.pro5
-rw-r--r--src/opengl/doc/qtopengl.qdocconf5
-rw-r--r--src/opengl/opengl.pro5
-rw-r--r--src/plugins/platforms/windows/qwindows.qdocconf2
-rw-r--r--src/printsupport/doc/qtprintsupport.qdocconf5
-rw-r--r--src/printsupport/printsupport.pro5
-rw-r--r--src/sql/doc/qtsql.qdocconf5
-rw-r--r--src/sql/sql.pro5
-rw-r--r--src/testlib/doc/qttest.qdocconf5
-rw-r--r--src/testlib/testlib.pro1
-rw-r--r--src/tools/qdoc/doc/config/qdoc-project.qdocconf1
-rw-r--r--src/tools/qdoc/main.cpp12
-rw-r--r--src/widgets/doc/qtwidgets.qdocconf5
-rw-r--r--src/widgets/widgets.pro1
-rw-r--r--src/xml/doc/qtxml.qdocconf5
-rw-r--r--src/xml/xml.pro4
-rw-r--r--tools/configure/configureapp.cpp7
31 files changed, 80 insertions, 66 deletions
diff --git a/configure b/configure
index 2bca459628..205cbde2d3 100755
--- a/configure
+++ b/configure
@@ -2254,9 +2254,9 @@ if [ "$OPT_SHADOW" = "yes" ]; then
mv "$outpath/mkspecs-modules-inst" "$outpath/mkspecs/modules-inst"
fi
- # symlink the doc directory
- rm -rf "$outpath/doc"
- ln -s "$relpath/doc" "$outpath/doc"
+ # Prepare doc directory
+ mkdir -p "$outpath/doc"
+ ln -s "$relpath"/doc/global "$outpath/doc"
fi
# symlink fonts to be able to run application from build directory
diff --git a/mkspecs/features/default_post.prf b/mkspecs/features/default_post.prf
index b717a8d352..2542cb2f9d 100644
--- a/mkspecs/features/default_post.prf
+++ b/mkspecs/features/default_post.prf
@@ -92,6 +92,7 @@ QMAKE_LIBDIR += $$QMAKE_LIBDIR_POST
!exists($$QMAKE_DOCS):error("Cannot find documentation specification file $$QMAKE_DOCS")
qtPrepareTool(QDOC, qdoc)
for(index, QMAKE_DOCS_INDEX):QDOC_INDEX += -indexdir $$index
+ !isEmpty(QMAKE_DOCS_OUTPUTDIR):QMAKE_DOCS_OPTIONS += -outputdir $$QMAKE_DOCS_OUTPUTDIR
!isEmpty(QMAKE_DOCS_INSTALLDIR):QMAKE_DOCS_OPTIONS += -installdir $$QMAKE_DOCS_INSTALLDIR
docs.commands += $$QDOC $$QMAKE_DOCS_OPTIONS $$QDOC_INDEX $$QMAKE_DOCS
}
diff --git a/mkspecs/features/qt_installs.prf b/mkspecs/features/qt_installs.prf
index 100ad59c66..507d3ebddc 100644
--- a/mkspecs/features/qt_installs.prf
+++ b/mkspecs/features/qt_installs.prf
@@ -47,3 +47,11 @@ qt_install_module {
warning("Project $$basename(_PRO_FILE_) is a module, but has not defined MODULE_PRI, which is required for Qt to expose the module to other projects.")
}
}
+
+qt_install_module_docs {
+ module_docs.files = $$QMAKE_DOCS_OUTPUTDIR
+ module_docs.path = $$[QT_INSTALL_DOCS]
+ module_docs.CONFIG += no_check_exist directory
+ module_docs.depends += docs
+ INSTALLS += module_docs
+}
diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf
index 7c2459b86e..ee5215dff3 100644
--- a/mkspecs/features/qt_module.prf
+++ b/mkspecs/features/qt_module.prf
@@ -121,6 +121,11 @@ CONFIG += qt warn_on depend_includepath
CONFIG += qmake_cache target_qt
CONFIG -= fix_output_dirs
+!isEmpty(QMAKE_DOCS) {
+ QMAKE_DOCS_OUTPUTDIR = $$eval(QT.$${MODULE}.docs)/qt$${MODULE}
+ CONFIG += qt_install_module_docs
+}
+
# If Qt was configured with -debug-and-release then build the module the same way
if(win32|mac):!macx-xcode {
contains(QT_CONFIG, debug_and_release):CONFIG += debug_and_release
diff --git a/qtbase.pro b/qtbase.pro
index 48038eb399..59814d707e 100644
--- a/qtbase.pro
+++ b/qtbase.pro
@@ -99,6 +99,10 @@ mkspecs.files -= $$PWD/mkspecs/modules
}
INSTALLS += mkspecs
+global_docs.files = $$PWD/doc/global
+global_docs.path = $$[QT_INSTALL_DOCS]
+INSTALLS += global_docs
+
OTHER_FILES += \
configure \
header.BSD \
diff --git a/src/concurrent/concurrent.pro b/src/concurrent/concurrent.pro
index f30f75e46e..cfa76ff130 100644
--- a/src/concurrent/concurrent.pro
+++ b/src/concurrent/concurrent.pro
@@ -7,6 +7,8 @@ CONFIG += exceptions
DEFINES += QT_NO_USING_NAMESPACE
win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x66000000
+QMAKE_DOCS = $$PWD/doc/qtconcurrent.qdocconf
+
load(qt_module)
PRECOMPILED_HEADER = ../corelib/global/qt_pch.h
@@ -37,9 +39,6 @@ HEADERS += \
# private headers
HEADERS += \
-QMAKE_DOCS = $$PWD/doc/qtconcurrent.qdocconf
-QMAKE_DOCS_INDEX = ../../doc
-
contains(QT_CONFIG, clock-gettime) {
linux-*|hpux-*|solaris-*:LIBS *= -lrt
}
diff --git a/src/concurrent/doc/qtconcurrent.qdocconf b/src/concurrent/doc/qtconcurrent.qdocconf
index 3c45df4764..47a3e2f497 100644
--- a/src/concurrent/doc/qtconcurrent.qdocconf
+++ b/src/concurrent/doc/qtconcurrent.qdocconf
@@ -1,5 +1,5 @@
-include(../../../doc/global/qt-html-templates-offline.qdocconf)
-include(../../../doc/global/qt-module-defaults.qdocconf)
+include($QT_INSTALL_DOCS/global/qt-html-templates-offline.qdocconf)
+include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
project = QtConcurrent
description = Qt Concurrent Reference Documentation
@@ -29,7 +29,6 @@ qhp.QtConcurrent.subprojects.examples.title = Qt Concurrent Examples
qhp.QtConcurrent.subprojects.examples.indexTitle = Qt Concurrent Examples
qhp.QtConcurrent.subprojects.examples.selectors = fake:example
-outputdir = ../../../doc/qtconcurrent
tagfile = ../../../doc/qtconcurrent/qtconcurrent.tags
depends += qtcore
diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro
index d65ed4aa9f..b83b2bac1e 100644
--- a/src/corelib/corelib.pro
+++ b/src/corelib/corelib.pro
@@ -14,10 +14,9 @@ irix-cc*:QMAKE_CXXFLAGS += -no_prelink -ptused
# otherwise mingw headers do not declare common functions like putenv
win32-g++*:QMAKE_CXXFLAGS_CXX11 = -std=gnu++0x
-load(qt_module)
-
QMAKE_DOCS = $$PWD/doc/qtcore.qdocconf
-QMAKE_DOCS_INDEX = ../../doc
+
+load(qt_module)
include(animation/animation.pri)
include(arch/arch.pri)
diff --git a/src/corelib/doc/qtcore.qdocconf b/src/corelib/doc/qtcore.qdocconf
index 36db213f69..a2cb2f2cfd 100644
--- a/src/corelib/doc/qtcore.qdocconf
+++ b/src/corelib/doc/qtcore.qdocconf
@@ -1,5 +1,5 @@
-include(../../../doc/global/qt-html-templates-offline.qdocconf)
-include(../../../doc/global/qt-module-defaults.qdocconf)
+include($QT_INSTALL_DOCS/global/qt-html-templates-offline.qdocconf)
+include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
project = QtCore
description = Qt Core Reference Documentation
@@ -29,7 +29,6 @@ qhp.QtCore.subprojects.examples.title = Qt Core Examples
qhp.QtCore.subprojects.examples.indexTitle = Qt Core Examples
qhp.QtCore.subprojects.examples.selectors = fake:example
-outputdir = ../../../doc/qtcore
tagfile = ../../../doc/qtcore/qtcore.tags
depends += qtwidgets
diff --git a/src/dbus/dbus.pro b/src/dbus/dbus.pro
index 6c6e9fcc83..1793871de6 100644
--- a/src/dbus/dbus.pro
+++ b/src/dbus/dbus.pro
@@ -26,10 +26,10 @@ win32 {
CONFIG(debug, debug|release):LIBS_PRIVATE += -ldbus-1d
else:LIBS_PRIVATE += -ldbus-1
}
-load(qt_module)
QMAKE_DOCS = $$PWD/doc/qtdbus.qdocconf
-QMAKE_DOCS_INDEX = ../../doc
+
+load(qt_module)
PUB_HEADERS = qdbusargument.h \
qdbusconnectioninterface.h \
diff --git a/src/dbus/doc/qtdbus.qdocconf b/src/dbus/doc/qtdbus.qdocconf
index 7e869df1a7..f60b8e649e 100644
--- a/src/dbus/doc/qtdbus.qdocconf
+++ b/src/dbus/doc/qtdbus.qdocconf
@@ -1,5 +1,5 @@
-include(../../../doc/global/qt-html-templates-offline.qdocconf)
-include(../../../doc/global/qt-module-defaults.qdocconf)
+include($QT_INSTALL_DOCS/global/qt-html-templates-offline.qdocconf)
+include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
project = QtDBus
description = Qt DBus Reference Documentation
@@ -29,7 +29,6 @@ qhp.QtDBus.subprojects.examples.title = Qt DBus Examples
qhp.QtDBus.subprojects.examples.indexTitle = Qt DBus Examples
qhp.QtDBus.subprojects.examples.selectors = fake:example
-outputdir = ../../../doc/qtdbus
tagfile = ../../../doc/qtdbus/qtdbus.tags
depends += qtcore
diff --git a/src/gui/doc/qtgui.qdocconf b/src/gui/doc/qtgui.qdocconf
index 73104e2bbd..958f592cc6 100644
--- a/src/gui/doc/qtgui.qdocconf
+++ b/src/gui/doc/qtgui.qdocconf
@@ -1,5 +1,5 @@
-include(../../../doc/global/qt-html-templates-offline.qdocconf)
-include(../../../doc/global/qt-module-defaults.qdocconf)
+include($QT_INSTALL_DOCS/global/qt-html-templates-offline.qdocconf)
+include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
project = QtGui
description = Qt GUI Reference Documentation
@@ -29,7 +29,6 @@ qhp.QtGui.subprojects.examples.title = Qt GUI Examples
qhp.QtGui.subprojects.examples.indexTitle = Qt GUI Examples
qhp.QtGui.subprojects.examples.selectors = fake:example
-outputdir = ../../../doc/qtgui
tagfile = ../../../doc/qtgui/qtgui.tags
depends += qtcore
diff --git a/src/gui/gui.pro b/src/gui/gui.pro
index d9d2aaec2d..8b7bb13a26 100644
--- a/src/gui/gui.pro
+++ b/src/gui/gui.pro
@@ -6,6 +6,8 @@ MODULE_CONFIG = opengl
DEFINES += QT_NO_USING_NAMESPACE
+QMAKE_DOCS = $$PWD/doc/qtgui.qdocconf
+
load(qt_module)
# Code coverage with TestCocoon
@@ -22,9 +24,6 @@ mac {
CONFIG += simd
-QMAKE_DOCS = $$PWD/doc/qtgui.qdocconf
-QMAKE_DOCS_INDEX = ../../doc
-
include(accessible/accessible.pri)
include(kernel/kernel.pri)
include(image/image.pri)
diff --git a/src/network/doc/qtnetwork.qdocconf b/src/network/doc/qtnetwork.qdocconf
index cd09a8a0df..24298c1efd 100644
--- a/src/network/doc/qtnetwork.qdocconf
+++ b/src/network/doc/qtnetwork.qdocconf
@@ -1,5 +1,5 @@
-include(../../../doc/global/qt-html-templates-offline.qdocconf)
-include(../../../doc/global/qt-module-defaults.qdocconf)
+include($QT_INSTALL_DOCS/global/qt-html-templates-offline.qdocconf)
+include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
project = QtNetwork
description = Qt Network Reference Documentation
@@ -29,7 +29,6 @@ qhp.QtNetwork.subprojects.examples.title = Qt Network Examples
qhp.QtNetwork.subprojects.examples.indexTitle = Qt Network Examples
qhp.QtNetwork.subprojects.examples.selectors = fake:example
-outputdir = ../../../doc/qtnetwork
tagfile = ../../../doc/qtnetwork/qtnetwork.tags
depends += qtcore
diff --git a/src/network/network.pro b/src/network/network.pro
index 60fb56bdc1..09791d7f6d 100644
--- a/src/network/network.pro
+++ b/src/network/network.pro
@@ -13,10 +13,9 @@ DEFINES += QT_NO_USING_NAMESPACE
#DEFINES += QUDPSOCKET_DEBUG QUDPSERVER_DEBUG
win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x64000000
-load(qt_module)
-
QMAKE_DOCS = $$PWD/doc/qtnetwork.qdocconf
-QMAKE_DOCS_INDEX = ../../doc
+
+load(qt_module)
include(access/access.pri)
include(bearer/bearer.pri)
diff --git a/src/opengl/doc/qtopengl.qdocconf b/src/opengl/doc/qtopengl.qdocconf
index 9ec43d7fd1..eef1f0f5ba 100644
--- a/src/opengl/doc/qtopengl.qdocconf
+++ b/src/opengl/doc/qtopengl.qdocconf
@@ -1,5 +1,5 @@
-include(../../../doc/global/qt-html-templates-offline.qdocconf)
-include(../../../doc/global/qt-module-defaults.qdocconf)
+include($QT_INSTALL_DOCS/global/qt-html-templates-offline.qdocconf)
+include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
project = QtOpenGL
description = Qt OpenGL Reference Documentation
@@ -29,7 +29,6 @@ qhp.QtOpenGL.subprojects.examples.title = Qt OpenGL Examples
qhp.QtOpenGL.subprojects.examples.indexTitle = Qt OpenGL Examples
qhp.QtOpenGL.subprojects.examples.selectors = fake:example
-outputdir = ../../../doc/qtopengl
tagfile = ../../../doc/qtopengl/qtopengl.tags
depends += qtcore qtgui qtwidgets
diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro
index 2adb2e09ce..dfc342c5dd 100644
--- a/src/opengl/opengl.pro
+++ b/src/opengl/opengl.pro
@@ -8,6 +8,8 @@ win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x63000000
solaris-cc*:QMAKE_CXXFLAGS_RELEASE -= -O2
irix-cc*:QMAKE_CXXFLAGS += -no_prelink -ptused
+QMAKE_DOCS = $$PWD/doc/qtopengl.qdocconf
+
load(qt_module)
contains(QT_CONFIG, opengl):CONFIG += opengl
@@ -15,9 +17,6 @@ contains(QT_CONFIG, opengles1):CONFIG += opengles1
contains(QT_CONFIG, opengles2):CONFIG += opengles2
contains(QT_CONFIG, egl):CONFIG += egl
-QMAKE_DOCS = $$PWD/doc/qtopengl.qdocconf
-QMAKE_DOCS_INDEX = ../../doc
-
HEADERS += qgl.h \
qgl_p.h \
qglcolormap.h \
diff --git a/src/plugins/platforms/windows/qwindows.qdocconf b/src/plugins/platforms/windows/qwindows.qdocconf
index c5a1ee904a..1684773b87 100644
--- a/src/plugins/platforms/windows/qwindows.qdocconf
+++ b/src/plugins/platforms/windows/qwindows.qdocconf
@@ -12,8 +12,6 @@ showinternal = true
headers.fileextensions = "*.h"
sources.fileextensions = "*.cpp *.qdoc"
-outputdir = doc
-
qhp.projects = QtLighthouseWindows
qhp.QtLighthouseWindowsDev.file = qtlighthousewindows-dev.qhp
qhp.QtLighthouseWindowsDev.namespace = com.nokia.qt.developer.lighthouse
diff --git a/src/printsupport/doc/qtprintsupport.qdocconf b/src/printsupport/doc/qtprintsupport.qdocconf
index bb5536cdfc..45d8225549 100644
--- a/src/printsupport/doc/qtprintsupport.qdocconf
+++ b/src/printsupport/doc/qtprintsupport.qdocconf
@@ -1,5 +1,5 @@
-include(../../../doc/global/qt-html-templates-offline.qdocconf)
-include(../../../doc/global/qt-module-defaults.qdocconf)
+include($QT_INSTALL_DOCS/global/qt-html-templates-offline.qdocconf)
+include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
project = QtPrintSupport
description = Qt Print Support Reference Documentation
@@ -29,7 +29,6 @@ qhp.QtPrintSupport.subprojects.examples.title = Qt Print Support Examples
qhp.QtPrintSupport.subprojects.examples.indexTitle = Qt Print Support Examples
qhp.QtPrintSupport.subprojects.examples.selectors = fake:example
-outputdir = ../../../doc/qtprintsupport
tagfile = ../../../doc/qtprintsupport/qtprintsupport.tags
depends += qtcore qtgui qtwidgets
diff --git a/src/printsupport/printsupport.pro b/src/printsupport/printsupport.pro
index bbcbb026b4..bc8b3936ce 100644
--- a/src/printsupport/printsupport.pro
+++ b/src/printsupport/printsupport.pro
@@ -5,10 +5,9 @@ QT = core-private gui-private widgets-private
DEFINES += QT_NO_USING_NAMESPACE
-load(qt_module)
-
QMAKE_DOCS = $$PWD/doc/qtprintsupport.qdocconf
-QMAKE_DOCS_INDEX = ../../doc
+
+load(qt_module)
QMAKE_LIBS += $$QMAKE_LIBS_PRINTSUPPORT
diff --git a/src/sql/doc/qtsql.qdocconf b/src/sql/doc/qtsql.qdocconf
index dabe21a44b..185f5064fa 100644
--- a/src/sql/doc/qtsql.qdocconf
+++ b/src/sql/doc/qtsql.qdocconf
@@ -1,5 +1,5 @@
-include(../../../doc/global/qt-html-templates-offline.qdocconf)
-include(../../../doc/global/qt-module-defaults.qdocconf)
+include($QT_INSTALL_DOCS/global/qt-html-templates-offline.qdocconf)
+include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
project = QtSql
description = Qt SQL Reference Documentation
@@ -29,7 +29,6 @@ qhp.QtSql.subprojects.examples.title = Qt SQL Examples
qhp.QtSql.subprojects.examples.indexTitle = Qt SQL Examples
qhp.QtSql.subprojects.examples.selectors = fake:example
-outputdir = ../../../doc/qtsql
tagfile = ../../../doc/qtsql/qtsql.tags
depends += qtcore
diff --git a/src/sql/sql.pro b/src/sql/sql.pro
index abb5767d04..42d3364192 100644
--- a/src/sql/sql.pro
+++ b/src/sql/sql.pro
@@ -6,15 +6,14 @@ QT = core-private
DEFINES += QT_NO_USING_NAMESPACE
win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x62000000
+QMAKE_DOCS = $$PWD/doc/qtsql.qdocconf
+
load(qt_module)
DEFINES += QT_NO_CAST_FROM_ASCII
PRECOMPILED_HEADER = ../corelib/global/qt_pch.h
SQL_P = sql
-QMAKE_DOCS = $$PWD/doc/qtsql.qdocconf
-QMAKE_DOCS_INDEX = ../../doc
-
include(kernel/kernel.pri)
include(drivers/drivers.pri)
include(models/models.pri)
diff --git a/src/testlib/doc/qttest.qdocconf b/src/testlib/doc/qttest.qdocconf
index e965c96313..fd9d6a83d5 100644
--- a/src/testlib/doc/qttest.qdocconf
+++ b/src/testlib/doc/qttest.qdocconf
@@ -1,5 +1,5 @@
-include(../../../doc/global/qt-html-templates-offline.qdocconf)
-include(../../../doc/global/qt-module-defaults.qdocconf)
+include($QT_INSTALL_DOCS/global/qt-html-templates-offline.qdocconf)
+include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
project = QtTest
description = Qt Test Reference Documentation
@@ -29,7 +29,6 @@ qhp.QtTest.subprojects.examples.title = Qt Test Examples
qhp.QtTest.subprojects.examples.indexTitle = Qt Test Examples
qhp.QtTest.subprojects.examples.selectors = fake:example
-outputdir = ../../../doc/qttest
tagfile = ../../../doc/qttest/qttest.tags
depends += qtcore
diff --git a/src/testlib/testlib.pro b/src/testlib/testlib.pro
index 4dc4c25cbf..c14f6e0687 100644
--- a/src/testlib/testlib.pro
+++ b/src/testlib/testlib.pro
@@ -12,7 +12,6 @@ unix:!embedded:QMAKE_PKGCONFIG_DESCRIPTION = Qt \
Library
QMAKE_DOCS = $$PWD/doc/qttest.qdocconf
-QMAKE_DOCS_INDEX = ../../doc
HEADERS = qbenchmark.h \
qbenchmark_p.h \
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++) {
diff --git a/src/widgets/doc/qtwidgets.qdocconf b/src/widgets/doc/qtwidgets.qdocconf
index 6a7815d9a2..5487d1ed08 100644
--- a/src/widgets/doc/qtwidgets.qdocconf
+++ b/src/widgets/doc/qtwidgets.qdocconf
@@ -1,5 +1,5 @@
-include(../../../doc/global/qt-html-templates-offline.qdocconf)
-include(../../../doc/global/qt-module-defaults.qdocconf)
+include($QT_INSTALL_DOCS/global/qt-html-templates-offline.qdocconf)
+include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
project = QtWidgets
description = Qt Widgets Reference Documentation
@@ -29,7 +29,6 @@ qhp.QtWidgets.subprojects.examples.title = Qt Widgets Examples
qhp.QtWidgets.subprojects.examples.indexTitle = Qt Widgets Examples
qhp.QtWidgets.subprojects.examples.selectors = fake:example
-outputdir = ../../../doc/qtwidgets
tagfile = ../../../doc/qtwidgets/qtwidgets.tags
depends += qtcore qtgui
diff --git a/src/widgets/widgets.pro b/src/widgets/widgets.pro
index bff86c18dd..f294934269 100644
--- a/src/widgets/widgets.pro
+++ b/src/widgets/widgets.pro
@@ -9,7 +9,6 @@ win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x65000000
irix-cc*:QMAKE_CXXFLAGS += -no_prelink -ptused
QMAKE_DOCS = $$PWD/doc/qtwidgets.qdocconf
-QMAKE_DOCS_INDEX = ../../doc
load(qt_module)
diff --git a/src/xml/doc/qtxml.qdocconf b/src/xml/doc/qtxml.qdocconf
index 8ad6c8b780..1759112950 100644
--- a/src/xml/doc/qtxml.qdocconf
+++ b/src/xml/doc/qtxml.qdocconf
@@ -1,5 +1,5 @@
-include(../../../doc/global/qt-html-templates-offline.qdocconf)
-include(../../../doc/global/qt-module-defaults.qdocconf)
+include($QT_INSTALL_DOCS/global/qt-html-templates-offline.qdocconf)
+include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
project = QtXml
description = Qt XML Reference Documentation
@@ -29,7 +29,6 @@ qhp.QtXml.subprojects.examples.title = Qt XML Examples
qhp.QtXml.subprojects.examples.indexTitle = Qt XML Examples
qhp.QtXml.subprojects.examples.selectors = fake:example
-outputdir = ../../../doc/qtxml
tagfile = ../../../doc/qtxml/qtxml.tags
depends += qtcore
diff --git a/src/xml/xml.pro b/src/xml/xml.pro
index e6d5761227..80fe3a9ba2 100644
--- a/src/xml/xml.pro
+++ b/src/xml/xml.pro
@@ -6,11 +6,11 @@ QT = core-private
DEFINES += QT_NO_USING_NAMESPACE
win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x61000000
+QMAKE_DOCS = $$PWD/doc/qtxml.qdocconf
+
load(qt_module)
HEADERS += qtxmlglobal.h
-QMAKE_DOCS = $$PWD/doc/qtxml.qdocconf
-QMAKE_DOCS_INDEX = ../../doc
PRECOMPILED_HEADER = ../corelib/global/qt_pch.h
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index f24782f2a7..b7442ebc4e 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -176,6 +176,13 @@ Configure::Configure(int& argc, char** argv)
dictionary["DONE"] = "error";
return;
}
+
+ buildDir.mkpath("doc");
+ if (!Environment::cpdir(sourcePath + "/doc/global", buildPath + "/doc/global")) {
+ cout << "Couldn't copy global documentation!" << sourcePath << " " << buildPath << endl;
+ dictionary["DONE"] = "error";
+ return;
+ }
}
defaultBuildParts << QStringLiteral("libs") << QStringLiteral("tools") << QStringLiteral("examples");