+##############################################################################
+## DBus setup
+
+if (USE_DBUS)
+ include(FindPkgConfig)
+ if (PKG_CONFIG_FOUND)
+ pkg_check_modules(DBUS dbus-1)
+ endif (PKG_CONFIG_FOUND) #if we don't have pkg-config, assume we don't have libdbus-1-dev either http://packages.debian.org/sid/libdbus-1-dev
+ if (DBUS_FOUND)
+ set(HAVE_DBUS 1)
+ message(STATUS "Using DBus")
+ include_directories( ${DBUS_INCLUDE_DIRS})
+ else()
+ message(STATUS "DBus not found, screensaver control disabled")
+ endif (DBUS_FOUND)
+else()
+endif (USE_DBUS)
+
+# Sqlite always depends on the threading lib
+list(APPEND SQLITE3_LIBRARY ${CMAKE_THREAD_LIBS_INIT})
+
+##############################################################################
+## Qt5 setup setup
+if (ENABLE_QT)
+ message(STATUS "Qt launcher enabled, checking for Qt 5.1 / qmake")
+ find_package(Qt5 5.1 COMPONENTS Widgets)
+ if (Qt5Widgets_FOUND)
+ message(STATUS "Will enable Qt launcher GUI")
+ set(HAVE_QT 1)
+ endif()
+endif (ENABLE_QT)