summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
blob: 07e4e781a8614663c4b62d82899a3e582a4fc224 (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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
#################################################
#
#  (C) 2012 Golubev Alexander
#  fatzer2 (AT) gmail.com
#
#  Improvements and feedback are welcome
#
#  This file is released under GPL >= 2
#
#################################################

cmake_minimum_required( VERSION 2.8.12 )


##### general package setup #####################

project( tdeutils )

set( PACKAGE tdeutils )
set( VERSION R14.0.11 )


##### include essential cmake modules ###########

include( FindPkgConfig )
include( CheckIncludeFile )
include( CheckIncludeFiles )
include( CheckLibraryExists )
include( CheckSymbolExists )
include( CheckFunctionExists )
include( CheckCSourceCompiles )
include( CheckCXXSourceCompiles )
include( CheckTypeSize )


##### include our cmake modules #################

set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )
include( TDEMacros )


##### setup install paths #######################

include( TDESetupPaths )
tde_setup_paths( )


##### optional stuff ############################

option( WITH_DPMS "Enable Display Power Management Signaling support" OFF )
option( WITH_XSCREENSAVER "Enable xscreensaver support" OFF )
option( WITH_ASUS "Enable asus laptop support" OFF )
option( WITH_POWERBOOK "Enable powerbook laptop support" OFF )
option( WITH_POWERBOOK2 "Enable powerbook2 laptop support" OFF )
option( WITH_VAIO "Enable vaio laptop support" OFF )
option( WITH_THINKPAD "Enable thinkpad laptop support" OFF )
option( WITH_I8K "Enable dell laptop support" OFF )
option( WITH_SNMP "Enable SNMP support" OFF )
option( WITH_SENSORS "Enable lm_sensors support" OFF )
option( WITH_XMMS "Enable xmms support" OFF )
option( WITH_TDENEWSTUFF "Enable tdenewstuff support" OFF )

# option( WITH_NV "Enable nv support" OFF )


##### options comments ##########################

# WITH_DPMS         affects klaptopdaemon
# WITH_DPMS         description enables the klaptopdaemon to take into account
#                               the state of DPMS X extention to determine is
#                               there any user activity.
# WITH_DPMS         requires libXext to build
# WITH_XSCREENSAVER affects klaptopdaemon
# WITH_XSCREENSAVER description this makes klaptopdaemon not to register user
#                               events when screensaver is disabled.
# WITH_ASUS         affects kmilo 
# WITH_POWERBOOK    affects kmilo
# WITH_POWERBOOK    requires pbbuttonsd
# WITH_POWERBOOK2   affects kmilo
# WITH_POWERBOOK2   requires pbbuttonsd
# WITH_VAIO         affects kmilo
# WITH_THINKPAD     affects kmilo
# WITH_I8K          affects kmilo ksim
# WITH_SNMP         affects ksim
# WITH_SENSORS      affects ksim
# WITH_XMMS         affects superkaramba
# WITH_XMMS         description enables supercaramba applets to gain 
#                               information about now playing track etc.
# WITH_TDENEWSTUFF  affects superkaramba
# WITH_TDENEWSTUFF  description enables support for downloadable content
#                               from OpenDesktop.org.
# FIXME: test if WITH_TDENEWSTUFF works in trinity or not

# NOTE: In addition to affects DPMS and XScreenSaver backend options for 
#       klaptopdaemon there is some XIdle code but it wasn't compleatly 
#       implemented and disabled permanently.

# NOTE: WITH_<laptop> options controls what kamilo modules will be build

# NOTE: WITH_{SENSORS,SNMP,I8K} options for ksim determin which ksim modules
#       will be build.

# NOTE: WITH_XMMS doesn't requires xmms2 palayer to be compiled.


##### user requested modules ####################

