-
Notifications
You must be signed in to change notification settings - Fork 17
/
CMakeLists.txt
124 lines (101 loc) · 3.91 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
cmake_minimum_required(VERSION 3.14)
project(statusbar LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Qt5 CONFIG REQUIRED Widgets DBus X11Extras Concurrent LinguistTools QuickControls2)
find_package(KF5WindowSystem REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_check_modules(XCB_LIBS REQUIRED xcb)
set(SRCS
src/main.cpp
src/statusbar.cpp
src/controlcenterdialog.cpp
src/brightness.cpp
src/battery.cpp
src/appearance.cpp
src/processprovider.cpp
src/activity.cpp
src/capplications.cpp
src/notifications.cpp
src/backgroundhelper.cpp
src/systemtray/statusnotifieritemsource.cpp
src/systemtray/systemtraytypes.cpp
src/systemtray/systemtraytypedefs.h
src/systemtray/systemtraymodel.cpp
src/systemtray/statusnotifierwatcher.cpp
src/systemtray/statusnotifieritemhost.cpp
src/libdbusmenuqt/dbusmenuimporter.cpp
src/libdbusmenuqt/dbusmenushortcut_p.cpp
src/libdbusmenuqt/dbusmenutypes_p.cpp
src/libdbusmenuqt/utils.cpp
src/appmenu/kdbusimporter.h
src/appmenu/appmenu.h
src/appmenu/appmenu.cpp
src/appmenu/appmenudbus.h
src/appmenu/appmenudbus.cpp
src/appmenu/verticalmenu.h
src/appmenu/verticalmenu.cpp
src/appmenu/menuimporter.h
src/appmenu/menuimporter.cpp
src/appmenu/appmenumodel.h
src/appmenu/appmenumodel.cpp
src/appmenu/appmenuapplet.h
src/appmenu/appmenuapplet.cpp
src/appmenu/dbusmenu_interface.cpp
src/appmenu/dbusmenu_interface.h
src/poweractions.cpp
qml.qrc
)
set(statusnotifierwatcher_xml src/systemtray/org.kde.StatusNotifierWatcher.xml)
qt5_add_dbus_interface(SRCS ${statusnotifierwatcher_xml} statusnotifierwatcher_interface)
qt5_add_dbus_interface(SRCS src/systemtray/org.freedesktop.DBus.Properties.xml dbusproperties)
set(statusnotifieritem_xml src/systemtray/org.kde.StatusNotifierItem.xml)
set_source_files_properties(${statusnotifieritem_xml} PROPERTIES
NO_NAMESPACE false
INCLUDE "src/systemtray/systemtraytypes.h"
CLASSNAME OrgKdeStatusNotifierItem
)
qt5_add_dbus_interface(SRCS ${statusnotifieritem_xml} statusnotifieritem_interface)
qt5_add_dbus_adaptor(SRCS src/systemtray/org.kde.StatusNotifierWatcher.xml
src/systemtray/statusnotifierwatcher.h StatusNotifierWatcher)
# libdbusmenuqt
set_source_files_properties(src/libdbusmenuqt/com.canonical.dbusmenu.xml PROPERTIES
NO_NAMESPACE true
INCLUDE "src/libdbusmenuqt/dbusmenutypes_p.h"
CLASSNAME DBusMenuInterface
)
# The interface was added on Qt5.15
# qt_add_dbus_interface(libdbusmenu_SRCS src/libdbusmenuqt/com.canonical.dbusmenu.xml dbusmenu_interface)
## appmenu
qt5_add_dbus_adaptor(appmenu_SRCS src/appmenu/com.canonical.AppMenu.Registrar.xml
src/appmenu/menuimporter.h MenuImporter menuimporteradaptor MenuImporterAdaptor)
qt5_add_dbus_adaptor(appmenu_SRCS src/appmenu/com.cutefish.cappmenu.xml
src/appmenu/appmenudbus.h AppmenuDBus appmenuadaptor AppmenuAdaptor)
## statusbar dbus
qt5_add_dbus_adaptor(DBUS_SOURCES
src/com.cutefish.Statusbar.xml
src/statusbar.h StatusBar)
add_executable(cutefish-statusbar ${SRCS} ${appmenu_SRCS} ${DBUS_SOURCES})
target_include_directories(cutefish-statusbar PUBLIC ${XCB_LIBS_INCLUDE_DIRS})
target_link_libraries(cutefish-statusbar
PRIVATE
Qt5::Core
Qt5::Widgets
Qt5::Quick
Qt5::QuickControls2
Qt5::X11Extras
Qt5::Concurrent
Qt5::DBus
KF5::WindowSystem
${XCB_LIBS_LIBRARIES}
)
file(GLOB TS_FILES translations/*.ts)
qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR}/src ${TS_FILES})
add_custom_target(translations DEPENDS ${QM_FILES} SOURCES ${TS_FILES})
add_dependencies(cutefish-statusbar translations)
install(TARGETS cutefish-statusbar RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ${QM_FILES} DESTINATION /usr/share/cutefish-statusbar/translations)