qmake_documentation
authorDebian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Wed, 25 Jan 2017 09:01:02 +0000 (09:01 +0000)
committerDmitry Shachnev <mitya57@debian.org>
Wed, 25 Jan 2017 09:01:02 +0000 (09:01 +0000)
Gbp-Pq: Name qmake_documentation.diff

doc/doc.pri
doc/doc_targets.pri [new file with mode: 0644]

index 4a7280586c7b0e47f86b9952c806f648c9730340..65589706965a55f84bcf4cae47422318f8fd5f4c 100644 (file)
@@ -8,56 +8,21 @@ QDOC_BIN = $$targetPath($$[QT_INSTALL_BINS]/qdoc)
 QDOC_MAINFILE = $$PWD/qbs.qdocconf
 HELPGENERATOR = $$targetPath($$[QT_INSTALL_BINS]/qhelpgenerator)
 
-VERSION_TAG = $$replace(QBS_VERSION, "[-.]", )
-
-HTML_DOC_PATH=$$OUT_PWD/doc/html
-equals(QMAKE_DIR_SEP, /) {   # unix, mingw+msys
-    QDOC = SRCDIR=$$PWD OUTDIR=$$HTML_DOC_PATH QBS_VERSION=$$QBS_VERSION QBS_VERSION_TAG=$$VERSION_TAG QT_INSTALL_DOCS=$$[QT_INSTALL_DOCS] $$QDOC_BIN
-} else:win32-g++* {   # just mingw
-    # The lack of spaces in front of the && is necessary!
-    QDOC = set SRCDIR=$$PWD&& set OUTDIR=$$HTML_DOC_PATH&& set QBS_VERSION=$$QBS_VERSION&& set QBS_VERSION_TAG=$$VERSION_TAG&& set QT_INSTALL_DOCS=$$[QT_INSTALL_DOCS]&& $$QDOC_BIN
-} else {   # nmake
-    QDOC = set SRCDIR=$$PWD $$escape_expand(\\n\\t) \
-           set OUTDIR=$$HTML_DOC_PATH $$escape_expand(\\n\\t) \
-           set QBS_VERSION=$$QBS_VERSION $$escape_expand(\\n\\t) \
-           set QBS_VERSION_TAG=$$VERSION_TAG $$escape_expand(\\n\\t) \
-           set QT_INSTALL_DOCS=$$[QT_INSTALL_DOCS] $$escape_expand(\\n\\t) \
-           $$QDOC_BIN
-}
-
-QHP_FILE = $$HTML_DOC_PATH/qbs.qhp
-QCH_FILE = $$OUT_PWD/doc/qbs.qch
-
-HELP_DEP_FILES = $$PWD/qbs.qdoc \
-                 $$QDOC_MAINFILE
-
-html_docs.commands = $$QDOC $$PWD/qbs.qdocconf
-html_docs.depends += $$HELP_DEP_FILES
-
-html_docs_online.commands = $$QDOC $$PWD/qbs-online.qdocconf
-html_docs_online.files = $$QHP_FILE
-
-qch_docs.commands = $$HELPGENERATOR -o $$shell_quote($$QCH_FILE) $$QHP_FILE
-qch_docs.depends += html_docs
-
-docs_online.depends = html_docs_online
-QMAKE_EXTRA_TARGETS += html_docs_online docs_online
-
-inst_qch_docs.files = $$QCH_FILE
-inst_qch_docs.path = $${QBS_INSTALL_PREFIX}/share/doc/qbs
-inst_qch_docs.CONFIG += no_check_exist no_default_install
-INSTALLS += inst_qch_docs
-
-inst_html_docs.files = $$HTML_DOC_PATH
-inst_html_docs.path = $$inst_qch_docs.path
-inst_html_docs.CONFIG += no_check_exist no_default_install directory
-INSTALLS += inst_html_docs
-
-install_docs.depends = install_inst_qch_docs install_inst_html_docs
-QMAKE_EXTRA_TARGETS += install_docs
-
-docs.depends = qch_docs
-QMAKE_EXTRA_TARGETS += html_docs qch_docs docs
+include(doc_targets.pri)
+
+html_docs.depends = qbs_html_docs
+html_docs_online.depends = qbs_html_docs_online
+qch_docs.depends = qbs_qch_docs
+docs_online.depends = qbs_docs_online
+install_docs.depends = qbs_install_docs
+docs.depends = qbs_docs
+QMAKE_EXTRA_TARGETS += \
+    docs \
+    docs_online \
+    html_docs \
+    html_docs_online \
+    install_docs \
+    qch_docs
 
 fixnavi.commands = \
     cd $$targetPath($$PWD) && \