option( BUILD_ALL "Build all" OFF )
option( BUILD_DOC "Build documentation" ${BUILD_ALL} )
option( BUILD_ARK "Build ark" ${BUILD_ALL} )
option( BUILD_CHARSELECTAPPLET "Build charselectapplet" ${BUILD_ALL} )
option( BUILD_KCALC "Build kcalc" ${BUILD_ALL} )
option( BUILD_KCHARSELECT "Build kcharselect" ${BUILD_ALL} )
option( BUILD_TDELIRC "Build tdelirc" ${BUILD_ALL} )
option( BUILD_TDESSH "Build tdessh" ${BUILD_ALL} )
option( BUILD_KDF "Build kdf" ${BUILD_ALL} )
option( BUILD_KEDIT "Build kedit" ${BUILD_ALL} )
option( BUILD_KFLOPPY "Build kfloppy" ${BUILD_ALL} )
option( BUILD_KGPG "Build kgpg" ${BUILD_ALL} )
option( BUILD_KHEXEDIT "Build khexedit" ${BUILD_ALL} )
option( BUILD_KJOTS "Build kjots" ${BUILD_ALL} )
option( BUILD_KLAPTOPDAEMON "Build klaptopdaemon" ${BUILD_ALL} )
option( BUILD_KMILO "Build kmilo" ${BUILD_ALL} )
option( BUILD_KREGEXPEDITOR "Build kregexpeditor" ${BUILD_ALL} )
option( BUILD_KSIM "Build ksim" ${BUILD_ALL} )
option( BUILD_KTIMER "Build ktimer" ${BUILD_ALL} )
option( BUILD_TDEWALLET "Build tdewallet" ${BUILD_ALL} )

option( BUILD_SUPERKARAMBA "Build superkaramba" ${BUILD_ALL} )

##### add apidox targets ############

add_custom_target(apidox
  COMMAND "./generate_apidox" "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" "${HTML_INSTALL_DIR}" "/usr/share/qt3/doc/html"
  WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/cmake/")

add_custom_target(install-apidox
  COMMAND "./install_apidox" "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" "${HTML_INSTALL_DIR}" "${CMAKE_INSTALL_PREFIX}"
  WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/cmake/")

##### configure checks ##########################

include( ConfigureChecks.cmake )


###### global compiler settings #################

add_definitions(
  -DHAVE_CONFIG_H
)

set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" )
set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" )
set( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined" )


##### tdeutils directories ######################

tde_conditional_add_subdirectory( BUILD_ARK ark )
tde_conditional_add_subdirectory( BUILD_DOC doc )
tde_conditional_add_subdirectory( BUILD_CHARSELECTAPPLET charselectapplet )
tde_conditional_add_subdirectory( BUILD_KCALC kcalc )
tde_conditional_add_subdirectory( BUILD_KCHARSELECT kcharselect )
tde_conditional_add_subdirectory( BUILD_TDELIRC tdelirc )
tde_conditional_add_subdirectory( BUILD_TDESSH tdessh )
tde_conditional_add_subdirectory( BUILD_KDF kdf )
tde_conditional_add_subdirectory( BUILD_KEDIT kedit )
tde_conditional_add_subdirectory( BUILD_KFLOPPY kfloppy )
tde_conditional_add_subdirectory( BUILD_KGPG kgpg )
tde_conditional_add_subdirectory( BUILD_KHEXEDIT khexedit )
tde_conditional_add_subdirectory( BUILD_KJOTS kjots )
tde_conditional_add_subdirectory( BUILD_KLAPTOPDAEMON klaptopdaemon )
tde_conditional_add_subdirectory( BUILD_KMILO kmilo )
tde_conditional_add_subdirectory( BUILD_KREGEXPEDITOR kregexpeditor )
tde_conditional_add_subdirectory( BUILD_KSIM ksim )
tde_conditional_add_subdirectory( BUILD_KTIMER ktimer )
tde_conditional_add_subdirectory( BUILD_TDEWALLET tdewallet )
tde_conditional_add_subdirectory( BUILD_SUPERKARAMBA superkaramba )


##### write configure files #####################

configure_file( config.h.cmake config.h @ONLY )