[Qbs] Need help with setting up a code generator

Christian Kandeler christian.kandeler at qt.io
Wed Dec 13 17:36:16 CET 2017

On Wed, 13 Dec 2017 16:16:41 +0100
Ola Røer Thorsen <ola at silentwings.no> wrote:

> Now I've got a new problem related to the code generated library. I've set
> up a second version of the library (new templates, basically), where the
> code generated is using Qt. So there are a few QObject-based classes etc.
> My Rule item that produces the files are setting the fileTags "h" for the
> headers and "cpp" for the cpp files being created. Moc is never run on any
> of the header files, so there are no additional moc_xxx.cpp files being
> created and built. This results in lots of unresolved references in the end
> once someone tries to use the library.
> How do I make sure moc is run on the autogenerated header files so that the
> additional moc code is generated as well?

That happens automatically if the product has a dependency on the Qt.core module.
Note: The correct file tag for headers is "hpp" (not "h", as I wrote in my first reply.)


More information about the Qbs mailing list