Auto-generated XML interfaces and dependencies

Alexander Neundorf neundorf at kde.org
Sat Dec 29 15:59:30 CET 2007


On Friday 21 December 2007, Thomas McGuire wrote:
> Hello,
>
> recently I changed the XML D-Bus interface from being hand-written to being
> auto-generated by calling qt4_generate_dbus_interface on the kmkernel.h
> header file.
> Other applications in KDEPIM also use this XML interface, for example
> KOrganizer does with
>
> qt4_add_dbus_interfaces(korganizer_eventviewer_LIB_SRCS
> ${CMAKE_BINARY_DIR}/kmail/org.kde.kmail.kmail.xml)
>
> This means KOrganizer needs the XML file from KMail's build directory. It
> seems that this creates problems with parallel builds, where things like
>
> No rule to make target `kmail/org.kde.kmail.kmail.xml', needed by
> `kontact/plugins/kmail/kmailinterface.cpp
> happen.

Ok, so in one directory the xml file is created using add_custom_command(), 
and used later on in targets in other directories.

The official way to express the dependency to a generated file is to add the 
generated file to the sources of the target.
I'm not quite sure how the dependencies are handled between directories.
Brad ?

I guess then one way would be to add a helper target
add_custom_target(CREATE_DBUS_STUFF)
which creates all the dbus xml interfaces, and have all the targets which need 
these interfaces depend on this helper target.

OTOH, if other targets need some part of what is built when kmail is being 
built, then it doesn't seem to be that wrong to make them depend on kmail (or 
the helper target).

Alex


More information about the Kde-buildsystem mailing list