forked from qt-creator/qt-creator
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ö <topi.reinio@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
@@ -38,27 +38,26 @@ sourcedirs = . \
|
||||
headers.fileextensions = "*.h"
|
||||
sources.fileextensions = "*.cpp *.qdoc"
|
||||
|
||||
imagedirs = $SRCDIR/api/images $SRCDIR/images $SRCDIR/templates/images
|
||||
outputdir = $OUTDIR
|
||||
exampledirs = $SRCDIR/api/examples
|
||||
imagedirs = ../api/images ../images ../templates/images
|
||||
exampledirs = ../api/examples
|
||||
|
||||
indexes += $QDOC_INDEX_DIR/qtwidgets/qtwidgets.index \
|
||||
$QDOC_INDEX_DIR/qtcore/qtcore.index \
|
||||
$QDOC_INDEX_DIR/qtqml/qtqml.index \
|
||||
$QDOC_INDEX_DIR/qtquick/qtquick.index \
|
||||
$QDOC_INDEX_DIR/qmake/qmake.index \
|
||||
$QDOC_INDEX_DIR/qtdesigner/qtdesigner.index \
|
||||
$QDOC_INDEX_DIR/qtdoc/qtdoc.index \
|
||||
$QDOC_INDEX_DIR/qtgui/qtgui.index \
|
||||
$QDOC_INDEX_DIR/qthelp/qthelp.index \
|
||||
$QDOC_INDEX_DIR/qtquickcontrols/qtquickcontrols.index \
|
||||
$QDOC_INDEX_DIR/qtquicklayouts/qtquicklayouts.index \
|
||||
$QDOC_INDEX_DIR/qtlinguist/qtlinguist.index \
|
||||
$QDOC_INDEX_DIR/qtscript/qtscript.index \
|
||||
$QDOC_INDEX_DIR/qtsensors/qtsensors.index \
|
||||
$QDOC_INDEX_DIR/qtuitools/qtuitools.index \
|
||||
$QDOC_INDEX_DIR/qtwebkit/qtwebkit.index \
|
||||
$QDOC_INDEX_DIR/qtxml/qtxml.index
|
||||
depends += qtwidgets \
|
||||
qtcore \
|
||||
qtqml \
|
||||
qtquick \
|
||||
qmake \
|
||||
qtdesigner \
|
||||
qtdoc \
|
||||
qtgui \
|
||||
qthelp \
|
||||
qtquickcontrols \
|
||||
qtquicklayouts \
|
||||
qtlinguist \
|
||||
qtscript \
|
||||
qtsensors \
|
||||
qtuitools \
|
||||
qtwebkit \
|
||||
qtxml
|
||||
|
||||
include(macros.qdocconf)
|
||||
include(qt-cpp-ignore.qdocconf)
|
||||
|
@@ -3,51 +3,49 @@ description = "Qt Creator Manual"
|
||||
url = http://doc.qt.io/qtcreator
|
||||
|
||||
headerdirs =
|
||||
sourcedirs = $SRCDIR/src
|
||||
imagedirs = $SRCDIR/images \
|
||||
$SRCDIR/templates/images \
|
||||
$SRCDIR/../src/libs/qmleditorwidgets/images \
|
||||
$SRCDIR/../src/libs/utils/images \
|
||||
$SRCDIR/../src/plugins/android/images \
|
||||
$SRCDIR/../src/plugins/autotest/images \
|
||||
$SRCDIR/../src/plugins/classview/images \
|
||||
$SRCDIR/../src/plugins/coreplugin/images \
|
||||
$SRCDIR/../src/plugins/debugger/images \
|
||||
$SRCDIR/../src/plugins/diffeditor/images \
|
||||
$SRCDIR/../src/plugins/help/images \
|
||||
$SRCDIR/../src/plugins/projectexplorer/images \
|
||||
$SRCDIR/../src/plugins/qmldesigner/components/formeditor \
|
||||
$SRCDIR/../src/plugins/qmldesigner/components/navigator \
|
||||
$SRCDIR/../src/plugins/scxmleditor/common/images \
|
||||
$SRCDIR/../src/plugins/texteditor/images
|
||||
sourcedirs = ../src
|
||||
imagedirs = ../images \
|
||||
../templates/images \
|
||||
../../src/libs/qmleditorwidgets/images \
|
||||
../../src/libs/utils/images \
|
||||
../../src/plugins/android/images \
|
||||
../../src/plugins/autotest/images \
|
||||
../../src/plugins/classview/images \
|
||||
../../src/plugins/coreplugin/images \
|
||||
../../src/plugins/debugger/images \
|
||||
../../src/plugins/diffeditor/images \
|
||||
../../src/plugins/help/images \
|
||||
../../src/plugins/projectexplorer/images \
|
||||
../../src/plugins/qmldesigner/components/formeditor \
|
||||
../../src/plugins/qmldesigner/components/navigator \
|
||||
../../src/plugins/scxmleditor/common/images \
|
||||
../../src/plugins/texteditor/images
|
||||
|
||||
outputdir = $OUTDIR
|
||||
exampledirs = $SRCDIR/examples
|
||||
exampledirs = ../examples
|
||||
examples.fileextensions += *.qml *.svg
|
||||
|
||||
HTML.extraimages = images/commercial.png
|
||||
qhp.QtCreator.extraFiles = images/commercial.png
|
||||
|
||||
|
||||
indexes += $QDOC_INDEX_DIR/qtwidgets/qtwidgets.index \
|
||||
$QDOC_INDEX_DIR/qtcore/qtcore.index \
|
||||
$QDOC_INDEX_DIR/qtqml/qtqml.index \
|
||||
$QDOC_INDEX_DIR/qtquick/qtquick.index \
|
||||
$QDOC_INDEX_DIR/qmake/qmake.index \
|
||||
$QDOC_INDEX_DIR/qtdesigner/qtdesigner.index \
|
||||
$QDOC_INDEX_DIR/qtdoc/qtdoc.index \
|
||||
$QDOC_INDEX_DIR/qtgui/qtgui.index \
|
||||
$QDOC_INDEX_DIR/qthelp/qthelp.index \
|
||||
$QDOC_INDEX_DIR/qtquickcontrols/qtquickcontrols.index \
|
||||
$QDOC_INDEX_DIR/qtquickcontrols2/qtquickcontrols2.index \
|
||||
$QDOC_INDEX_DIR/qtquickextras/qtquickextras.index \
|
||||
$QDOC_INDEX_DIR/qtlinguist/qtlinguist.index \
|
||||
$QDOC_INDEX_DIR/qtscript/qtscript.index \
|
||||
$QDOC_INDEX_DIR/qtscxml/qtscxml.index \
|
||||
$QDOC_INDEX_DIR/qtsensors/qtsensors.index \
|
||||
$QDOC_INDEX_DIR/qttestlib/qttestlib.index \
|
||||
$QDOC_INDEX_DIR/qtuitools/qtuitools.index \
|
||||
$QDOC_INDEX_DIR/qtxml/qtxml.index
|
||||
depends += qtwidgets \
|
||||
qtcore \
|
||||
qtqml \
|
||||
qtquick \
|
||||
qmake \
|
||||
qtdesigner \
|
||||
qtdoc \
|
||||
qtgui \
|
||||
qthelp \
|
||||
qtquickcontrols \
|
||||
qtquickcontrols2 \
|
||||
qtquickextras \
|
||||
qtlinguist \
|
||||
qtscript \
|
||||
qtscxml \
|
||||
qtsensors \
|
||||
qttestlib \
|
||||
qtuitools \
|
||||
qtxml
|
||||
|
||||
include(macros.qdocconf)
|
||||
include(qt-cpp-ignore.qdocconf)
|
||||
|
88
doc/doc.pri
88
doc/doc.pri
@@ -1,87 +1,9 @@
|
||||
HELPGENERATOR = $$shell_path($$[QT_INSTALL_BINS]/qhelpgenerator) -platform minimal
|
||||
QDOC_BIN = $$shell_path($$[QT_INSTALL_BINS]/qdoc)
|
||||
QDOC_GLOBAL = QT_INSTALL_DOCS=$$[QT_INSTALL_DOCS/src] QDOC_INDEX_DIR=$$[QT_INSTALL_DOCS]
|
||||
COMPAT =
|
||||
build_online_docs: \
|
||||
QTC_DOCS = $$PWD/qtcreator-online.qdocconf $$PWD/api/qtcreator-dev-online.qdocconf
|
||||
else: \
|
||||
QTC_DOCS = $$PWD/qtcreator.qdocconf $$PWD/api/qtcreator-dev.qdocconf
|
||||
|
||||
VERSION_TAG = $$replace(QTCREATOR_VERSION, "[-.]", )
|
||||
|
||||
# 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
|
||||
include(../docs.pri)
|
||||
|
||||
fixnavi.commands = \
|
||||
cd $$shell_path($$PWD) && \
|
||||
|
54
docs.pri
Normal file
54
docs.pri
Normal file
@@ -0,0 +1,54 @@
|
||||
# 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
|
Reference in New Issue
Block a user