summaryrefslogtreecommitdiff
blob: 44d1bc4beac29982fd2d086ef470729febf9b204 (plain)
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
commit e86d576d4030231617d191a569354e368a038384
Author: Andreas Sturmlechner <andreas.sturmlechner@gmail.com>
Date:   Sat Aug 5 23:45:39 2017 +0200

    Qt5DBus is only required with HAVE_XSCREENSAVER

diff --git a/CMakeLists.txt b/CMakeLists.txt
index e3c89d8..39cae72 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -32,10 +32,6 @@ include(KDECMakeSettings)
 set(REQUIRED_QT_VERSION 5.6.0)
 find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Widgets)
 
-if(NOT WIN32 AND NOT APPLE)
-    find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED DBus)
-endif()
-
 if(APPLE)
     cmake_find_frameworks(CoreFoundation Carbon)
 endif()
@@ -66,6 +62,10 @@ if(X11_FOUND)
     set(HAVE_XSCREENSAVER ${X11_Xscreensaver_FOUND})
     add_feature_info("X-Screensaver based poller" HAVE_XSCREENSAVER "KIdleTime fallback mode (libXss)")
 
+    if(HAVE_XSCREENSAVER AND NOT WIN32)
+        find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED DBus)
+    endif()
+
     if(NOT HAVE_XSCREENSAVER AND NOT HAVE_XSYNC)
         message(FATAL_ERROR "\nNeither the XSync (libXext) nor XScreensaver (libXss) development package was found.\nPlease install one of them (XSync is recommended)")
     endif()