Changeset View
Changeset View
Standalone View
Standalone View
kcms/keyboard/CMakeLists.txt
1 | add_definitions(-DTRANSLATION_DOMAIN=\"kcmkeyboard\") | 1 | add_subdirectory(layoutmodel) | ||
---|---|---|---|---|---|
2 | 2 | add_subdirectory(kcmui) | |||
3 | option(HAVE_XINPUT "X11 XInput" OFF) | 3 | add_subdirectory(daemon) | ||
4 | option(HAVE_UDEV "UDev" OFF) | | |||
5 | option(NEW_GEOMETRY "Keyboard geometry preview" OFF) | | |||
6 | | ||||
7 | if (X11_Xinput_FOUND) | | |||
8 | set(HAVE_XINPUT ON) | | |||
9 | elseif (UDEV_FOUND) | | |||
10 | set(HAVE_UDEV ON) | | |||
11 | else() | | |||
12 | message(STATUS "X11 XInput and UDev is not found, either is required to keep layouts with keyboard hotplugging") | | |||
13 | endif() | | |||
14 | | ||||
15 | | ||||
16 | ### kded daemon ### | | |||
17 | | ||||
18 | set( kded_keyboard_SRCS | | |||
19 | keyboard_daemon.cpp | | |||
20 | layout_memory.cpp | | |||
21 | layout_memory_persister.cpp | | |||
22 | udev_helper.cpp | | |||
23 | x11_helper.cpp | | |||
24 | xinput_helper.cpp | | |||
25 | xkb_helper.cpp | | |||
26 | keyboard_config.cpp | | |||
27 | keyboard_hardware.cpp | | |||
28 | bindings.cpp | | |||
29 | # next are temporary for sys tray UI | | |||
30 | layout_tray_icon.cpp | | |||
31 | layouts_menu.cpp | | |||
32 | flags.cpp | | |||
33 | xkb_rules.cpp | | |||
34 | ) | | |||
35 | | ||||
36 | ecm_qt_declare_logging_category(kded_keyboard_SRCS | | |||
37 | HEADER debug.h | | |||
38 | IDENTIFIER KCM_KEYBOARD | | |||
39 | CATEGORY_NAME org.kde.kcm_keyboard | | |||
40 | DEFAULT_SEVERITY Warning) | | |||
41 | | ||||
42 | | ||||
43 | include_directories(${CMAKE_CURRENT_BINARY_DIR}) | | |||
44 | add_library(kded_keyboard MODULE ${kded_keyboard_SRCS}) | | |||
45 | set_target_properties(kded_keyboard PROPERTIES OUTPUT_NAME keyboard) | | |||
46 | kcoreaddons_desktop_to_json(kded_keyboard keyboard.desktop SERVICE_TYPES kdedmodule.desktop) | | |||
47 | | ||||
48 | target_link_libraries(kded_keyboard | | |||
49 | Qt5::Concurrent | | |||
50 | Qt5::Widgets | | |||
51 | Qt5::X11Extras | | |||
52 | Qt5::Xml | | |||
53 | KF5::ConfigCore | | |||
54 | KF5::CoreAddons | | |||
55 | KF5::DBusAddons | | |||
56 | KF5::GlobalAccel | | |||
57 | KF5::I18n | | |||
58 | KF5::Notifications | | |||
59 | KF5::Service | | |||
60 | KF5::WindowSystem | | |||
61 | KF5::Plasma | | |||
62 | KF5::XmlGui | | |||
63 | KF5::GuiAddons | | |||
64 | KF5::IconThemes | | |||
65 | XCB::XCB | | |||
66 | XCB::XKB | | |||
67 | ${X11_LIBRARIES} | | |||
68 | ${X11_Xkbfile_LIB} | | |||
69 | ) | | |||
70 | | ||||
71 | if (HAVE_XINPUT) | | |||
72 | target_link_libraries(kded_keyboard ${X11_Xinput_LIB}) | | |||
73 | endif() | | |||
74 | | ||||
75 | if (HAVE_UDEV) | | |||
76 | target_link_libraries(kded_keyboard ${UDEV_LIBS}) | | |||
77 | endif() | | |||
78 | | ||||
79 | install( TARGETS kded_keyboard DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf5/kded ) | | |||
80 | | ||||
81 | ### kcm keyboard ### | | |||
82 | include_directories("preview") | | |||
83 | | ||||
84 | find_package(Boost) | | |||
85 | | ||||
86 | if(Boost_FOUND) | | |||
87 | set(NEW_GEOMETRY ON) | | |||
88 | | ||||
89 | set(preview_SRCS | | |||
90 | preview/geometry_components.cpp | | |||
91 | preview/geometry_parser.cpp | | |||
92 | preview/kbpreviewframe.cpp | | |||
93 | preview/keyboardlayout.cpp | | |||
94 | preview/symbol_parser.cpp | | |||
95 | preview/keyaliases.cpp | | |||
96 | preview/keyboardlayout.cpp | | |||
97 | preview/keyboardpainter.cpp | | |||
98 | preview/keysymhelper.cpp | | |||
99 | preview/keysym2ucs.cpp | | |||
100 | ) | | |||
101 | | ||||
102 | set_source_files_properties(preview/geometry_parser.cpp preview/symbol_parser.cpp PROPERTIES COMPILE_FLAGS "-fexceptions") | | |||
103 | if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") | | |||
104 | # the default maximum template expansion depth (256) is not enough | | |||
105 | set_property(SOURCE preview/geometry_parser.cpp APPEND_STRING PROPERTY COMPILE_FLAGS " -ftemplate-depth=512") | | |||
106 | endif() | | |||
107 | else(Boost_FOUND) | | |||
108 | | ||||
109 | message("Boost not found, install Boost libraries to enable keyboard geometry preview") | | |||
110 | | ||||
111 | endif(Boost_FOUND) | | |||
112 | | ||||
113 | | ||||
114 | set(kcm_keyboard_PART_SRCS | | |||
115 | kcm_keyboard.cpp | | |||
116 | kcm_keyboard_widget.cpp | | |||
117 | kcm_view_models.cpp | | |||
118 | kcm_add_layout_dialog.cpp | | |||
119 | keyboard_config.cpp | | |||
120 | x11_helper.cpp | | |||
121 | xkb_helper.cpp | | |||
122 | xkb_rules.cpp | | |||
123 | flags.cpp | | |||
124 | iso_codes.cpp | | |||
125 | kcmmisc.cpp | | |||
126 | bindings.cpp | | |||
127 | ${preview_SRCS} ) | | |||
128 | | ||||
129 | ecm_qt_declare_logging_category(kcm_keyboard_PART_SRCS | | |||
130 | HEADER debug.h | | |||
131 | IDENTIFIER KCM_KEYBOARD | | |||
132 | CATEGORY_NAME org.kde.kcm_keyboard | | |||
133 | DEFAULT_SEVERITY Warning) | | |||
134 | | ||||
135 | ki18n_wrap_ui(kcm_keyboard_PART_SRCS kcm_keyboard.ui kcm_add_layout_dialog.ui kcmmiscwidget.ui) | | |||
136 | | ||||
137 | add_library(kcm_keyboard MODULE ${kcm_keyboard_PART_SRCS}) | | |||
138 | | ||||
139 | target_link_libraries(kcm_keyboard | | |||
140 | Qt5::Concurrent | | |||
141 | Qt5::Widgets | | |||
142 | Qt5::X11Extras | | |||
143 | Qt5::Xml | | |||
144 | KF5::KCMUtils | | |||
145 | KF5::GlobalAccel | | |||
146 | KF5::I18n | | |||
147 | KF5::KIOCore | | |||
148 | KF5::KIOWidgets | | |||
149 | KF5::WindowSystem | | |||
150 | KF5::Plasma | | |||
151 | KF5::XmlGui | | |||
152 | KF5::GuiAddons | | |||
153 | KF5::IconThemes | | |||
154 | XCB::XCB | | |||
155 | XCB::XKB | | |||
156 | ${X11_Xkbfile_LIB} | | |||
157 | ${X11_LIBRARIES} | | |||
158 | ${text_paint_LIB} | | |||
159 | ) | | |||
160 | | ||||
161 | install(TARGETS kcm_keyboard DESTINATION ${KDE_INSTALL_PLUGINDIR} ) | | |||
162 | | ||||
163 | install( FILES kcm_keyboard.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR} ) | | |||
164 | | ||||
165 | # Images | | |||
166 | | ||||
167 | add_subdirectory( pics ) | | |||
168 | | ||||
169 | configure_file(config-keyboard.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-keyboard.h) | | |||
170 | | ||||
171 | # Unit tests | | |||
172 | if(BUILD_TESTING) | | |||
173 | find_package(Qt5Test ${QT_MIN_VERSION} CONFIG REQUIRED) | | |||
174 | add_subdirectory( tests ) | | |||
175 | endif() | |