-
-
Notifications
You must be signed in to change notification settings - Fork 27
/
CMakeLists.txt
140 lines (114 loc) · 4.94 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
cmake_minimum_required(VERSION 3.16)
project(discover)
set(PROJECT_VERSION "6.2.80")
set(PROJECT_VERSION_MAJOR 6)
set(QT_MIN_VERSION "6.7.0")
set(KF6_MIN_VERSION "6.5.0")
set(KDE_COMPILERSETTINGS_LEVEL "5.85")
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(ECM ${KF6_MIN_VERSION} REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(ECMInstallIcons)
include(ECMMarkAsTest)
include(ECMAddTests)
include(GenerateExportHeader)
include(ECMQtDeclareLoggingCategory)
include(KDEClangFormat)
include(KDEGitCommitHooks)
include(ECMFindQmlModule)
find_package(Qt6 ${QT_MIN_VERSION} REQUIRED CONFIG COMPONENTS Widgets Test Network Concurrent DBus Quick QuickControls2)
find_package(Qt6 ${QT_MIN_VERSION} CONFIG OPTIONAL_COMPONENTS WebView)
find_package(PkgConfig REQUIRED)
find_package(KF6 ${KF6_MIN_VERSION} REQUIRED Kirigami CoreAddons Config Crash DBusAddons I18n Archive XmlGui KIO KCMUtils IdleTime Notifications Purpose Auth StatusNotifierItem IconThemes)
find_package(KF6 ${KF6_MIN_VERSION} OPTIONAL_COMPONENTS UserFeedback)
find_package(packagekitqt6 1.0.1 CONFIG)
find_package(AppStreamQt 1.0 CONFIG REQUIRED)
find_package(KF6Attica 5.23 CONFIG)
find_package(KF6NewStuff 5.53 CONFIG)
find_package(KF${QT_MAJOR_VERSION}KirigamiAddons REQUIRED)
set_package_properties(KF${QT_MAJOR_VERSION}KirigamiAddons PROPERTIES
TYPE REQUIRED
PURPOSE "Provides additional visual components"
)
pkg_check_modules(Flatpak IMPORTED_TARGET flatpak>=0.11.8)
pkg_check_modules(Fwupd IMPORTED_TARGET fwupd>=1.9.4)
pkg_check_modules(Markdown IMPORTED_TARGET libmarkdown)
if(Markdown_FOUND AND Markdown_VERSION VERSION_GREATER_EQUAL 3)
add_definitions(-DMARKDOWN3)
endif()
pkg_check_modules(Ostree IMPORTED_TARGET ostree-1)
pkg_check_modules(RpmOstree IMPORTED_TARGET rpm-ostree-1)
find_package(QCoro6 REQUIRED COMPONENTS Core)
qcoro_enable_coroutines()
ecm_find_qmlmodule(org.kde.kitemmodels 1.0 REQUIRED)
list(APPEND CMAKE_AUTOMOC_MACRO_NAMES "DISCOVER_BACKEND_PLUGIN")
add_definitions(-DQT_NO_SIGNALS_SLOTS_KEYWORDS -DQT_NO_URL_CAST_FROM_STRING)
configure_file(DiscoverVersion.h.in DiscoverVersion.h)
if(BUILD_TESTING AND CMAKE_SYSTEM_NAME MATCHES "Linux")
add_subdirectory(appiumtests)
endif()
add_subdirectory(libdiscover)
add_subdirectory(discover)
add_subdirectory(exporter)
add_subdirectory(update)
option(WITH_KCM "Build and install the updates KCM" ON)
if(WITH_KCM)
add_subdirectory(kcm)
endif()
option(WITH_NOTIFIER "Build and install the notifier plasmoid" ON)
if(WITH_NOTIFIER)
add_subdirectory(notifier)
endif()
set_package_properties(KF6Attica PROPERTIES
DESCRIPTION "KDE Framework that implements the Open Collaboration Services API"
PURPOSE "Required to build the KNewStuff3 backend"
TYPE OPTIONAL)
set_package_properties(KF6Kirigami2 PROPERTIES
DESCRIPTION "KDE's lightweight user interface framework for mobile and convergent applications"
URL "https://techbase.kde.org/Kirigami"
PURPOSE "Required by discover qml components"
TYPE RUNTIME)
set_package_properties(KF6NewStuff PROPERTIES
DESCRIPTION "Qt library that allows to interact with KNewStuff implementations"
PURPOSE "Required to build the KNS backend"
TYPE OPTIONAL)
set_package_properties(KF6UserFeedback PROPERTIES
DESCRIPTION "Framework for collecting feedback from application users via telemetry and targeted surveys"
URL "https://invent.kde.org/frameworks/kuserfeedback"
PURPOSE "Required for submission of telemetry data"
TYPE OPTIONAL)
set_package_properties(packagekitqt6 PROPERTIES
DESCRIPTION "Library that exposes PackageKit resources"
URL "https://www.freedesktop.org/software/PackageKit/"
PURPOSE "Required to build the PackageKit backend"
TYPE OPTIONAL)
set_package_properties(AppStreamQt PROPERTIES
DESCRIPTION "Library that lists Appstream resources"
URL "https://www.freedesktop.org"
PURPOSE "Required to build the PackageKit, Flatpak and Snap backends"
TYPE OPTIONAL)
add_feature_info(Flatpak Flatpak_FOUND
"Library that exposes flatpak repositories. Required to build the Flatpak backend"
)
add_feature_info(Fwupd Fwupd_FOUND "Exposes fwupd")
add_feature_info(Ostree Ostree_FOUND
"Library to manage ostree repository. Required to build the rpm-ostree backend"
)
add_feature_info(RpmOstree RpmOstree_FOUND
"rpm-ostree binary to manage the system. Required to build the rpm-ostree backend"
)
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
# 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})
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
ecm_qt_install_logging_categories(
EXPORT DISCOVER
FILE discover.categories
DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
)
ki18n_install(po)