-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
CMakeLists.txt
117 lines (98 loc) · 3.05 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
cmake_minimum_required(VERSION 3.16)
project(PowerDevil)
set(PROJECT_VERSION "6.2.80")
set(PROJECT_VERSION_MAJOR 6)
set(PROJECT_DEP_VERSION "6.2.0")
set(QT_MIN_VERSION "6.7.0")
set(KF6_MIN_VERSION "6.5.0")
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_CURRENT_SOURCE_DIR}/cmake)
include(ECMSetupVersion)
include(ECMQtDeclareLoggingCategory)
include(ECMConfiguredInstall)
include(ECMGenerateDBusServiceFile)
include(FeatureSummary)
include(GenerateExportHeader)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(KDEClangFormat)
include(KDEGitCommitHooks)
include(ECMDeprecationSettings)
include(ECMQmlModule)
find_package(Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Widgets DBus)
find_package(QCoro6 REQUIRED COMPONENTS Core DBus)
find_package(KF6 ${KF6_MIN_VERSION} REQUIRED COMPONENTS
Auth
Config
Crash
DBusAddons
DocTools
I18n
IdleTime
ItemModels
GlobalAccel
KIO
Kirigami2
KCMUtils
Notifications
Runner
Solid
WindowSystem
XmlGui
)
find_package(Plasma ${PROJECT_DEP_VERSION} REQUIRED)
find_package(PlasmaActivities ${PROJECT_DEP_VERSION} REQUIRED)
find_package(KF6Screen CONFIG REQUIRED)
find_package(LibKWorkspace ${PROJECT_DEP_VERSION} REQUIRED)
find_package(UDev REQUIRED)
find_package(XCB REQUIRED COMPONENTS XCB RANDR DPMS)
find_package(Libcap)
set_package_properties(Libcap PROPERTIES
TYPE OPTIONAL
PURPOSE "Needed for scheduled wakeup which can wake from suspend (CAP_WAKE_ALARM)"
)
set(HAVE_LIBCAP ${Libcap_FOUND})
find_package(DDCUtil)
if(DDCUtil_FOUND)
add_definitions(-DWITH_DDCUTIL)
set_package_properties(DDCUtil
PROPERTIES DESCRIPTION "DDCUtil library support"
TYPE OPTIONAL
PURPOSE "Set monitor settings over DDC/CI channel"
)
endif()
find_package(Qt6WaylandClient COMPONENTS Private)
find_package(PlasmaWaylandProtocols 1.13 REQUIRED)
find_package(Wayland REQUIRED COMPONENTS Client)
include_directories (
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/daemon
)
ecm_setup_version(${PROJECT_VERSION} VARIABLE_PREFIX POWERDEVIL
VERSION_HEADER "${CMAKE_BINARY_DIR}/powerdevil_version.h"
)
ecm_set_disabled_deprecation_versions(QT 5.15.2
KF 5.101
)
add_subdirectory(applets)
add_subdirectory(daemon)
add_subdirectory(kcmodule)
add_subdirectory(doc)
kdoctools_install(po)
add_subdirectory(runners)
add_subdirectory(autotests)
ecm_qt_install_logging_categories(
EXPORT POWERDEVIL
FILE powerdevil.categories
DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
)
install( FILES powerdevil.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFYRCDIR} )
# 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)
ki18n_install(po)
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)