summaryrefslogtreecommitdiffstats
path: root/src/libtdebluez/interfaces/CMakeLists.txt
blob: 2f44a83ac6f28dcbdaf562180112cb285be47318 (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#################################################
#
#  (C) 2020 Emanoil Kotsev
#  deloptes (AT) gmail.com
#
#  Improvements and feedback are welcome
#
#  This file is released under GPL >= 2
#
#################################################

include_directories(
  ${CMAKE_CURRENT_BINARY_DIR}
  ${TQT_INCLUDE_DIRS}
  ${DBUS_TQT_INCLUDE_DIRS}
)

set( INTROSPECTIONPATH ${CMAKE_SOURCE_DIR}/src/interfaces )
set( DBUSXML2QT3_EXECUTABLE dbusxml2qt3 )

set( ObjectManager_HDRS objectmanagerInterface.h objectmanagerProxy.h introspectableInterface.h )
set( ObjectManager_SRCS objectmanagerInterface.cpp objectmanagerProxy.cpp  introspectableInterface.cpp)

set( AgentManager_HDRS agentmanager1Interface.h agentmanager1Proxy.h healthmanager1Interface.h healthmanager1Proxy.h profilemanager1Interface.h profilemanager1Proxy.h )
set( AgentManager_SRCS agentmanager1Interface.cpp agentmanager1Proxy.cpp healthmanager1Interface.cpp healthmanager1Proxy.cpp profilemanager1Interface.cpp profilemanager1Proxy.cpp )

set( Agent_HDRS agent1Interface.h agent1Proxy.h dbusbaseNode.h tdebluezNode.h )
set( Agent_SRCS agent1Interface.cpp agent1Proxy.cpp dbusbaseNode.cpp tdebluezNode.cpp )

set( Adapter_HDRS adapter1Interface.h adapter1Proxy.h gattmanager1Interface.h gattmanager1Proxy.h media1Interface.h media1Proxy.h networkserver1Interface.h networkserver1Proxy.h propertiesInterface.h propertiesProxy.h)
set( Adapter_SRCS adapter1Interface.cpp adapter1Proxy.cpp gattmanager1Interface.cpp gattmanager1Proxy.cpp media1Interface.cpp media1Proxy.cpp networkserver1Interface.cpp networkserver1Proxy.cpp propertiesInterface.cpp propertiesProxy.cpp )

set( Device_HDRS device1Interface.h device1Proxy.h mediacontrol1Interface.h mediacontrol1Proxy.h)
set( Device_SRCS device1Interface.cpp device1Proxy.cpp mediacontrol1Interface.cpp mediacontrol1Proxy.cpp )

function( make_moc fileinput )
    add_custom_command( OUTPUT ${fileinput}.moc
      COMMAND ${TMOC_EXECUTABLE} ${fileinput}.h -o ${fileinput}.moc
      DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${fileinput}.h
      WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 
    )
    set_property( SOURCE ${CMAKE_CURRENT_BINARY_DIR}/${fileinput}.cpp APPEND
      PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${fileinput}.moc )
endfunction( )

#function( install_header fileinput target )
#    install( 
#       FILES ${CMAKE_CURRENT_BUILD_DIR}/${fileinput} 
#       DESTINATION ${target}
#    )
#endfunction( )

    
##### ObjectManager #########################
add_custom_command( 
    OUTPUT  ${ObjectManager_HDRS} ${ObjectManager_SRCS}
    COMMAND ${DBUSXML2QT3_EXECUTABLE} ${INTROSPECTIONPATH}/org.freedesktop.DBus.ObjectManager.xml 2>/dev/null
    DEPENDS ${INTROSPECTIONPATH}/org.freedesktop.DBus.ObjectManager.xml
    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 
)
make_moc ( objectmanagerProxy )

##### AgentManager #########################
add_custom_command( 
    OUTPUT  ${AgentManager_HDRS} ${AgentManager_SRCS}  
    COMMAND ${DBUSXML2QT3_EXECUTABLE} ${INTROSPECTIONPATH}/org.bluez.manager.xml 2>/dev/null
    DEPENDS ${INTROSPECTIONPATH}/org.bluez.manager.xml
    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 
)
make_moc ( agentmanager1Proxy )
make_moc ( healthmanager1Proxy )
make_moc ( profilemanager1Proxy )

##### Agent #########################
add_custom_command( 
    OUTPUT  ${Agent_HDRS} ${Agent_SRCS}
    COMMAND ${DBUSXML2QT3_EXECUTABLE} ${INTROSPECTIONPATH}/org.tdebluez.agent.xml 2>/dev/null
    DEPENDS ${INTROSPECTIONPATH}/org.tdebluez.agent.xml
    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 
)
make_moc ( agent1Proxy )

##### Adapter #########################
add_custom_command( 
    OUTPUT  ${Adapter_HDRS} ${Adapter_SRCS}
    COMMAND ${DBUSXML2QT3_EXECUTABLE} ${INTROSPECTIONPATH}/org.bluez.adapter.xml 2>/dev/null
    DEPENDS ${INTROSPECTIONPATH}/org.bluez.adapter.xml
    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 
)
make_moc ( adapter1Proxy )
make_moc ( gattmanager1Proxy )
make_moc ( networkserver1Proxy )
make_moc ( propertiesProxy )
    
##### Device #########################
add_custom_command( 
    OUTPUT  ${Device_HDRS} ${Device_SRCS}
    COMMAND ${DBUSXML2QT3_EXECUTABLE} ${INTROSPECTIONPATH}/org.bluez.device.xml 2>/dev/null
    DEPENDS ${INTROSPECTIONPATH}/org.bluez.device.xml
    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 
)
make_moc ( device1Proxy )
make_moc ( propertiesProxy )
make_moc ( mediacontrol1Proxy )
make_moc ( media1Proxy )

tde_add_library( bluezinterfaces STATIC_PIC AUTOMOC
  SOURCES ${ObjectManager_SRCS} ${AgentManager_SRCS} ${Agent_SRCS} ${Adapter_SRCS} ${Device_SRCS}
  LINK ${DBUS_TQT_LIBRARIES} 
)

##### install headers ###################################


#file( GLOB _bin_dirs RELATIVE ${CMAKE_CURRENT_BINARY_DIR}
#      ${CMAKE_CURRENT_BINARY_DIR}/* )
#unset( _exclude_dirs )
#foreach( _dir IN LISTS _bin_dirs )
#  if(IS_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_dir} )
#    list( APPEND _exclude_dirs PATTERN ${_dir} EXCLUDE )
#  endif()
#endforeach()
#
#install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
#    DESTINATION ${INCLUDE_INSTALL_DIR}/tdeobex
#    USE_SOURCE_PERMISSIONS
#    FILES_MATCHING PATTERN PATTERN "*.h"
#    ${_exclude_dirs} 
#)

install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
    DESTINATION ${INCLUDE_INSTALL_DIR}/tdebluez
    USE_SOURCE_PERMISSIONS
    FILES_MATCHING PATTERN PATTERN "*.h"
    PATTERN "CMakeFiles" EXCLUDE)