-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
81 lines (64 loc) · 2.1 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
cmake_minimum_required(VERSION 3.20)
# Project info
project(HeadsetKontrol VERSION 2.0.4 LANGUAGES CXX)
set(QT6_MIN_VERSION "6.5.0")
set(KF6_MIN_VERSION "6.0.0")
set(KIRIGAMI_ADDONS_MIN_VERSION "1.3.0")
# Standard KDE project config
find_package(ECM 6.0.0 REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(ECMSetupVersion)
include(ECMFindQmlModule)
include(ECMQmlModule)
include(ECMPoQmTools)
include(ECMInstallIcons)
ecm_setup_version(${PROJECT_VERSION}
VARIABLE_PREFIX HEADSETKONTROL
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/src/headsetkontrolversion.h"
)
find_package(Qt6 ${QT6_MIN_VERSION} REQUIRED COMPONENTS
Core
Gui
Quick
Qml
QuickControls2
Widgets
DBus
)
find_package(KF6 ${KF6_MIN_VERSION} REQUIRED COMPONENTS
Kirigami
I18n
CoreAddons
Config
DBusAddons
Notifications
IconThemes
StatusNotifierItem
NotifyConfig
)
find_package(KF6 1.3.0 REQUIRED COMPONENTS KirigamiAddons)
qt_policy(SET QTP0001 NEW)
ecm_find_qmlmodule(org.kde.kirigami ${KF6_MIN_VERSION})
ecm_find_qmlmodule(org.kde.kirigamiaddons.settings ${KIRIGAMI_ADDONS_MIN_VERSION})
ecm_find_qmlmodule(org.kde.kirigamiaddons.formcard ${KIRIGAMI_ADDONS_MIN_VERSION})
ecm_find_qmlmodule(org.kde.kirigamiaddons.statefulapp ${KIRIGAMI_ADDONS_MIN_VERSION})
# Subdir to sources
add_subdirectory(src)
## Source formating
include(KDEClangFormat)
file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h *.hpp *.c)
kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
include(KDEGitCommitHooks)
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
include(FeatureSummary)
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
# Build translation
add_subdirectory(translation)
# Install rules
install(PROGRAMS headsetkontrol.desktop DESTINATION ${KDE_INSTALL_APPDIR})
install(FILES headsetkontrol.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFYRCDIR})
file(GLOB_RECURSE ICON_FILES *.svg)
ecm_install_icons(ICONS ${ICON_FILES} DESTINATION ${KDE_INSTALL_ICONDIR})