|
Added
Link Here
|
| 1 |
--- Telegram/lib_ui/CMakeLists.txt.orig 2022-04-20 07:41:10 UTC |
| 2 |
+++ Telegram/lib_ui/CMakeLists.txt |
| 3 |
@@ -4,6 +4,13 @@ |
| 4 |
# For license and copyright information please follow this link: |
| 5 |
# https://github.com/desktop-app/legal/blob/master/LEGAL |
| 6 |
|
| 7 |
+if (NOT DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION AND NOT DESKTOP_APP_QT6) |
| 8 |
+ find_package(ECM REQUIRED) |
| 9 |
+ set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) |
| 10 |
+ find_package(QtWaylandScanner REQUIRED) |
| 11 |
+ find_package(WaylandProtocols) |
| 12 |
+endif() |
| 13 |
+ |
| 14 |
add_library(lib_ui STATIC) |
| 15 |
add_library(desktop-app::lib_ui ALIAS lib_ui) |
| 16 |
init_target(lib_ui) |
| 17 |
@@ -20,6 +27,12 @@ set(style_files |
| 18 |
ui/widgets/widgets.style |
| 19 |
) |
| 20 |
|
| 21 |
+if (WaylandProtocols_FOUND) |
| 22 |
+ set(wayland_protocols_loc ${WaylandProtocols_DATADIR}) |
| 23 |
+else() |
| 24 |
+ set(wayland_protocols_loc ${third_party_loc}/wayland-protocols) |
| 25 |
+endif() |
| 26 |
+ |
| 27 |
generate_palette(lib_ui ui/colors.palette) |
| 28 |
generate_styles(lib_ui ${src_loc} "${style_files}" ui/colors.palette) |
| 29 |
generate_emoji(lib_ui emoji.txt emoji_suggestions/emoji_autocomplete.json) |
| 30 |
@@ -273,10 +286,16 @@ elseif(LINUX) |
| 31 |
if (DESKTOP_APP_QT6) |
| 32 |
qt6_generate_wayland_protocol_client_sources(lib_ui |
| 33 |
FILES |
| 34 |
- ${third_party_loc}/wayland-protocols/stable/xdg-shell/xdg-shell.xml |
| 35 |
+ ${wayland_protocols_loc}/stable/xdg-shell/xdg-shell.xml |
| 36 |
) |
| 37 |
else() |
| 38 |
- message(FATAL_ERROR "This piece of cmake code is not ported to Qt 5") |
| 39 |
+ ecm_add_qtwayland_client_protocol(xdg_shell_protocol_srcs |
| 40 |
+ PROTOCOL ${wayland_protocols_loc}/stable/xdg-shell/xdg-shell.xml |
| 41 |
+ BASENAME xdg-shell |
| 42 |
+ ) |
| 43 |
+ |
| 44 |
+ target_sources(lib_ui PRIVATE ${xdg_shell_protocol_srcs}) |
| 45 |
+ target_include_directories(lib_ui PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) |
| 46 |
endif() |
| 47 |
|
| 48 |
target_link_libraries(lib_ui |