Commit 33fa4b40 authored by Eike Ziller's avatar Eike Ziller

Create a reusable docs.pri for generating documentation

Since we cannot directly use qt_docs.prf since it contains
various Qt specific details, adapt it for use in Qt Creator.
This can then be used e.g. by plugins that are not part of the
Qt Creator repository.

Change-Id: I87511cad74cbcae5cb58087e9a9386130d635aa9
Reviewed-by: Topi Reiniö's avatarTopi Reiniö <topi.reinio@qt.io>
Reviewed-by: Oswald Buddenhagen's avatarOswald Buddenhagen <oswald.buddenhagen@qt.io>
parent 0ed42f1c
...@@ -38,27 +38,26 @@ sourcedirs = . \ ...@@ -38,27 +38,26 @@ sourcedirs = . \
headers.fileextensions = "*.h" headers.fileextensions = "*.h"
sources.fileextensions = "*.cpp *.qdoc" sources.fileextensions = "*.cpp *.qdoc"
imagedirs = $SRCDIR/api/images $SRCDIR/images $SRCDIR/templates/images imagedirs = ../api/images ../images ../templates/images
outputdir = $OUTDIR exampledirs = ../api/examples
exampledirs = $SRCDIR/api/examples
indexes += $QDOC_INDEX_DIR/qtwidgets/qtwidgets.index \ depends += qtwidgets \
$QDOC_INDEX_DIR/qtcore/qtcore.index \ qtcore \
$QDOC_INDEX_DIR/qtqml/qtqml.index \ qtqml \
$QDOC_INDEX_DIR/qtquick/qtquick.index \ qtquick \
$QDOC_INDEX_DIR/qmake/qmake.index \ qmake \
$QDOC_INDEX_DIR/qtdesigner/qtdesigner.index \ qtdesigner \
$QDOC_INDEX_DIR/qtdoc/qtdoc.index \ qtdoc \
$QDOC_INDEX_DIR/qtgui/qtgui.index \ qtgui \
$QDOC_INDEX_DIR/qthelp/qthelp.index \ qthelp \
$QDOC_INDEX_DIR/qtquickcontrols/qtquickcontrols.index \ qtquickcontrols \
$QDOC_INDEX_DIR/qtquicklayouts/qtquicklayouts.index \ qtquicklayouts \
$QDOC_INDEX_DIR/qtlinguist/qtlinguist.index \ qtlinguist \
$QDOC_INDEX_DIR/qtscript/qtscript.index \ qtscript \
$QDOC_INDEX_DIR/qtsensors/qtsensors.index \ qtsensors \
$QDOC_INDEX_DIR/qtuitools/qtuitools.index \ qtuitools \
$QDOC_INDEX_DIR/qtwebkit/qtwebkit.index \ qtwebkit \
$QDOC_INDEX_DIR/qtxml/qtxml.index qtxml
include(macros.qdocconf) include(macros.qdocconf)
include(qt-cpp-ignore.qdocconf) include(qt-cpp-ignore.qdocconf)
......
...@@ -3,51 +3,49 @@ description = "Qt Creator Manual" ...@@ -3,51 +3,49 @@ description = "Qt Creator Manual"
url = http://doc.qt.io/qtcreator url = http://doc.qt.io/qtcreator
headerdirs = headerdirs =
sourcedirs = $SRCDIR/src sourcedirs = ../src
imagedirs = $SRCDIR/images \ imagedirs = ../images \
$SRCDIR/templates/images \ ../templates/images \
$SRCDIR/../src/libs/qmleditorwidgets/images \ ../../src/libs/qmleditorwidgets/images \
$SRCDIR/../src/libs/utils/images \ ../../src/libs/utils/images \
$SRCDIR/../src/plugins/android/images \ ../../src/plugins/android/images \
$SRCDIR/../src/plugins/autotest/images \ ../../src/plugins/autotest/images \
$SRCDIR/../src/plugins/classview/images \ ../../src/plugins/classview/images \
$SRCDIR/../src/plugins/coreplugin/images \ ../../src/plugins/coreplugin/images \
$SRCDIR/../src/plugins/debugger/images \ ../../src/plugins/debugger/images \
$SRCDIR/../src/plugins/diffeditor/images \ ../../src/plugins/diffeditor/images \
$SRCDIR/../src/plugins/help/images \ ../../src/plugins/help/images \
$SRCDIR/../src/plugins/projectexplorer/images \ ../../src/plugins/projectexplorer/images \
$SRCDIR/../src/plugins/qmldesigner/components/formeditor \ ../../src/plugins/qmldesigner/components/formeditor \
$SRCDIR/../src/plugins/qmldesigner/components/navigator \ ../../src/plugins/qmldesigner/components/navigator \
$SRCDIR/../src/plugins/scxmleditor/common/images \ ../../src/plugins/scxmleditor/common/images \
$SRCDIR/../src/plugins/texteditor/images ../../src/plugins/texteditor/images
outputdir = $OUTDIR exampledirs = ../examples
exampledirs = $SRCDIR/examples
examples.fileextensions += *.qml *.svg examples.fileextensions += *.qml *.svg
HTML.extraimages = images/commercial.png HTML.extraimages = images/commercial.png
qhp.QtCreator.extraFiles = images/commercial.png qhp.QtCreator.extraFiles = images/commercial.png
depends += qtwidgets \
indexes += $QDOC_INDEX_DIR/qtwidgets/qtwidgets.index \ qtcore \
$QDOC_INDEX_DIR/qtcore/qtcore.index \ qtqml \
$QDOC_INDEX_DIR/qtqml/qtqml.index \ qtquick \
$QDOC_INDEX_DIR/qtquick/qtquick.index \ qmake \
$QDOC_INDEX_DIR/qmake/qmake.index \ qtdesigner \
$QDOC_INDEX_DIR/qtdesigner/qtdesigner.index \ qtdoc \
$QDOC_INDEX_DIR/qtdoc/qtdoc.index \ qtgui \
$QDOC_INDEX_DIR/qtgui/qtgui.index \ qthelp \
$QDOC_INDEX_DIR/qthelp/qthelp.index \ qtquickcontrols \
$QDOC_INDEX_DIR/qtquickcontrols/qtquickcontrols.index \ qtquickcontrols2 \
$QDOC_INDEX_DIR/qtquickcontrols2/qtquickcontrols2.index \ qtquickextras \
$QDOC_INDEX_DIR/qtquickextras/qtquickextras.index \ qtlinguist \
$QDOC_INDEX_DIR/qtlinguist/qtlinguist.index \ qtscript \
$QDOC_INDEX_DIR/qtscript/qtscript.index \ qtscxml \
$QDOC_INDEX_DIR/qtscxml/qtscxml.index \ qtsensors \
$QDOC_INDEX_DIR/qtsensors/qtsensors.index \ qttestlib \
$QDOC_INDEX_DIR/qttestlib/qttestlib.index \ qtuitools \
$QDOC_INDEX_DIR/qtuitools/qtuitools.index \ qtxml
$QDOC_INDEX_DIR/qtxml/qtxml.index
include(macros.qdocconf) include(macros.qdocconf)
include(qt-cpp-ignore.qdocconf) include(qt-cpp-ignore.qdocconf)
......
HELPGENERATOR = $$shell_path($$[QT_INSTALL_BINS]/qhelpgenerator) -platform minimal build_online_docs: \
QDOC_BIN = $$shell_path($$[QT_INSTALL_BINS]/qdoc) QTC_DOCS = $$PWD/qtcreator-online.qdocconf $$PWD/api/qtcreator-dev-online.qdocconf
QDOC_GLOBAL = QT_INSTALL_DOCS=$$[QT_INSTALL_DOCS/src] QDOC_INDEX_DIR=$$[QT_INSTALL_DOCS] else: \
COMPAT = QTC_DOCS = $$PWD/qtcreator.qdocconf $$PWD/api/qtcreator-dev.qdocconf
VERSION_TAG = $$replace(QTCREATOR_VERSION, "[-.]", ) include(../docs.pri)
# unset the installdir for qdoc, so we force generation
# of URLs for the links to the Qt documentation
QMAKE_DOCS_INSTALLDIR =
defineReplace(cmdEnv) {
!equals(QMAKE_DIR_SEP, /): 1 ~= s,^(.*)$,(set \\1) &&,g
return("$$1")
}
defineReplace(qdoc) {
return("$$cmdEnv(SRCDIR=$$PWD OUTDIR=$$1 QTC_VERSION=$$QTCREATOR_VERSION QTC_VERSION_TAG=$$VERSION_TAG $$QDOC_GLOBAL) $$QDOC_BIN")
}
QHP_FILE = $$OUT_PWD/doc/html/qtcreator.qhp
QCH_FILE = $$IDE_DOC_PATH/qtcreator.qch
HELP_DEP_FILES = $$PWD/src/qtcreator.qdoc \
$$PWD/config/macros.qdocconf \
$$PWD/config/qt-cpp-ignore.qdocconf \
$$PWD/config/qt-defines.qdocconf
html_docs.commands = $$qdoc($$OUT_PWD/doc/html) $$PWD/qtcreator.qdocconf
html_docs.depends += $$HELP_DEP_FILES
html_docs.files = $$QHP_FILE
html_docs_online.commands = $$qdoc($$OUT_PWD/doc/html) $$PWD/qtcreator-online.qdocconf
html_docs_online.depends += $$HELP_DEP_FILES
qch_docs.commands = $$HELPGENERATOR -o \"$$QCH_FILE\" $$QHP_FILE
qch_docs.depends += html_docs
DEV_QHP_FILE = $$OUT_PWD/doc/html-dev/qtcreator-dev.qhp
DEV_QCH_FILE = $$IDE_DOC_PATH/qtcreator-dev.qch
DEV_HELP_DEP_FILES = \
$$PWD/api/qtcreator-api.qdoc \
$$PWD/api/coding-style.qdoc \
$$PWD/api/external-tool-spec.qdoc \
$$PWD/api/qtcreator-dev.qdoc \
$$PWD/api/qtcreator-dev-wizards.qdoc \
$$PWD/api/creating-plugins.qdoc \
$$PWD/api/getting-and-building.qdoc \
$$PWD/api/first-plugin.qdoc \
$$PWD/api/plugin-metadata.qdoc \
$$PWD/api/plugin-lifecycle.qdoc \
$$PWD/api/pluginmanager.qdoc \
$$PWD/api/qtcreator-documentation.qdoc \
$$PWD/api/qtcreator-ui-text.qdoc \
$$PWD/api/qtcreator-dev.qdocconf
dev_html_docs.commands = $$qdoc($$OUT_PWD/doc/html-dev) $$PWD/api/qtcreator-dev.qdocconf
dev_html_docs.depends += $$DEV_HELP_DEP_FILES
dev_html_docs_online.commands = $$qdoc($$OUT_PWD/doc/html-dev) $$PWD/api/qtcreator-dev-online.qdocconf
dev_html_docs_online.depends += $$DEV_HELP_DEP_FILES
dev_qch_docs.commands = $$HELPGENERATOR -o \"$$DEV_QCH_FILE\" $$DEV_QHP_FILE
dev_qch_docs.depends += dev_html_docs
inst_qch_docs.files = $$QCH_FILE
inst_qch_docs.path = $$INSTALL_DOC_PATH
inst_qch_docs.CONFIG += no_check_exist no_default_install
INSTALLS += inst_qch_docs
inst_dev_qch_docs.files = $$DEV_QCH_FILE
inst_dev_qch_docs.path = $$INSTALL_DOC_PATH
inst_dev_qch_docs.CONFIG += no_check_exist no_default_install
INSTALLS += inst_dev_qch_docs
install_docs.depends = install_inst_qch_docs install_inst_dev_qch_docs
QMAKE_EXTRA_TARGETS += install_docs
docs_online.depends = html_docs_online dev_html_docs_online
docs.depends = qch_docs dev_qch_docs
QMAKE_EXTRA_TARGETS += html_docs dev_html_docs html_docs_online dev_html_docs_online qch_docs dev_qch_docs docs docs_online
DISTFILES = $$HELP_DEP_FILES $$DEV_HELP_DEP_FILES
fixnavi.commands = \ fixnavi.commands = \
cd $$shell_path($$PWD) && \ cd $$shell_path($$PWD) && \
......
# adapted from qt_docs.prf
isEmpty(VERSION): error("Include qtcreator.pri before including docs.pri!")
qtcver.name = QTC_VERSION
qtcver.value = $$VERSION
qtcvertag.name = QTC_VERSION_TAG
qtcvertag.value = $$replace(qtcver.value, \.,)
qtdocs.name = QT_INSTALL_DOCS
qtdocs.value = $$[QT_INSTALL_DOCS/src]
qdocindex.name = QDOC_INDEX_DIR
qdocindex.value = $$[QT_INSTALL_DOCS]
qtcdocsdir.name = QTC_DOCS_DIR
qtcdocsdir.value = $$IDE_SOURCE_TREE/doc
QT_TOOL_ENV = qtcver qtcvertag qtdocs qdocindex qtcdocsdir
qtPrepareTool(QDOC, qdoc)
QT_TOOL_ENV =
!build_online_docs: qtPrepareTool(QHELPGENERATOR, qhelpgenerator)
QTC_DOCS_BASE_OUTDIR = $$OUT_PWD/doc
DOC_INDEXES = -indexdir $$shell_quote($$[QT_INSTALL_DOCS]) \
-indexdir $$shell_quote($$IDE_BUILD_TREE/doc)
for (qtc_doc, QTC_DOCS) {
!exists($$qtc_doc): error("Cannot find documentation specification file $$qtc_doc")
QTC_DOCS_TARGET = $$replace(qtc_doc, ^(.*/)?(.*)\\.qdocconf$, \\2)
QTC_DOCS_TARGETDIR = $$QTC_DOCS_TARGET
QTC_DOCS_OUTPUTDIR = $$QTC_DOCS_BASE_OUTDIR/$$QTC_DOCS_TARGETDIR
!isEmpty(html_docs.commands): html_docs.commands += &&
html_docs.commands += $$QDOC -outputdir $$shell_quote($$QTC_DOCS_OUTPUTDIR) $$qtc_doc $$DOC_INDEXES
!build_online_docs {
!isEmpty(qch_docs.commands): qch_docs.commands += &&
qch_docs.commands += $$QHELPGENERATOR $$shell_quote($$QTC_DOCS_OUTPUTDIR/$${QTC_DOCS_TARGET}.qhp) -o $$shell_quote($$IDE_DOC_PATH/$${QTC_DOCS_TARGET}.qch)
inst_qch_docs.files += $$IDE_DOC_PATH/$${QTC_DOCS_TARGET}.qch
}
}
!build_online_docs {
qch_docs.depends = html_docs
inst_qch_docs.path = $$INSTALL_DOC_PATH
inst_qch_docs.CONFIG += no_check_exist no_default_install no_build
install_docs.depends = install_inst_qch_docs
docs.depends = qch_docs
INSTALLS += inst_qch_docs
QMAKE_EXTRA_TARGETS += qch_docs install_docs
} else {
docs.depends = html_docs
}
QMAKE_EXTRA_TARGETS += html_docs docs
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment