From e4358bef35a72b6260e5e92af0d607bb7784b7aa Mon Sep 17 00:00:00 2001
From: crackedmind <digital.stream.of.mind@gmail.com>
Date: Mon, 18 Dec 2017 07:53:24 +0300
Subject: [PATCH] Update cmake for linux builds

---
 CMakeLists.txt          | 1 +
 Telegram/CMakeLists.txt | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7a6f2140a..2f9ed6f99 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -43,6 +43,7 @@ if (LINUX)
     find_package(OpenAL REQUIRED)
     find_package(ALSA)
     find_package(PulseAudio)
+    find_package(Qt5 COMPONENTS DBus)
 else(LINUX)
     # Needs OpenAL-SOFT
     # Install via `brew install openal-soft` and configure with cmake call from README.md
diff --git a/Telegram/CMakeLists.txt b/Telegram/CMakeLists.txt
index 7ead68414..9a627c974 100644
--- a/Telegram/CMakeLists.txt
+++ b/Telegram/CMakeLists.txt
@@ -693,7 +693,7 @@ if(WIN32)
 endif()
 
 if (LINUX)
-    target_link_libraries(Telegram ${ALSA_LIBRARIES} ${PULSEAUDIO_LIBRARIES})
+    target_link_libraries(Telegram Qt5::DBus dl ${ALSA_LIBRARIES} ${PULSEAUDIO_LIBRARIES})
 endif()
 
 set_target_properties(Telegram