Search code examples
qbsqdoc

qbs does not invoke qdoc


All is in question I provided a simple qdocconf file along with my project but, qbs does not invoke qdoc while the qdocconf is in the files property of the project.

Project.qbs

import qbs

Project {
    name: "LoggingMessageHandler"

    Product {
        files: [
            "config.qdocconf",
            "messagehandler.cpp",
        ]
        name: "LoggingMessageHandler"
        type: project.staticBuild ? "staticlibrary" : "dynamiclibrary"

        Depends { name: "cpp" }
        Depends { name: "Qt.core" }

        cpp.cxxLanguageVersion: "c++11"
        cpp.defines: [
            "QT_DEPRECATED_WARNINGS",
            "QT_DISABLE_DEPRECATED_BEFORE=0x060000"
        ]

        Export {
            Depends { name: "cpp" }
            Depends { name: "Qt.core" }
            cpp.includePaths: [product.sourceDirectory]
        }

        Group {
            overrideTags: false
            files: "*.qdocconf"
            fileTags: "qdocconf-main"
        }

        Group {
            name: "install include"
            overrideTags: false
            files: [
                "messagehandler.h",
                "LoggingMessageHandler"
            ]
            qbs.install: project.installInclude
            qbs.installDir: "/include"
        }

    }

}

config.qdocconf:

project = LoggingMessageHandler
description = A set of QMessageHandler function to be used with the Qt Logging framework.

depends += qtcore

outputdir = ./doc
headerdirs = .
sourcedirs = .
exampledirs = .

The project dir hierarchy: enter image description here

PS: the project.installInclude is a switch set from a higher project file.


Solution

  • You did not tell qbs that you want documentation to be built. Add a relevant tag to the product type, such as "qch". See https://doc.qt.io/qbs/qt-modules.html#core-file-tags for the qdoc-related file tags. See https://doc.qt.io/qbs/rule-item.html#rules-and-product-types on the general role of the product type.