-
Notifications
You must be signed in to change notification settings - Fork 135
/
CMakeLists.txt
291 lines (241 loc) · 9.29 KB
/
CMakeLists.txt
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
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
cmake_minimum_required(VERSION 3.18.0 FATAL_ERROR)
# CMP0000: Call the cmake_minimum_required() command at the beginning of the top-level
# CMakeLists.txt file even before calling the project() command.
# The cmake_minimum_required(VERSION) command implicitly invokes the cmake_policy(VERSION)
# command to specify that the current project code is written for the given range of CMake
# versions.
project(lxqt-panel)
option(UPDATE_TRANSLATIONS "Update source translation translations/*.ts files" OFF)
option(WITH_SCREENSAVER_FALLBACK "Include support for converting the deprecated 'screensaver' plugin to 'quicklaunch'. This requires the lxqt-leave (lxqt-session) to be installed in runtime." ON)
# plugin-mainmenu
option(USE_MENU_CACHE "Use menu-cached (no noticeable penalty even on a 2004 single core pentium if not used)" OFF)
# additional cmake files
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
macro(setByDefault VAR_NAME VAR_VALUE)
if(NOT DEFINED ${VAR_NAME})
set (${VAR_NAME} ${VAR_VALUE})
endif(NOT DEFINED ${VAR_NAME})
endmacro()
include(GNUInstallDirs)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
set(REQUIRED_QT_VERSION "6.6.0")
set(KF6_MINIMUM_VERSION "6.0.0")
set(LXQT_GLOBALKEYS_MINIMUM_VERSION "2.0.0")
set(LXQT_MINIMUM_VERSION "2.0.0")
find_package(Qt6DBus ${REQUIRED_QT_VERSION} REQUIRED)
find_package(Qt6LinguistTools ${REQUIRED_QT_VERSION} REQUIRED)
find_package(Qt6Widgets ${REQUIRED_QT_VERSION} REQUIRED)
find_package(Qt6Xml ${REQUIRED_QT_VERSION} REQUIRED)
find_package(KF6WindowSystem ${KF6_MINIMUM_VERSION} REQUIRED)
find_package(lxqt ${LXQT_MINIMUM_VERSION} REQUIRED)
find_package(lxqt-globalkeys-ui ${LXQT_GLOBALKEYS_MINIMUM_VERSION} REQUIRED)
find_package(lxqt-menu-data ${LXQT_MINIMUM_VERSION} REQUIRED)
find_package(LayerShellQt REQUIRED)
# Patch Version
set(LXQT_PANEL_PATCH_VERSION 1)
set(LXQT_PANEL_VERSION ${LXQT_MAJOR_VERSION}.${LXQT_MINOR_VERSION}.${LXQT_PANEL_PATCH_VERSION})
add_definitions("-DLXQT_PANEL_VERSION=\"${LXQT_PANEL_VERSION}\"")
include(LXQtPreventInSourceBuilds)
include(LXQtTranslate)
# All LXQtCompilerSettings except CMAKE_MODULE_LINKER_FLAGS work just fine
# So we reset only these Flags after loading LXQtCompilerSettings
# lxqt-build-tools:
# set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined ${SYMBOLIC_FLAGS} ${CMAKE_MODULE_LINKER_FLAGS}")
message(STATUS "==OLD== CMAKE_MODULE_LINKER_FLAGS: ${CMAKE_MODULE_LINKER_FLAGS}")
set( OLD_CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}")
include(LXQtCompilerSettings NO_POLICY_SCOPE)
set(CMAKE_MODULE_LINKER_FLAGS "${OLD_CMAKE_MODULE_LINKER_FLAGS} ${SYMBOLIC_FLAGS}")
# Warning: This must be before add_subdirectory(panel). Move with caution.
set(PLUGIN_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/lxqt-panel")
add_definitions(
-DPLUGIN_DIR=\"${PLUGIN_DIR}\"
)
message(STATUS "CMAKE Module linker flags: ${CMAKE_MODULE_LINKER_FLAGS}")
message(STATUS "Panel plugins location: ${PLUGIN_DIR}")
#########################################################################
# Plugin system
# You can enable/disable building of the plugin using cmake options.
# cmake -DWORLDCLOCK_PLUGIN=Yes .. # Enable worldclock plugin
# cmake -DWORLDCLOCK_PLUGIN=No .. # Disable worldclock plugin
include("cmake/BuildPlugin.cmake")
set(ENABLED_PLUGINS) # list of enabled plugins
set(STATIC_PLUGINS) # list of statically linked plugins
setByDefault(COLORPICKER_PLUGIN Yes)
if(COLORPICKER_PLUGIN)
list(APPEND ENABLED_PLUGINS "Color Picker")
add_subdirectory(plugin-colorpicker)
endif()
setByDefault(CPULOAD_PLUGIN Yes)
if(CPULOAD_PLUGIN)
find_library(STATGRAB_LIB statgrab)
if(NOT STATGRAB_LIB)
message(FATAL_ERROR "CPU Load plugin requires libstatgrab")
endif()
list(APPEND ENABLED_PLUGINS "Cpu Load")
add_subdirectory(plugin-cpuload)
endif()
setByDefault(CUSTOMCOMMAND_PLUGIN Yes)
if(CUSTOMCOMMAND_PLUGIN)
list(APPEND ENABLED_PLUGINS "Custom Command")
add_subdirectory(plugin-customcommand)
endif()
setByDefault(DIRECTORYMENU_PLUGIN Yes)
if(DIRECTORYMENU_PLUGIN)
list(APPEND ENABLED_PLUGINS "Directory menu")
add_subdirectory(plugin-directorymenu)
endif()
setByDefault(DOM_PLUGIN Yes)
if(DOM_PLUGIN)
list(APPEND ENABLED_PLUGINS "DOM")
add_subdirectory(plugin-dom)
endif(DOM_PLUGIN)
setByDefault(DESKTOPSWITCH_PLUGIN Yes)
if(DESKTOPSWITCH_PLUGIN)
list(APPEND STATIC_PLUGINS "desktopswitch")
add_definitions(-DWITH_DESKTOPSWITCH_PLUGIN)
list(APPEND ENABLED_PLUGINS "Desktop Switcher")
add_subdirectory(plugin-desktopswitch)
endif()
setByDefault(FANCYMENU_PLUGIN Yes)
if(FANCYMENU_PLUGIN)
list(APPEND STATIC_PLUGINS "fancymenu")
add_definitions(-DWITH_FANCYMENU_PLUGIN)
list(APPEND ENABLED_PLUGINS "Application fancy menu")
add_subdirectory(plugin-fancymenu)
endif()
setByDefault(KBINDICATOR_PLUGIN Yes)
if(KBINDICATOR_PLUGIN)
list(APPEND ENABLED_PLUGINS "Keyboard Indicator")
add_subdirectory(plugin-kbindicator)
endif(KBINDICATOR_PLUGIN)
setByDefault(MAINMENU_PLUGIN Yes)
if(MAINMENU_PLUGIN)
list(APPEND STATIC_PLUGINS "mainmenu")
add_definitions(-DWITH_MAINMENU_PLUGIN)
list(APPEND ENABLED_PLUGINS "Application menu")
add_subdirectory(plugin-mainmenu)
endif()
setByDefault(MOUNT_PLUGIN Yes)
if(MOUNT_PLUGIN)
list(APPEND ENABLED_PLUGINS "Mount")
add_subdirectory(plugin-mount)
endif(MOUNT_PLUGIN)
setByDefault(QUICKLAUNCH_PLUGIN Yes)
if(QUICKLAUNCH_PLUGIN)
list(APPEND STATIC_PLUGINS "quicklaunch")
add_definitions(-DWITH_QUICKLAUNCH_PLUGIN)
list(APPEND ENABLED_PLUGINS "Quicklaunch")
add_subdirectory(plugin-quicklaunch)
endif()
setByDefault(SENSORS_PLUGIN Yes)
if(SENSORS_PLUGIN)
find_library(SENSORS_LIB sensors)
if(NOT SENSORS_LIB)
message(FATAL_ERROR "Sensors plugin requires libsensors")
endif()
list(APPEND ENABLED_PLUGINS "Sensors")
add_subdirectory(plugin-sensors)
endif()
setByDefault(SHOWDESKTOP_PLUGIN Yes)
if(SHOWDESKTOP_PLUGIN)
list(APPEND STATIC_PLUGINS "showdesktop")
add_definitions(-DWITH_SHOWDESKTOP_PLUGIN)
list(APPEND ENABLED_PLUGINS "Show Desktop")
add_subdirectory(plugin-showdesktop)
endif()
setByDefault(QEYES_PLUGIN Yes)
if(QEYES_PLUGIN)
list(APPEND ENABLED_PLUGINS "QEyes")
add_subdirectory(plugin-qeyes)
endif()
setByDefault(NETWORKMONITOR_PLUGIN Yes)
if(NETWORKMONITOR_PLUGIN)
find_library(STATGRAB_LIB statgrab)
if(NOT STATGRAB_LIB)
message(FATAL_ERROR "Network Monitor plugin requires libstatgrab")
endif()
list(APPEND ENABLED_PLUGINS "Network Monitor")
add_subdirectory(plugin-networkmonitor)
endif()
setByDefault(SYSSTAT_PLUGIN Yes)
if(SYSSTAT_PLUGIN)
list(APPEND ENABLED_PLUGINS "System Stats")
add_subdirectory(plugin-sysstat)
endif(SYSSTAT_PLUGIN)
setByDefault(TASKBAR_PLUGIN Yes)
if(TASKBAR_PLUGIN)
list(APPEND STATIC_PLUGINS "taskbar")
add_definitions(-DWITH_TASKBAR_PLUGIN)
list(APPEND ENABLED_PLUGINS "Taskbar")
add_subdirectory(plugin-taskbar)
endif()
setByDefault(STATUSNOTIFIER_PLUGIN Yes)
if(STATUSNOTIFIER_PLUGIN)
list(APPEND STATIC_PLUGINS "statusnotifier")
add_definitions(-DWITH_STATUSNOTIFIER_PLUGIN)
list(APPEND ENABLED_PLUGINS "Status Notifier")
add_subdirectory(plugin-statusnotifier)
endif()
setByDefault(TRAY_PLUGIN Yes)
if(TRAY_PLUGIN)
list(APPEND STATIC_PLUGINS "tray")
add_definitions(-DWITH_TRAY_PLUGIN)
list(APPEND ENABLED_PLUGINS "System Tray")
add_subdirectory(plugin-tray)
endif()
setByDefault(VOLUME_PLUGIN Yes)
setByDefault(VOLUME_USE_PULSEAUDIO Yes)
setByDefault(VOLUME_USE_ALSA Yes)
if(VOLUME_PLUGIN)
if (VOLUME_USE_PULSEAUDIO)
find_package(PulseAudio)
if (NOT PULSEAUDIO_FOUND)
message(FATAL_ERROR "PulseAudio not found, but required (VOLUME_USE_PULSEAUDIO) for Volume plugin!")
endif ()
endif(VOLUME_USE_PULSEAUDIO)
if(VOLUME_USE_ALSA)
find_package(ALSA)
if (NOT ALSA_FOUND)
message(FATAL_ERROR "ALSA not found, but required (VOLUME_USE_ALSA) for Volume plugin!")
endif ()
endif()
list(APPEND ENABLED_PLUGINS "Volume")
message(STATUS "")
message(STATUS "Volume plugin will be built")
message(STATUS " ALSA: ${ALSA_FOUND}")
message(STATUS " PulseAudio: ${PULSEAUDIO_FOUND}")
message(STATUS "")
add_subdirectory(plugin-volume)
endif()
setByDefault(WORLDCLOCK_PLUGIN Yes)
if(WORLDCLOCK_PLUGIN)
list(APPEND STATIC_PLUGINS "worldclock")
add_definitions(-DWITH_WORLDCLOCK_PLUGIN)
list(APPEND ENABLED_PLUGINS "World Clock")
add_subdirectory(plugin-worldclock)
endif(WORLDCLOCK_PLUGIN)
setByDefault(SPACER_PLUGIN Yes)
if(SPACER_PLUGIN)
list(APPEND STATIC_PLUGINS "spacer")
add_definitions(-DWITH_SPACER_PLUGIN)
list(APPEND ENABLED_PLUGINS "Spacer")
add_subdirectory(plugin-spacer)
endif()
setByDefault(BACKLIGHT_PLUGIN Yes)
if(BACKLIGHT_PLUGIN)
list(APPEND ENABLED_PLUGINS "Backlight")
add_subdirectory(plugin-backlight)
endif()
#########################################################################
message(STATUS "**************** The following plugins will be built ****************")
foreach (PLUGIN_STR ${ENABLED_PLUGINS})
message(STATUS " ${PLUGIN_STR}")
endforeach()
message(STATUS "*********************************************************************")
add_subdirectory(panel)
# merged from lxqt-common
add_subdirectory(autostart)