CMakeLists.txt 6.69 KB
Newer Older
1
2
cmake_minimum_required(VERSION 3.0)

3
project(plasma-desktop)
Marco Martin's avatar
Marco Martin committed
4

5
set(PROJECT_VERSION "5.19.80")
6
set(PROJECT_VERSION_MAJOR 5)
7

8
set(QT_MIN_VERSION "5.12.0")
9
set(KF5_MIN_VERSION "5.73.0")
10
set(ACCOUNTSQT_DEP_VERSION "1.13")
11

12
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
13
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
14
15
16

include(KDEInstallDirs)
include(KDECMakeSettings)
17
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
18
include(ECMInstallIcons)
19
20
include(ECMMarkAsTest)
include(ECMMarkNonGuiExecutable)
21
include(ECMOptionalAddSubdirectory)
22
include(ECMQtDeclareLoggingCategory)
23
24
include(FeatureSummary)
include(CheckIncludeFiles)
25
include(KDEClangFormat)
26
27
28

find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
    Quick
Marco Martin's avatar
Marco Martin committed
29
    QuickWidgets
30
31
32
    DBus
    Widgets
    X11Extras
33
    Svg
34
35
36
    Concurrent
)

37
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
Hrvoje Senjan's avatar
Hrvoje Senjan committed
38
    Auth
39
    Plasma
40
    PlasmaQuick
41
42
43
44
    DocTools
    I18n
    KCMUtils
    NewStuff
45
    NewStuffQuick
Hrvoje Senjan's avatar
Hrvoje Senjan committed
46
    KDELibs4Support
47
    Notifications
48
    NotifyConfig
49
    Attica
50
    Runner
Hrvoje Senjan's avatar
Hrvoje Senjan committed
51
    GlobalAccel
52
    Declarative
Marco Martin's avatar
Marco Martin committed
53
    DBusAddons
54
    Activities
55
    ActivitiesStats
56
    Config
57
    WidgetsAddons
58
59
)

60
61
62
63
64
65
66
67
68
69
70
find_package(AccountsQt5 ${ACCOUNTSQT_DEP_VERSION} CONFIG)
set_package_properties(AccountsQt5 PROPERTIES DESCRIPTION "Accounts management library for Qt applications"
   URL "https://gitlab.com/accounts-sso/libaccounts-qt"
   TYPE REQUIRED
   PURPOSE "Required for building the OpenDesktop integration plugin")

find_package(KAccounts REQUIRED)
set_package_properties(KAccounts PROPERTIES DESCRIPTION "Accounts management library for KDE applications"
   TYPE REQUIRED
   PURPOSE "Required for building the OpenDesktop integration plugin")

71
72
73
74
75
76
77
find_package(KF5Kirigami2 ${KF5_MIN_VERSION} CONFIG)
set_package_properties(KF5Kirigami2 PROPERTIES
    DESCRIPTION "A QtQuick based components set"
    PURPOSE "Required at runtime by many KCMs"
    TYPE RUNTIME
)

78
79
find_package(KF5QQC2DesktopStyle ${KF5_MIN_VERSION} CONFIG)
set_package_properties(KF5QQC2DesktopStyle PROPERTIES
80
81
82
83
84
    DESCRIPTION "QtQuickControls 2 style that uses QWidget's QStyle for painting"
    PURPOSE "Required at runtime by many KCMs"
    TYPE RUNTIME
)

85
86
87
88
find_package(LibKWorkspace ${PROJECT_VERSION} CONFIG REQUIRED)
find_package(LibNotificationManager ${PROJECT_VERSION} CONFIG REQUIRED)
find_package(LibTaskManager ${PROJECT_VERSION} CONFIG REQUIRED)
find_package(LibColorCorrect ${PROJECT_VERSION} CONFIG REQUIRED)
89
90
91
92
find_package(KWinDBusInterface CONFIG REQUIRED)
find_package(ScreenSaverDBusInterface CONFIG REQUIRED)
find_package(KRunnerAppDBusInterface CONFIG REQUIRED)
find_package(KSMServerDBusInterface CONFIG REQUIRED)
93
find_package(KF5ItemModels CONFIG REQUIRED)
94
find_package(KSysGuard CONFIG REQUIRED)
95
find_package(KDED CONFIG REQUIRED)
96

