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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4417de6..70dbba3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,10 +4,9 @@ project (kadu)
set (QT_MIN_VERSION "4.7.0")
set (CMAKE_MIN_VERSION "2.6.0")
set (CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
-option (BUILD_PLUGINS "Switch to Off if you do not want to build plugins" ON)
# configuration
-option (INSTALL_CMAKE_MODULE "Install cmake modules" ON)
+option (BUILD_PLUGINS "Switch to Off if you do not want to build plugins" ON)
if (UNIX)
option (SIG_HANDLING_ENABLED "Define if you want system signals handling" ON)
if (UNIX AND NOT APPLE)
@@ -106,14 +105,15 @@ else (APPLE)
endif (APPLE)
endmacro (kadu_source_subdirectories)
+set (KADU_INSTALLS_SDK TRUE)
include (cmake/FindKadu.cmake)
include_directories (${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/kadu-core ${QT_INCLUDES})
-if (INSTALL_CMAKE_MODULE)
+if (INSTALL_SDK)
install (FILES cmake/FindKadu.cmake DESTINATION ${KADU_CMAKE_MODULES_DIR})
install (PROGRAMS translations/plugintsupdate.sh DESTINATION ${KADU_PLUGINS_DIR}/sdk)
install (FILES translations/configuration-ui.xsl DESTINATION ${KADU_PLUGINS_DIR}/sdk)
-endif (INSTALL_CMAKE_MODULE)
+endif (INSTALL_SDK)
# build
configure_file (${CMAKE_SOURCE_DIR}/kadu-config.h.cmake ${CMAKE_BINARY_DIR}/kadu-config.h)
diff --git a/Plugins.cmake b/Plugins.cmake
index ad63f20..524c164 100644
--- a/Plugins.cmake
+++ b/Plugins.cmake
@@ -1,4 +1,4 @@
-set (COMPILE_PLUGINS
+set (DEFAULT_PLUGINS
# protocols
# GaduGadu protocol suppot
@@ -100,7 +100,7 @@ set (COMPILE_PLUGINS
# Platform-speficic plugins
if (UNIX)
- list (APPEND COMPILE_PLUGINS
+ list (APPEND DEFAULT_PLUGINS
# mediaplayer
# MPD mediaplayer support
@@ -111,7 +111,7 @@ if (UNIX)
endif (UNIX)
if (UNIX AND NOT APPLE)
- list (APPEND COMPILE_PLUGINS
+ list (APPEND DEFAULT_PLUGINS
# notifiers
# Freedesktop notification support
@@ -130,7 +130,7 @@ if (UNIX AND NOT APPLE)
endif (UNIX AND NOT APPLE)
if (APPLE)
- list (APPEND COMPILE_PLUGINS
+ list (APPEND DEFAULT_PLUGINS
# notifiers
# Growl notification support
@@ -143,7 +143,7 @@ if (APPLE)
endif (APPLE)
if (WIN32)
- list (APPEND COMPILE_PLUGINS
+ list (APPEND DEFAULT_PLUGINS
# mediaplayer
# Winamp Media Player support
@@ -152,4 +152,35 @@ if (WIN32)
endif (WIN32)
# Sort the list so plugins will be built in alphabetical order
-list (SORT COMPILE_PLUGINS)
+list (SORT DEFAULT_PLUGINS)
+
+# We must remember that the defaults may change and we want all Git users who didn't set
+# COMPILE_PLUGINS by hand to always have current defaults.
+# So if it is the very first run (and the user didn't manually specify COMPILE_PLUGINS)
+# or last time default plugins were compiled and the user didn't change COMPILE_PLUGINS manually,
+# pick the default plugins.
+if ((NOT COMPILE_PLUGINS) OR (HAVE_DEFAULT_PLUGINS AND ("${OLD_COMPILE_PLUGINS}" STREQUAL "${COMPILE_PLUGINS}")))
+ set (COMPILE_PLUGINS ${DEFAULT_PLUGINS})
+ set (HAVE_DEFAULT_PLUGINS "TRUE" CACHE INTERNAL "" FORCE)
+else ((NOT COMPILE_PLUGINS) OR (HAVE_DEFAULT_PLUGINS AND ("${OLD_COMPILE_PLUGINS}" STREQUAL "${COMPILE_PLUGINS}")))
+ # Replace whitespace and commas with semicolons
+ string (REGEX REPLACE "[ \t\n\r,]" ";" COMPILE_PLUGINS "${COMPILE_PLUGINS}")
+ # Convert to list
+ set (COMPILE_PLUGINS ${COMPILE_PLUGINS})
+
+ # Remove empty entries
+ list (REMOVE_ITEM COMPILE_PLUGINS "")
+
+ # Sort the list locally so we can compare with the default
+ set (_compile_plugins ${COMPILE_PLUGINS})
+ list (SORT _compile_plugins)
+
+ if ("${_compile_plugins}" STREQUAL "${DEFAULT_PLUGINS}")
+ set (HAVE_DEFAULT_PLUGINS "TRUE" CACHE INTERNAL "" FORCE)
+ else ("${_compile_plugins}" STREQUAL "${DEFAULT_PLUGINS}")
+ set (HAVE_DEFAULT_PLUGINS "FALSE" CACHE INTERNAL "" FORCE)
+ endif ("${_compile_plugins}" STREQUAL "${DEFAULT_PLUGINS}")
+endif ((NOT COMPILE_PLUGINS) OR (HAVE_DEFAULT_PLUGINS AND ("${OLD_COMPILE_PLUGINS}" STREQUAL "${COMPILE_PLUGINS}")))
+
+set (COMPILE_PLUGINS "${COMPILE_PLUGINS}" CACHE STRING "Plugins to compile" FORCE)
+set (OLD_COMPILE_PLUGINS "${COMPILE_PLUGINS}" CACHE INTERNAL "" FORCE)
diff --git a/cmake/FindKadu.cmake b/cmake/FindKadu.cmake
index dfa54e2..94f9c7c 100644
--- a/cmake/FindKadu.cmake
+++ b/cmake/FindKadu.cmake
@@ -62,6 +62,9 @@ if (CMAKE_COMPILER_IS_GNUCXX)
endif (CMAKE_COMPILER_IS_GNUCXX)
option (ENABLE_DEVELOPER_BUILD "Turn on some features helpful during development process (has nothing to do with debugging symbols)" OFF)
+if (KADU_INSTALLS_SDK)
+ option (INSTALL_SDK "Install SDK (API headers, cmake modules)" ON)
+endif (KADU_INSTALLS_SDK)
if (CMAKE_BUILD_TYPE STREQUAL "Debug" OR ENABLE_DEVELOPER_BUILD OR WIN32)
set (DEBUG_ENABLED 1)
@@ -133,10 +136,16 @@ endif (WIN32)
set (KADU_PLUGINS_DIR ${KADU_DATA_DIR}/plugins)
macro (kadu_api_directories INCLUDE_DIR)
- foreach (ARG ${ARGN})
- file (GLOB API_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/${ARG}/*.h)
- install (FILES ${API_HEADERS} DESTINATION ${KADU_INSTALL_INCLUDE_DIR}/kadu/${INCLUDE_DIR}/${ARG})
- endforeach (ARG)
+ if (NOT KADU_INSTALLS_SDK)
+ message (FATAL_ERROR "kadu_api_directories called but KADU_INSTALLS_SDK is not set")
+ endif (NOT KADU_INSTALLS_SDK)
+
+ if (INSTALL_SDK)
+ foreach (ARG ${ARGN})
+ file (GLOB API_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/${ARG}/*.h)
+ install (FILES ${API_HEADERS} DESTINATION ${KADU_INSTALL_INCLUDE_DIR}/kadu/${INCLUDE_DIR}/${ARG})
+ endforeach (ARG)
+ endif (INSTALL_SDK)
endmacro (kadu_api_directories)
macro (kadu_configuration)
diff --git a/plugins/docking/CMakeLists.txt b/plugins/docking/CMakeLists.txt
index 9fadbc2..d2509bf 100644
--- a/plugins/docking/CMakeLists.txt
+++ b/plugins/docking/CMakeLists.txt
@@ -6,6 +6,7 @@ set (QT_MIN_VERSION "4.7.0")
set (CMAKE_MIN_VERSION "2.6.0")
set (KADU_FIND_REQUIRED true)
+set (KADU_INSTALLS_SDK TRUE)
include (FindKadu)
kadu_api_directories (plugins/docking
diff --git a/plugins/encryption_ng/CMakeLists.txt b/plugins/encryption_ng/CMakeLists.txt
index 2de13e9..ebf62fd 100644
--- a/plugins/encryption_ng/CMakeLists.txt
+++ b/plugins/encryption_ng/CMakeLists.txt
@@ -6,6 +6,7 @@ set (QT_MIN_VERSION "4.7.0")
set (CMAKE_MIN_VERSION "2.6.0")
set (KADU_FIND_REQUIRED true)
+set (KADU_INSTALLS_SDK TRUE)
include (FindKadu)
include (FindPkgConfig)
diff --git a/plugins/gadu_protocol/CMakeLists.txt b/plugins/gadu_protocol/CMakeLists.txt
index f9d2c03..c9fd708 100644
--- a/plugins/gadu_protocol/CMakeLists.txt
+++ b/plugins/gadu_protocol/CMakeLists.txt
@@ -13,6 +13,7 @@ set (QT_USE_QTSCRIPT 1)
set (QT_USE_QTSCRIPTTOOLS 1)
set (KADU_FIND_REQUIRED true)
+set (KADU_INSTALLS_SDK TRUE)
include (FindKadu)
include (FindPkgConfig)
diff --git a/plugins/history/CMakeLists.txt b/plugins/history/CMakeLists.txt
index 81f962f..9b97f3c 100644
--- a/plugins/history/CMakeLists.txt
+++ b/plugins/history/CMakeLists.txt
@@ -6,6 +6,7 @@ set (QT_MIN_VERSION "4.7.0")
set (CMAKE_MIN_VERSION "2.8.0")
set (KADU_FIND_REQUIRED true)
+set (KADU_INSTALLS_SDK TRUE)
include (FindKadu)
kadu_api_directories (plugins/history
diff --git a/plugins/history_migration/CMakeLists.txt b/plugins/history_migration/CMakeLists.txt
index 111f6ba..e99a868 100644
--- a/plugins/history_migration/CMakeLists.txt
+++ b/plugins/history_migration/CMakeLists.txt
@@ -6,6 +6,7 @@ set (QT_MIN_VERSION "4.7.0")
set (CMAKE_MIN_VERSION "2.8.0")
set (KADU_FIND_REQUIRED true)
+set (KADU_INSTALLS_SDK TRUE)
include (FindKadu)
kadu_api_directories (plugins/history_migration
diff --git a/plugins/idle/CMakeLists.txt b/plugins/idle/CMakeLists.txt
index 25b8fad..4d6cdaf 100644
--- a/plugins/idle/CMakeLists.txt
+++ b/plugins/idle/CMakeLists.txt
@@ -6,6 +6,7 @@ set (QT_MIN_VERSION "4.7.0")
set (CMAKE_MIN_VERSION "2.6.0")
set (KADU_FIND_REQUIRED true)
+set (KADU_INSTALLS_SDK TRUE)
include (FindKadu)
kadu_api_directories (plugins/idle
diff --git a/plugins/jabber_protocol/CMakeLists.txt b/plugins/jabber_protocol/CMakeLists.txt
index 3f581c9..a2b6104 100644
--- a/plugins/jabber_protocol/CMakeLists.txt
+++ b/plugins/jabber_protocol/CMakeLists.txt
@@ -6,6 +6,7 @@ set (QT_MIN_VERSION "4.7.0")
set (CMAKE_MIN_VERSION "2.8.0")
set (KADU_FIND_REQUIRED true)
+set (KADU_INSTALLS_SDK TRUE)
include (FindKadu)
include (FindPkgConfig)
diff --git a/plugins/mediaplayer/CMakeLists.txt b/plugins/mediaplayer/CMakeLists.txt
index e1f0290..6aedb06 100644
--- a/plugins/mediaplayer/CMakeLists.txt
+++ b/plugins/mediaplayer/CMakeLists.txt
@@ -6,6 +6,7 @@ set (QT_MIN_VERSION "4.7.0")
set (CMAKE_MIN_VERSION "2.6.0")
set (KADU_FIND_REQUIRED true)
+set (KADU_INSTALLS_SDK TRUE)
include (FindKadu)
kadu_api_directories (plugins/mediaplayer
diff --git a/plugins/qt4_docking/CMakeLists.txt b/plugins/qt4_docking/CMakeLists.txt
index ae786f3..8cff0cf 100644
--- a/plugins/qt4_docking/CMakeLists.txt
+++ b/plugins/qt4_docking/CMakeLists.txt
@@ -6,6 +6,7 @@ set (QT_MIN_VERSION "4.7.0")
set (CMAKE_MIN_VERSION "2.6.0")
set (KADU_FIND_REQUIRED true)
+set (KADU_INSTALLS_SDK TRUE)
include (FindKadu)
kadu_api_directories (plugins/qt4_docking
diff --git a/plugins/sound/CMakeLists.txt b/plugins/sound/CMakeLists.txt
index 2e37302..f60c38a 100644
--- a/plugins/sound/CMakeLists.txt
+++ b/plugins/sound/CMakeLists.txt
@@ -6,6 +6,7 @@ set (QT_MIN_VERSION "4.7.0")
set (CMAKE_MIN_VERSION "2.8.0")
set (KADU_FIND_REQUIRED true)
+set (KADU_INSTALLS_SDK TRUE)
include (FindKadu)
include (FindPkgConfig)
|