1
cmake_minimum_required(VERSION 2.6)
3
cmake_policy(SET CMP0011 NEW)
6
find_program(GDBUS_CODEGEN NAMES gdbus-codegen DOC "gdbus-codegen executable")
8
message(FATAL_ERROR "Excutable gdbus-codegen not found")
11
macro(add_gdbus_codegen outfiles name prefix namespace service_xml)
13
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${name}.h" "${CMAKE_CURRENT_BINARY_DIR}/${name}.c"
14
COMMAND "${GDBUS_CODEGEN}"
15
--generate-c-code "${name}"
16
--interface-prefix "${prefix}"
17
--c-namespace "${namespace}"
19
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
20
DEPENDS ${ARGN} "${service_xml}"
22
list(APPEND ${outfiles} "${CMAKE_CURRENT_BINARY_DIR}/${name}.c")
23
endmacro(add_gdbus_codegen)