summaryrefslogtreecommitdiff
path: root/src/components/dbus/CMakeLists.txt
blob: 0bea8025e1b19bc59cb1442bb7ba55601e3a2fe0 (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
include_directories (
  ${DBUS_INCLUDE_DIRS}
  ${CMAKE_CURRENT_SOURCE_DIR}/include/
  ${CMAKE_SOURCE_DIR}/
  ${CMAKE_SOURCE_DIR}/src/components/
  ${CMAKE_BINARY_DIR}/src/components/
  ${CMAKE_SOURCE_DIR}/src/components/formatters/include/
  ${CMAKE_SOURCE_DIR}/src/components/smart_objects/include/
  ${CMAKE_SOURCE_DIR}/src/components/utils/include/
)

set (SOURCES
  ${CMAKE_CURRENT_BINARY_DIR}/introspection_xml.cc
  ${CMAKE_CURRENT_BINARY_DIR}/message_descriptions.cc
  ${CMAKE_CURRENT_SOURCE_DIR}/src/dbus_adapter.cc
  ${CMAKE_CURRENT_SOURCE_DIR}/src/dbus_message.cc
  ${CMAKE_CURRENT_SOURCE_DIR}/src/dbus_message_controller.cc
  ${CMAKE_CURRENT_SOURCE_DIR}/src/schema.cc
)

set (LIBRARIES dbus-1 -L${DBUS_LIBS_DIRECTORY})


add_custom_command(
  OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/message_descriptions.cc
  COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/codegen/make_message_descriptions.py
  --infile ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/QT_HMI_API.xml
  --outdir ${CMAKE_CURRENT_BINARY_DIR}
  DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/QT_HMI_API.xml
    ${CMAKE_CURRENT_SOURCE_DIR}/codegen/make_message_descriptions.py
)

add_custom_command(
  OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/introspection_xml.cc
  COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/codegen/make_introspection_c.py
  --infile ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/QT_HMI_API.xml
  --outdir ${CMAKE_CURRENT_BINARY_DIR}
  DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/QT_HMI_API.xml
    ${CMAKE_CURRENT_SOURCE_DIR}/codegen/make_introspection_c.py
)

add_library("DBus" ${SOURCES})
ADD_DEPENDENCIES("DBus" Utils install-3rd_party_dbus)

target_link_libraries("DBus" "${LIBRARIES}")