CMakeLists.txt 10.3 KB
Newer Older
1
cmake_minimum_required(VERSION 3.16)
2

3
project(plasma-workspace)
4
set(PROJECT_VERSION "5.23.0")
5
set(PROJECT_VERSION_MAJOR 5)
6

7
set(QT_MIN_VERSION "5.15.0")
8
set(KF5_MIN_VERSION "5.86")
9
set(KDE_COMPILERSETTINGS_LEVEL "5.82")
10
set(INSTALL_SDDM_THEME TRUE)
11
option(INSTALL_SDDM_WAYLAND_SESSION OFF)
Nicolas Fella's avatar
Nicolas Fella committed
12
13
14
15

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

16
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Svg Widgets Quick QuickWidgets Concurrent Test Network)
17
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
18
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
19
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
20

21
22
23
24
25
26
27
28
29
30
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(ECMMarkNonGuiExecutable)
include(CMakePackageConfigHelpers)
include(WriteBasicConfigVersionFile)
include(CheckIncludeFiles)
include(FeatureSummary)
include(ECMOptionalAddSubdirectory)
include(ECMQtDeclareLoggingCategory)
Nate Graham's avatar
Nate Graham committed
31
include(ECMQueryQmake)
32
include(ECMInstallIcons)
33
include(KDEClangFormat)
34
include(KDEGitCommitHooks)
David Edmundson's avatar
David Edmundson committed
35
36
include(ECMConfiguredInstall)
include(ECMGenerateDBusServiceFile)
37
include(ECMQMLModules)
Ahmad Samir's avatar
Ahmad Samir committed
38
include(ECMGenerateExportHeader)
39

Hrvoje Senjan's avatar
Hrvoje Senjan committed
40
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
Ahmad Samir's avatar
Ahmad Samir committed
41
42
43
                    Plasma DocTools Runner Notifications NotifyConfig Su NewStuff Wallet IdleTime
                    Declarative I18n KCMUtils TextWidgets Crash GlobalAccel DBusAddons Wayland
                    CoreAddons People ActivitiesStats Activities KIO Prison PlasmaQuick Package
44
                    GuiAddons Archive ItemModels IconThemes UnitConversion ItemModels Init TextEditor)
Ahmad Samir's avatar
Ahmad Samir committed
45

46
47
find_package(KDED CONFIG REQUIRED)

48
49
50
51
52
find_package(KF5NetworkManagerQt ${KF5_MIN_VERSION})
set_package_properties(KF5NetworkManagerQt PROPERTIES DESCRIPTION "Qt wrapper for NetworkManager API"
                       TYPE OPTIONAL
                       PURPOSE "Needed by geolocation data engine."
                      )
53

54
55
56
57
58
59
find_package(KF5Kirigami2 ${KF5_MIN_VERSION} CONFIG)
set_package_properties(KF5Kirigami2 PROPERTIES
    DESCRIPTION "A QtQuick based components set"
    TYPE RUNTIME
)

60
61
62
63
64
65
find_package(KF5QuickCharts ${KF5_MIN_VERSION} CONFIG)
set_package_properties(KF5QuickCharts PROPERTIES
    DESCRIPTION "Used for rendering charts"
    TYPE RUNTIME
)

66
find_package(KUserFeedback)
67
find_package(KSysGuard CONFIG REQUIRED)
Andreas Sturmlechner's avatar
Andreas Sturmlechner committed
68
69
70
71
72
73
74

find_package(KF5Baloo)
set_package_properties(KF5Baloo PROPERTIES DESCRIPTION "File Searching"
                       TYPE RECOMMENDED
                       PURPOSE "Needed for the File Search runner."
                      )

75
find_package(KWinDBusInterface CONFIG REQUIRED)
76

Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
77
find_package(KF5Screen CONFIG REQUIRED)
78
find_package(KScreenLocker 5.13.80 REQUIRED)
79
find_package(ScreenSaverDBusInterface CONFIG REQUIRED)
80
find_package(LayerShellQt CONFIG REQUIRED)
81
82
83
84
85
find_package(KF5Holidays)
set_package_properties(KF5Holidays PROPERTIES DESCRIPTION "Holidays provider for Plasma calendar"
                       TYPE OPTIONAL
                       PURPOSE "Needed to for holidays plugin for Plasma Calendar."
                      )
86

87
88
89
90
find_package(Phonon4Qt5 4.6.60 REQUIRED NO_MODULE)
set_package_properties(Phonon4Qt5 PROPERTIES
   DESCRIPTION "Qt-based audio library"
   TYPE REQUIRED)
91

92
93
94
95
96
find_package(Breeze ${PROJECT_VERSION} CONFIG)
set_package_properties(Breeze PROPERTIES
                       TYPE OPTIONAL
                       PURPOSE "For setting the default window decoration plugin")

