CMakeLists.txt 9.04 KB
Newer Older
1
cmake_minimum_required(VERSION 3.6)
2

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

7
set(QT_MIN_VERSION "5.15.0")
8
set(KF5_MIN_VERSION "5.77")
9
set(INSTALL_SDDM_THEME TRUE)
Nicolas Fella's avatar
Nicolas Fella committed
10
11
12
13

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

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

19
20
21
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

22
23
24
25
26
27
28
29
30
31
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
32
include(ECMQueryQmake)
33
include(ECMInstallIcons)
34
include(KDEPackageAppTemplates)
35
include(KDEClangFormat)
David Edmundson's avatar
David Edmundson committed
36
37
include(ECMConfiguredInstall)
include(ECMGenerateDBusServiceFile)
38
include(ECMQMLModules)
39

Hrvoje Senjan's avatar
Hrvoje Senjan committed
40
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
41
                    Plasma DocTools Runner Notifications NotifyConfig Su NewStuff Wallet
Bhushan Shah's avatar
Bhushan Shah committed
42
                    IdleTime Declarative I18n KCMUtils TextWidgets KDELibs4Support Crash GlobalAccel
43
                    DBusAddons Wayland CoreAddons People ActivitiesStats Activities KIO Prison)
44
45
find_package(KDED CONFIG REQUIRED)

46
47
48
49
50
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."
                      )
51

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

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

Hrvoje Senjan's avatar
Hrvoje Senjan committed
64
# WARNING PlasmaQuick provides unversioned CMake config
65
find_package(KUserFeedback)
Hrvoje Senjan's avatar
Hrvoje Senjan committed
66
find_package(KF5 REQUIRED COMPONENTS PlasmaQuick)
67
find_package(KSysGuard CONFIG REQUIRED)
68
find_package(KF5 REQUIRED COMPONENTS Package)
Andreas Sturmlechner's avatar
Andreas Sturmlechner committed
69
70
71
72
73
74
75

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

76
find_package(KF5TextEditor)
77
find_package(KWinDBusInterface CONFIG REQUIRED)
78

Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
79
find_package(KF5Screen CONFIG REQUIRED)
80
find_package(KScreenLocker 5.13.80 REQUIRED)
81
find_package(ScreenSaverDBusInterface CONFIG REQUIRED)
82
83
84
85
86
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."
                      )
87

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

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

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

104
105
106
107
108
109
110
111
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"
                      )


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

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

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

126
127
128
129
find_package(QtWaylandScanner REQUIRED)
find_package(PlasmaWaylandProtocols REQUIRED)
find_package(Wayland REQUIRED COMPONENTS Client)

130
if(X11_FOUND)
131
  find_package(XCB MODULE REQUIRED COMPONENTS XCB RANDR IMAGE)
132
  set_package_properties(XCB PROPERTIES TYPE REQUIRED)
133
134
135
  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)
136
137
138
139

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

Marco Martin's avatar
Marco Martin committed
140
141
142
143
if(X11_FOUND AND XCB_XCB_FOUND)
  set(HAVE_X11 1)
endif()

144
find_package(AppStreamQt 0.10.6)
145
146
147
148
149
set_package_properties(AppStreamQt PROPERTIES DESCRIPTION "Access metadata for listing available software"
                       URL "https://www.freedesktop.org/wiki/Distributions/AppStream/"
		       TYPE OPTIONAL
                      )

150
151
152
if(${AppStreamQt_FOUND})
    set(HAVE_APPSTREAMQT true)
endif()
153

154
155
156
157
158
159
160
161
# Fonts kcm and kfontinst
find_package(Freetype)
set_package_properties(Freetype PROPERTIES DESCRIPTION "A font rendering engine"
                       URL "https://www.freetype.org"
                       TYPE OPTIONAL
                       PURPOSE "Needed to build kfontinst, a simple font installer."
                      )

162
163
# Clipboard applet
ecm_find_qmlmodule(org.kde.prison 1.0)
164

165
166
167
168
169
170
171
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)
172
configure_file(config-appstream.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-appstream.h )
173
add_subdirectory(login-sessions)
174

175
plasma_install_package(lookandfeel org.kde.breeze.desktop look-and-feel lookandfeel)
176

177
if (INSTALL_SDDM_THEME)
178
179
    configure_file(sddm-theme/theme.conf.cmake ${CMAKE_CURRENT_BINARY_DIR}/sddm-theme/theme.conf)

180
181
182
# 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
183
184
185
    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)
186
187
    install(DIRECTORY lookandfeel/contents/components DESTINATION ${KDE_INSTALL_FULL_DATADIR}/sddm/themes/breeze PATTERN "README.txt" EXCLUDE)

188
189
endif()

190
191
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)

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

David Edmundson's avatar
David Edmundson committed
195
196
option(PLASMA_SYSTEMD_BOOT "Use systemd units for startup of plasma (WIP)" FALSE)

197
198
add_subdirectory(doc)
add_subdirectory(libkworkspace)
199
add_subdirectory(libdbusmenuqt)
David Edmundson's avatar
David Edmundson committed
200
add_subdirectory(appmenu)
201

Eike Hein's avatar
Eike Hein committed
202
add_subdirectory(libtaskmanager)
203
add_subdirectory(libnotificationmanager)
204
add_subdirectory(libcolorcorrect)
205
add_subdirectory(components)
206

207
add_subdirectory(plasma-windowed)
Marco Martin's avatar
Marco Martin committed
208
add_subdirectory(shell)
209
210
211
212
add_subdirectory(freespacenotifier)
add_subdirectory(klipper)
add_subdirectory(krunner)
add_subdirectory(ksmserver)
213
add_subdirectory(logout-greeter)
214
add_subdirectory(ksplash)
Vishesh Handa's avatar
Vishesh Handa committed
215
add_subdirectory(systemmonitor)
216
217
218
219
add_subdirectory(statusnotifierwatcher)
add_subdirectory(startkde)
add_subdirectory(themes)

Bhushan Shah's avatar
Bhushan Shah committed
220
221
add_subdirectory(kcms)

222
223
224
225
226
227
add_subdirectory(containmentactions)
add_subdirectory(runners)
add_subdirectory(applets)
add_subdirectory(dataengines)
add_subdirectory(wallpapers)

228
229
230
231
add_subdirectory(kioslave)
add_subdirectory(ktimezoned)
add_subdirectory(menu)
add_subdirectory(phonon)
232
233
234
235
236

# 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)
237
add_subdirectory(solidautoeject)
238
endif()
239

David Edmundson's avatar
David Edmundson committed
240
241
ecm_optional_add_subdirectory(xembed-sni-proxy)

Kai Uwe Broulik's avatar
Kai Uwe Broulik committed
242
243
ecm_optional_add_subdirectory(gmenu-dbusmenu-proxy)

244
add_subdirectory(soliduiserver)
245

246
247
248
249
if(KF5Holidays_FOUND)
    add_subdirectory(plasmacalendarintegration)
endif()

250
251
add_subdirectory(templates)

Laurent Montel's avatar
Laurent Montel committed
252
install(FILES plasma-workspace.categories   DESTINATION  ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
253
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
254
255
256
257

# 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})