Changeset View
Changeset View
Standalone View
Standalone View
templates/akonadiresource/cmake/modules/FindXsltproc.cmake
- This file was added.
1 | # Find xsltproc executable and provide a macro to generate D-Bus interfaces. | ||||
---|---|---|---|---|---|
2 | # | ||||
3 | # The following variables are defined : | ||||
4 | # XSLTPROC_EXECUTABLE - path to the xsltproc executable | ||||
5 | # Xsltproc_FOUND - true if the program was found | ||||
6 | | ||||
7 | find_program(XSLTPROC_EXECUTABLE xsltproc DOC "Path to the xsltproc executable") | ||||
8 | mark_as_advanced(XSLTPROC_EXECUTABLE) | ||||
9 | | ||||
10 | if(XSLTPROC_EXECUTABLE) | ||||
11 | set(Xsltproc_FOUND TRUE) | ||||
12 | | ||||
13 | # We depend on Akonadi, make sure it's found | ||||
14 | if(NOT DEFINED KF5Akonadi_DATA_DIR) | ||||
15 | find_package(KF5Akonadi REQUIRED) | ||||
16 | endif() | ||||
17 | | ||||
18 | | ||||
19 | # Macro to generate a D-Bus interface description from a KConfigXT file | ||||
20 | macro(kcfg_generate_dbus_interface _kcfg _name) | ||||
21 | add_custom_command( | ||||
22 | OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_name}.xml | ||||
23 | COMMAND ${XSLTPROC_EXECUTABLE} | ||||
24 | --stringparam interfaceName ${_name} | ||||
25 | ${KF5Akonadi_DATA_DIR}/kcfg2dbus.xsl | ||||
26 | ${_kcfg} | ||||
27 | > ${CMAKE_CURRENT_BINARY_DIR}/${_name}.xml | ||||
28 | DEPENDS | ||||
29 | ${KF5Akonadi_DATA_DIR}/kcfg2dbus.xsl | ||||
30 | ${_kcfg} | ||||
31 | ) | ||||
32 | endmacro() | ||||
33 | endif() |