Skip to content
Commit 5f03b4b5 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Fix automoc issues on generated DBus source files

When generating the source files with qt_add_dbus_interfaces(),
the respective source file properties are set only in the scope
of the "src/dbus" directory, where the macro is called which sets those.

So when using the generated cpp file from the other directories, any
properties need to be set explicitly again. By default, SKIP_AUTOMOC
is not set, so automoc will be run on those files now in these other
directories.

Currently this only results in the waring on the first run in a build dir
"No relevant classes found. No output generated."
And the generated cpp file will just include the moc files as generated
by the qt_add_dbus_interfaces() call in the src/dbus build dir.

Things fail though when cmake is run again on a non-empty build dir,
with all the generated files around, including the generated header
with the Q_OBJECT macro. Because automoc when run from the other directory
on the generated cpp file will now also see the existing generated header
relative to it, and adds it to the headers for the magic header automoc.
Which then results in the moc-generated code existing 2x, once as
included directly from the generated cpp file and once from the automoc
header moc files.

Compiling the generated DBus service files into own libraries works around
the need to setup properties of the source files once more and trying
to match what the generation macros internally do. As well as removes the
need for the manual generation dependecy.
parent fbc96e5f
Pipeline #322263 passed with stage
in 4 minutes and 24 seconds
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