Generate DBus interface from KConfigXT file

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


Howdy,

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.
-Allen

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



More information about the Kde-buildsystem mailing list