summaryrefslogtreecommitdiff
path: root/api/speech-service/CMakeLists.txt
blob: 8541643b53ac80ec4c3105fdc9828d41554f6a17 (plain)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
###########################################################################
# @licence app begin@
# SPDX-License-Identifier: MPL-2.0
#
# Component Name: speech service
#
# Author: Philippe Colliot
#
# Copyright (C) 2014, PCA Peugeot Citroën
# 
# License:
# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
# this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# @licence end@
###########################################################################
project(speech-service)
cmake_minimum_required(VERSION 2.8)

message(STATUS "generation of DBus files for speech-service")

find_program(XSLTPROC xsltproc REQUIRED)
find_program(DBUSXML2CPP dbusxx-xml2cpp REQUIRED)

file (GLOB XML_TO_DBUS 
	${CMAKE_CURRENT_SOURCE_DIR}/genivi-speechservice-speechoutput.xml
)
foreach (RAW_FILE ${XML_TO_DBUS})
	get_filename_component(FILE ${RAW_FILE} NAME_WE)
	execute_process(
		COMMAND ${DBUSXML2CPP} ${RAW_FILE} --proxy=${CMAKE_CURRENT_BINARY_DIR}/${FILE}_proxy.h  
		COMMAND ${DBUSXML2CPP} ${RAW_FILE} --adaptor=${CMAKE_CURRENT_BINARY_DIR}/${FILE}_adaptor.h  
	)
endforeach()

file (GLOB XML_TO_DBUS_CONSTANT
	${CMAKE_CURRENT_SOURCE_DIR}/genivi-speechservice-constants.xml
)
foreach (RAW_FILE ${XML_TO_DBUS_CONSTANT})
	get_filename_component(FILE ${RAW_FILE} NAME_WE)
	execute_process(
		OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/${FILE}.h
		COMMAND ${XSLTPROC} ${CMAKE_CURRENT_SOURCE_DIR}/enum.xsl ${RAW_FILE}        
	)
endforeach()