97
98
find_package(ZLIB)
set_package_properties(ZLIB PROPERTIES DESCRIPTION "Support for gzip compressed files and data streams"
99
                       URL "https://www.zlib.net"
100
101
102
                       TYPE REQUIRED
                      )

103
104
105
106
107
108
109
110
find_package(Fontconfig)
set_package_properties(Fontconfig PROPERTIES DESCRIPTION "Font access configuration library"
                       URL "https://www.freedesktop.org/wiki/Software/fontconfig"
                       TYPE OPTIONAL
                       PURPOSE "Needed to build font configuration and installation tools"
                      )


111
112
find_package(X11)
set_package_properties(X11 PROPERTIES DESCRIPTION "X11 libraries"
113
                        URL "https://www.x.org"
114
115
116
                        TYPE OPTIONAL
                        PURPOSE "Required for building the X11 based workspace")

David Redondo's avatar
David Redondo committed
117
find_package(PkgConfig REQUIRED)
118
119
120
pkg_check_modules(PipeWire IMPORTED_TARGET libpipewire-0.3)
add_feature_info(PipeWire PipeWire_FOUND "Required for Wayland screencasting")

121
122
123
if(PipeWire_FOUND)
  find_package(Libdrm REQUIRED)
endif()
124

125
find_package(QtWaylandScanner REQUIRED)
126
127
find_package(Qt5WaylandClient)
find_package(Qt5XkbCommonSupport)
128
129
130
find_package(PlasmaWaylandProtocols REQUIRED)
find_package(Wayland REQUIRED COMPONENTS Client)

Ahmad Samir's avatar
Ahmad Samir committed
131
132
133
134
135
if(FONTCONFIG_FOUND)
  # kfontinst
  find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS PrintSupport)
endif()

136
if(X11_FOUND)
137
  find_package(XCB MODULE REQUIRED COMPONENTS XCB RANDR IMAGE)
138
  set_package_properties(XCB PROPERTIES TYPE REQUIRED)
139
140
141
  if(NOT X11_SM_FOUND)
    message(FATAL_ERROR "\nThe X11 Session Management (SM) development package could not be found.\nPlease install libSM.\n")
  endif(NOT X11_SM_FOUND)
142
143
144
145

  find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS X11Extras)
endif()

Marco Martin's avatar
Marco Martin committed
146
147
148
149
if(X11_FOUND AND XCB_XCB_FOUND)
  set(HAVE_X11 1)
endif()

150
find_package(AppStreamQt 0.10.6)
151
152
set_package_properties(AppStreamQt PROPERTIES DESCRIPTION "Access metadata for listing available software"
                       URL "https://www.freedesktop.org/wiki/Distributions/AppStream/"
Nicolas Fella's avatar
Nicolas Fella committed
153
                       TYPE OPTIONAL)
154

155
156
157
if(${AppStreamQt_FOUND})
    set(HAVE_APPSTREAMQT true)
endif()
158

159
160
161
162
163
164
165
166
167
168
find_package(PackageKitQt5)
set_package_properties(PackageKitQt5
        PROPERTIES DESCRIPTION "Software Manager integration"
        TYPE OPTIONAL
        PURPOSE "Used to install additional language packages on demand"
        )
if(PackageKitQt5_FOUND)
    set(HAVE_PACKAGEKIT TRUE)
endif()

169
170
171
172
173
174
175
176
177
178
179
180

find_package(KIOExtras)
set_package_properties(KIOExtras PROPERTIES DESCRIPTION "Common KIO slaves for operations."
                                       PURPOSE "Show thumbnails in wallpaper selection."
                                       TYPE RUNTIME
                                        )

find_package(KIOFuse)
set_package_properties(KIOFuse PROPERTIES DESCRIPTION "Provide KIO support to legacy applications. "
                                      TYPE RUNTIME
                                      )

181
182
# Clipboard applet
ecm_find_qmlmodule(org.kde.prison 1.0)
183

184
185
186
187
188
189
190
include(ConfigureChecks.cmake)

include_directories("${CMAKE_CURRENT_BINARY_DIR}")

configure_file(config-workspace.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-workspace.h)
configure_file(config-unix.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-unix.h )
configure_file(config-X11.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-X11.h)
191
configure_file(config-appstream.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-appstream.h )
192
add_subdirectory(login-sessions)
193

194
plasma_install_package(lookandfeel org.kde.breeze.desktop look-and-feel lookandfeel)
195
196
197
plasma_install_package(lookandfeel.dark org.kde.breezedark.desktop look-and-feel lookandfeel)
plasma_install_package(lookandfeel.twilight org.kde.breezetwilight.desktop look-and-feel lookandfeel)