diff --git a/doc/doc_targets.pri b/doc/doc_targets.pri
new file mode 100644 (file)
index 0000000..79f4857
--- /dev/null
@@ -0,0 +1,49 @@
+# This pri file can be included by other projects that want to provide the qbs documentation.
+# Common variables like QDOC_BIN or HELPGENERATOR must be provided by the including file.
+QBS_VERSION_TAG = $$replace(QBS_VERSION, "[-.]", )
+
+isEmpty(QBS_DOCS_BUILD_DIR): QBS_DOCS_BUILD_DIR = $$OUT_PWD/doc
+isEmpty(QBS_HTML_DOC_PATH): QBS_HTML_DOC_PATH = $$QBS_DOCS_BUILD_DIR/html
+equals(QMAKE_DIR_SEP, /) {   # unix, mingw+msys
+    QDOC = SRCDIR=$$PWD OUTDIR=$$QBS_HTML_DOC_PATH QBS_VERSION=$$QBS_VERSION QBS_VERSION_TAG=$$QBS_VERSION_TAG QT_INSTALL_DOCS=$$[QT_INSTALL_DOCS] $$QDOC_BIN
+} else: mingw {
+    # The lack of spaces in front of the && is necessary!
+    QDOC = set SRCDIR=$$PWD&& set OUTDIR=$$QBS_HTML_DOC_PATH&& set QBS_VERSION=$$QBS_VERSION&& set QBS_VERSION_TAG=$$QBS_VERSION_TAG&& set QT_INSTALL_DOCS=$$[QT_INSTALL_DOCS]&& $$QDOC_BIN
+} else {   # nmake
+    QDOC = set SRCDIR=$$PWD $$escape_expand(\\n\\t) \
+           set OUTDIR=$$QBS_HTML_DOC_PATH $$escape_expand(\\n\\t) \
+           set QBS_VERSION=$$QBS_VERSION $$escape_expand(\\n\\t) \
+           set QBS_VERSION_TAG=$$QBS_VERSION_TAG $$escape_expand(\\n\\t) \
+           set QT_INSTALL_DOCS=$$[QT_INSTALL_DOCS] $$escape_expand(\\n\\t) \
+           $$QDOC_BIN
+}
+
+QBS_QHP_FILE = $$QBS_HTML_DOC_PATH/qbs.qhp
+QBS_QCH_FILE = $$QBS_DOCS_BUILD_DIR/qbs.qch
+
+QBS_HELP_DEP_FILES = \
+    $$PWD/qbs.qdoc \
+    $$PWD/qbs.qdocconf
+
+qbs_html_docs.commands = $$QDOC $$PWD/qbs.qdocconf
+qbs_html_docs.depends += $$QBS_HELP_DEP_FILES
+
+qbs_qch_docs.commands = $$HELPGENERATOR -o $$shell_quote($$QBS_QCH_FILE) $$QBS_QHP_FILE
+qbs_qch_docs.depends += qbs_html_docs
+
+isEmpty(QBS_DOCS_INSTALL_DIR): QBS_DOCS_INSTALL_DIR = $${QBS_INSTALL_PREFIX}/share/doc/qbs
+inst_qbs_qch_docs.files = $$QBS_QCH_FILE
+inst_qbs_qch_docs.path = $$QBS_DOCS_INSTALL_DIR
+inst_qbs_qch_docs.CONFIG += no_check_exist no_default_install
+INSTALLS += inst_qbs_qch_docs
+
+inst_qbs_html_docs.files = $$QBS_HTML_DOC_PATH
+inst_qbs_html_docs.path = $$inst_qbs_qch_docs.path
+inst_qbs_html_docs.CONFIG += no_check_exist no_default_install directory
+INSTALLS += inst_qbs_html_docs
+
+qbs_install_docs.depends = install_inst_qbs_qch_docs install_inst_qbs_html_docs
+QMAKE_EXTRA_TARGETS += qbs_install_docs
+
+qbs_docs.depends = qbs_qch_docs
+QMAKE_EXTRA_TARGETS += qbs_html_docs qbs_qch_docs qbs_docs