Generate DBus interface from KConfigXT file

Allen Winter winter at
Fri Mar 28 01:07:46 CET 2008


Enclosed is a CMake code snippet currently in FindAkonadi.cmake in 
kdepimlibs/cmake/modules.  It uses xsltproc to generate a D-Bus interface
from a KConfigXT file.

I sorta think this might be useful be for all KDE, not just kdepimlibs.

LibXslt is a required dependency so I think it should be ok to 
remove the macro_optional_find_package(LibXslt) and simply
assume that ${XSLTPROC_EXECUTABLE} is set, right?

Can I add something like this to our buildsystem?
The kcfg2dbus.xsl is Akonadi-independent so it should
be easy enough to move into kdelibs.

-- cmake code snippet --
    # generates a D-Bus interface description from a KConfigXT file
    macro( kcfg_generate_dbus_interface _kcfg _name )
        OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_name}.xml
        COMMAND ${XSLTPROC_EXECUTABLE} --stringparam interfaceName ${_name}
                > ${CMAKE_CURRENT_BINARY_DIR}/${_name}.xml
        DEPENDS ${CMAKE_INSTALL_PREFIX}/share/apps/akonadi-kde/kcfg2dbus.xsl
    endmacro( kcfg_generate_dbus_interface )

More information about the Kde-buildsystem mailing list