summaryrefslogtreecommitdiffstats
path: root/tdecore/tdehw/hwlibdaemons/tdedbus/interfaces/CMakeLists.txt
blob: eeb1ef20b59cc44fcf96f8a528dd0cbedffaca1d (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
#################################################
#
#  (C) 2020 Emanoil Kotsev
#  deloptes (AT) gmail.com
#
#  Improvements and feedback are welcome
#
#  This file is released under GPL >= 3
#
#################################################

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

set( INTROSPECTIONPATH ${CMAKE_SOURCE_DIR}/tdecore/tdehw/hwlibdaemons/tdedbus/interfaces )
set( DBUSXML2QT3_EXECUTABLE dbusxml2qt3 )

set( HardwareControl_HDRS brightnessInterface.h brightnessProxy.h cpugovernorInterface.h cpugovernorProxy.h dbusbaseNode.h hardwarecontrolNode.h inputeventsInterface.h inputeventsProxy.h introspectableInterface.h powerInterface.h powerProxy.h propertiesInterface.h  propertiesProxy.h )
set( HardwareControl_SRCS brightnessInterface.cpp brightnessProxy.cpp cpugovernorInterface.cpp cpugovernorProxy.cpp dbusbaseNode.cpp hardwarecontrolNode.cpp inputeventsInterface.cpp inputeventsProxy.cpp introspectableInterface.cpp powerInterface.cpp powerProxy.cpp propertiesInterface.cpp  propertiesProxy.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( )
    
##### HardwareControl #########################
add_custom_command( 
    OUTPUT  ${HardwareControl_HDRS} ${HardwareControl_SRCS}
    COMMAND ${DBUSXML2QT3_EXECUTABLE} ${INTROSPECTIONPATH}/org.trinitydesktop.hardwarecontrol.xml 2>/dev/null
    DEPENDS ${INTROSPECTIONPATH}/org.trinitydesktop.hardwarecontrol.xml
    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 
)

make_moc ( brightnessProxy )
make_moc ( cpugovernorProxy )
make_moc ( inputeventsProxy)
make_moc ( powerProxy )
make_moc ( propertiesProxy )

tde_add_library( hwcontrolinterfaces STATIC_PIC
  SOURCES ${HardwareControl_SRCS}
  LINK ${DBUS_TQT_LIBRARIES} 
)