File: FindXsltproc.cmake

package info (click to toggle)
libkf5pimcommon 4%3A16.04.2-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,412 kB
  • ctags: 3,299
  • sloc: cpp: 25,758; sh: 27; xml: 8; makefile: 3
file content (32 lines) | stat: -rw-r--r-- 1,015 bytes parent folder | download | duplicates (22)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Find xsltproc executable and provide a macro to generate D-Bus interfaces.
#
# The following variables are defined :
# XSLTPROC_EXECUTABLE - path to the xsltproc executable
# Xsltproc_FOUND - true if the program was found
#
find_program(XSLTPROC_EXECUTABLE xsltproc DOC "Path to the xsltproc executable")
mark_as_advanced(XSLTPROC_EXECUTABLE)

if(XSLTPROC_EXECUTABLE)
  set(Xsltproc_FOUND TRUE)

  # We depend on kdepimlibs, make sure it's found
  if(NOT DEFINED KF5Akonadi_DATA_DIR)
    find_package(KF5Akonadi REQUIRED)
  endif()


  # Macro to generate 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}
      ${KF5Akonadi_DATA_DIR}/kcfg2dbus.xsl
      ${_kcfg}
      > ${CMAKE_CURRENT_BINARY_DIR}/${_name}.xml
      DEPENDS ${KF5Akonadi_DATA_DIR}/kcfg2dbus.xsl
      ${_kcfg}
      )
  endmacro()
endif()