Laurent Montel's avatar
Laurent Montel committed
97
find_package(KF5Baloo ${KF5_MIN_VERSION})
98
set_package_properties(KF5Baloo PROPERTIES DESCRIPTION "File Searching"
Andreas Sturmlechner's avatar
Andreas Sturmlechner committed
99
100
                       TYPE RECOMMENDED
                       PURPOSE "Needed to build the File Search KCM"
101
102
                      )

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

find_package(X11)
set_package_properties(X11 PROPERTIES DESCRIPTION "X11 libraries"
112
                        URL "https://www.x.org"
113
                        TYPE REQUIRED
114
115
                        PURPOSE "Required for building the X11 based workspace"
                      )
116
117
118
if(X11_FOUND)
  set(HAVE_X11 1)
endif()
119

120
121
find_package(UDev)
set_package_properties(UDev PROPERTIES DESCRIPTION "UDev library"
122
                        URL "https://www.freedesktop.org/wiki/Software/systemd/"
123
124
125
126
                        TYPE OPTIONAL
                        PURPOSE "Required for device discovery in keyboard daemon"
                      )

127
find_package(XCB
128
129
130
    REQUIRED COMPONENTS
        XCB SHM IMAGE
    OPTIONAL_COMPONENTS
131
        XKB XINPUT
132
)
Bhushan Shah's avatar
Bhushan Shah committed
133

134
135
136
set_package_properties(XCB PROPERTIES TYPE REQUIRED)
add_feature_info("XCB-XKB" XCB_XKB_FOUND "Required for building kcm/keyboard")
add_feature_info("libxft" X11_Xft_FOUND "X FreeType interface library required for font installation")
137

Yue Liu's avatar
Yue Liu committed
138
139
find_package(Evdev)
set_package_properties(Evdev PROPERTIES TYPE OPTIONAL)
140
add_feature_info("Evdev" EVDEV_FOUND "Evdev driver headers needed for mouse KCM")
Yue Liu's avatar
Yue Liu committed
141

142
143
144
find_package(Synaptics)
set_package_properties(Synaptics PROPERTIES TYPE OPTIONAL)
add_feature_info("Synaptics" SYNAPTICS_FOUND "Synaptics libraries needed for touchpad KCM")
145

146
147
148
149
find_package(XorgServer)
set_package_properties(XorgServer PROPERTIES TYPE OPTIONAL)
add_feature_info("XorgServer" XORGSERVER_FOUND "XServer header needed for touchpad KCM (X11 backend)")

150
151
find_package(XorgLibinput)
set_package_properties(XorgLibinput PROPERTIES TYPE OPTIONAL)
152
153
154
155
156
add_feature_info("XorgLibinput" XORGLIBINPUT_FOUND "Libinput driver headers needed for mouse and touchpad KCM")

if(XORGLIBINPUT_FOUND)
  set(HAVE_XORGLIBINPUT 1)
endif()
157

158
159
include(ConfigureChecks.cmake)

160
161
162
163
164
165
166
167
168
169
170
171
172
173
find_package(Breeze ${PROJECT_VERSION} CONFIG)
set_package_properties(Breeze PROPERTIES
                       TYPE OPTIONAL
                       PURPOSE "For setting the default window decoration plugin")
if(${Breeze_FOUND})
    if(${BREEZE_WITH_KDECORATION})
        set(HAVE_BREEZE_DECO true)
    else()
        set(HAVE_BREEZE_DECO FALSE)
    endif()
else()
    set(HAVE_BREEZE_DECO FALSE)
endif()

174
175
include_directories("${CMAKE_CURRENT_BINARY_DIR}")

176
177
178
179
180
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)
configure_file(config-runtime.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-runtime.h)

181
plasma_install_package(desktoppackage org.kde.plasma.desktop shells shell)
182

183
184
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)

185
186
add_subdirectory(layout-templates)

187
add_subdirectory(doc)
188
add_subdirectory(runners)
189
190
191
192
add_subdirectory(containments)
add_subdirectory(toolboxes)
add_subdirectory(applets)
add_subdirectory(kcms)
193
add_subdirectory(knetattach)
194
add_subdirectory(attica-kde)
195
add_subdirectory(imports/activitymanager/)
196
add_subdirectory(solid-device-automounter)
197
198
199
if(X11_Xkb_FOUND AND XCB_XKB_FOUND)
    add_subdirectory(kaccess)
endif()
Jonathan Riddell's avatar
Jonathan Riddell committed
200
install(FILES org.kde.plasmashell.metainfo.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
Nicolas Fella's avatar
Nicolas Fella committed
201

202
203
204
205
# 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})

206
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)