198

199
if (INSTALL_SDDM_THEME)
200
201
    configure_file(sddm-theme/theme.conf.cmake ${CMAKE_CURRENT_BINARY_DIR}/sddm-theme/theme.conf)

202
203
204
# Install the login theme into the SDDM directory
# Longer term we need to look at making SDDM load from look and feel somehow.. and allow copying at runtime
    #NOTE this trailing slash is important to rename the directory
205
206
207
    install(DIRECTORY sddm-theme/ DESTINATION ${KDE_INSTALL_FULL_DATADIR}/sddm/themes/breeze PATTERN "README.txt" EXCLUDE PATTERN "components" EXCLUDE PATTERN "dummydata" EXCLUDE
    PATTERN "theme.conf.cmake" EXCLUDE)
    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/sddm-theme/theme.conf DESTINATION ${KDE_INSTALL_FULL_DATADIR}/sddm/themes/breeze)
208
    install(DIRECTORY lookandfeel/contents/components DESTINATION ${KDE_INSTALL_FULL_DATADIR}/sddm/themes/breeze PATTERN "README.txt" EXCLUDE)
209
endif()
210

211
212
213
214
if (INSTALL_SDDM_WAYLAND_SESSION)
    install(FILES sddm-wayland-session/plasma-wayland.conf DESTINATION /etc/sddm.conf.d)
else()
    message(STATUS "INSTALL_SDDM_WAYLAND_SESSION is disabled. As soon as it's installed, SDDM will default to use Wayland and KWin for its greeter session (BETA, do not deploy to final users yet).")
215
216
endif()

217
218
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)

Nate Graham's avatar
Nate Graham committed
219
220
221
# locate qdbus in the Qt path because not every distro makes a symlink at /usr/bin/qdbus
query_qmake(QtBinariesDir QT_INSTALL_BINS)

222
option(PLASMA_WAYLAND_DEFAULT_SESSION "Use Wayland session by default for Plasma" FALSE)
David Edmundson's avatar
David Edmundson committed
223

224
225
add_subdirectory(doc)
add_subdirectory(libkworkspace)
226
add_subdirectory(libdbusmenuqt)
David Edmundson's avatar
David Edmundson committed
227
add_subdirectory(appmenu)
228

Eike Hein's avatar
Eike Hein committed
229
add_subdirectory(libtaskmanager)
230
add_subdirectory(libnotificationmanager)
231
add_subdirectory(libcolorcorrect)
232
add_subdirectory(components)
233

234
add_subdirectory(plasma-windowed)
Marco Martin's avatar
Marco Martin committed
235
add_subdirectory(shell)
236
237
238
239
add_subdirectory(freespacenotifier)
add_subdirectory(klipper)
add_subdirectory(krunner)
add_subdirectory(ksmserver)
240
add_subdirectory(logout-greeter)
241
add_subdirectory(ksplash)
Vishesh Handa's avatar
Vishesh Handa committed
242
add_subdirectory(systemmonitor)
243
244
245
246
add_subdirectory(statusnotifierwatcher)
add_subdirectory(startkde)
add_subdirectory(themes)

Bhushan Shah's avatar
Bhushan Shah committed
247
248
add_subdirectory(kcms)

249
250
251
252
253
254
add_subdirectory(containmentactions)
add_subdirectory(runners)
add_subdirectory(applets)
add_subdirectory(dataengines)
add_subdirectory(wallpapers)

255
256
257
258
add_subdirectory(kioslave)
add_subdirectory(ktimezoned)
add_subdirectory(menu)
add_subdirectory(phonon)
259

260
261
add_subdirectory(interactiveconsole)

262
263
264
265
# This ensures pressing the eject button on a CD drive ejects the disc
# It listens to the Solid::OpticalDrive::ejectPressed signal that is only
# supported by Solid in the HAL backend and does nothing with UDev
if(CMAKE_SYSTEM_NAME MATCHES FreeBSD)
266
add_subdirectory(solidautoeject)
267
endif()
268

David Edmundson's avatar
David Edmundson committed
269
270
ecm_optional_add_subdirectory(xembed-sni-proxy)

Kai Uwe Broulik's avatar
Kai Uwe Broulik committed
271
272
ecm_optional_add_subdirectory(gmenu-dbusmenu-proxy)

273
add_subdirectory(soliduiserver)
274

275
276
277
278
if(KF5Holidays_FOUND)
    add_subdirectory(plasmacalendarintegration)
endif()

279
280
ki18n_install(po)

Laurent Montel's avatar
Laurent Montel committed
281
install(FILES plasma-workspace.categories   DESTINATION  ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
282
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
283
284
285
286

# add clang-format target for all our real source files
file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h)
kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
287
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)