summaryrefslogtreecommitdiffstats
path: root/tdecore/tdehw/CMakeLists.txt
blob: 737d0557c0c60fc02e750bb677cb5f77b2f927e3 (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
#################################################
#
#  (C) 2013 Golubev Alexander
#  fatzer2 (AT) gmail.com
#
#  Improvements and feedback are welcome
#
#  This file is released under GPL >= 2
#
#################################################

add_subdirectory( hwlibdata )
tde_conditional_add_subdirectory( WITH_TDEHWLIB_DAEMONS hwlibdaemons )
add_subdirectory( networkbackends )

if( NOT DBUS_SYSTEM_BUS )
  set( DBUS_SYSTEM_BUS "unix:path=/var/run/dbus/system_bus_socket" CACHE INTERNAL "" FORCE )
endif()

if( WITH_TDEHWLIB_DAEMONS OR WITH_HAL OR WITH_DEVKITPOWER OR WITH_UPOWER OR WITH_UDISKS OR WITH_UDISKS2 OR
    WITH_NETWORK_MANAGER_BACKEND OR WITH_CONSOLEKIT )
  list( APPEND TDEHW_CUSTOM_INCLUDE_DIRS ${DBUS_TQT_INCLUDE_DIRS} )
  list( APPEND TDEHW_CUSTOM_LIBRARY_DIRS ${DBUS_TQT_LIBRARY_DIRS} )
  list( APPEND TDEHW_CUSTOM_LIBRARIES ${DBUS_TQT_LIBRARIES} )
endif( )

if( WITH_TDEHWLIB_DAEMONS )
  add_definitions( -DWITH_TDEHWLIB_DAEMONS )
endif( )

if( WITH_HAL )
  add_definitions( -DWITH_HAL )
endif( )

if( WITH_DEVKITPOWER )
  add_definitions( -DWITH_DEVKITPOWER )
endif( )

if( WITH_LOGINDPOWER )
  add_definitions( -DWITH_LOGINDPOWER )
endif( )

if( WITH_UPOWER )
  add_definitions( -DWITH_UPOWER )
endif( )

if( WITH_UDISKS )
  add_definitions( -DWITH_UDISKS )
endif( )

if( WITH_UDISKS2 )
  add_definitions( -DWITH_UDISKS2 )
endif( )

if( WITH_UDEVIL )
  add_definitions( -DWITH_UDEVIL )
endif( )

if( WITH_CONSOLEKIT )
  add_definitions( -DWITH_CONSOLEKIT )
endif( )

if( WITH_PCSC )
  add_definitions( -DWITH_PCSC )
  list( APPEND TDEHW_CUSTOM_INCLUDE_DIRS ${PCSCLITE_INCLUDE_DIRS} )
  list( APPEND TDEHW_CUSTOM_LIBRARIES ${PCSCLITE_LIBRARIES} )
endif( )

if( WITH_PKCS )
  add_definitions( -DWITH_PKCS )
  list( APPEND TDEHW_CUSTOM_INCLUDE_DIRS ${LIBPKCS11-HELPER_INCLUDE_DIRS} )
  list( APPEND TDEHW_CUSTOM_LIBRARIES ${LIBPKCS11-HELPER_LIBRARIES} )
endif( )

if( WITH_CRYPTSETUP )
  add_definitions( -DWITH_CRYPTSETUP )
  list( APPEND TDEHW_CUSTOM_INCLUDE_DIRS ${LIBCRYPTSETUP_INCLUDE_DIRS} )
  list( APPEND TDEHW_CUSTOM_LIBRARIES ${LIBCRYPTSETUP_LIBRARIES} )
endif( )

if( WITH_NETWORK_MANAGER_BACKEND )
  list( APPEND TDEHW_CUSTOM_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/networkbackends/network-manager )
  list( APPEND TDEHW_CUSTOM_LIBRARIES network_manager_backend-static )
endif( WITH_NETWORK_MANAGER_BACKEND )

include_directories(
  ${TQT_INCLUDE_DIRS}
  ${CMAKE_CURRENT_BINARY_DIR}
  ${CMAKE_BINARY_DIR}
  ${CMAKE_CURRENT_SOURCE_DIR}
  ${CMAKE_BINARY_DIR}/tdecore
  ${CMAKE_SOURCE_DIR}/tdecore
  ${CMAKE_SOURCE_DIR}/dcop
  ${CMAKE_BINARY_DIR}/tdeio/kssl
  ${TDEHW_CUSTOM_INCLUDE_DIRS}
)

link_directories(
  ${TQT_LIBRARY_DIRS}
  ${TDEHW_CUSTOM_LIBRARY_DIRS}
)


##### headers ###################################

install( FILES tdehardwaredevices.h tdenetworkconnections.h tdegenericdevice.h
    tdestoragedevice.h tdecpudevice.h tdebatterydevice.h tdemainspowerdevice.h
    tdenetworkdevice.h tdebacklightdevice.h tdemonitordevice.h
    tdesensordevice.h tderootsystemdevice.h tdeeventdevice.h tdeinputdevice.h
    tdecryptographiccarddevice.h tdehwcommontypes.h
  DESTINATION ${INCLUDE_INSTALL_DIR} )


##### libtdecore ################################

set( target tdehw )

set( ${target}_SRCS
  tdehardwaredevices.cpp tdenetworkconnections.cpp tdegenericdevice.cpp
  tdestoragedevice.cpp tdecpudevice.cpp tdebatterydevice.cpp
  tdemainspowerdevice.cpp tdenetworkdevice.cpp tdebacklightdevice.cpp
  tdemonitordevice.cpp tdesensordevice.cpp tderootsystemdevice.cpp
  tdeeventdevice.cpp tdeinputdevice.cpp tdecryptographiccarddevice.cpp
  disksHelper.cpp
)

tde_add_library( ${target} STATIC_PIC AUTOMOC
  SOURCES ${${target}_SRCS}
  LINK udev ${TDENM_LIBRARIES} ${TDEUPOWER_LIBRARIES} ${TDEHW_CUSTOM_LIBRARIES}
)