diff --git a/CMakeLists.txt b/CMakeLists.txt index fe2d0a5..581af7b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,20 +1,22 @@ project( SnoreNotify ) -cmake_minimum_required( VERSION 2.8.9 ) -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake/modules ${CMAKE_PREFIX_PATH}/share/apps/cmake/modules) +cmake_minimum_required( VERSION 2.8.12 ) -set(CMAKE_AUTOMOC ON) -set(CMAKE_INCLUDE_CURRENT_DIR ON) +find_package(ECM 1.2.0 REQUIRED NO_MODULE) -cmake_policy(SET CMP0020 NEW) +set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ) + +include(KDEInstallDirs) +include(KDECompilerSettings) +include(KDECMakeSettings) -include(GNUInstallDirs) include(GenerateExportHeader) include(FeatureSummary) + + ####################################################################### option(WITH_FRONTENDS "Build frontends currently only useful if WITH_SNORE_DEAMON=ON" OFF) option(WITH_SNORE_DEAMON "Build the Snore deamon, which redirects notifications" OFF) -option(WITH_QT4 "Use Qt4" ON) option(WITH_FREEDESKTOP_FRONTEND "Build the freedesktop frontend" OFF) ####################################################################### @@ -26,9 +28,6 @@ set(SNORE_VERSION_SUFFIX "") set(SNORE_SUFFIX "-qt5") set(SNORE_CamelCase_SUFFIX "Qt5") -find_package(ECM 0.0.9 NO_MODULE REQUIRED) -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH}) -include(KDECompilerSettings) find_package(Qt5Core REQUIRED) find_package(Qt5Widgets REQUIRED) @@ -36,8 +35,6 @@ find_package(Qt5Network REQUIRED) find_package(Qt5Quick REQUIRED) - - find_package(Doxygen QUIET) set_package_properties(Doxygen PROPERTIES DESCRIPTION "Doxygen a tool for generating documentation." diff --git a/share/CMakeLists.txt b/share/CMakeLists.txt index 155c5bf..ebb3b6c 100644 --- a/share/CMakeLists.txt +++ b/share/CMakeLists.txt @@ -1,8 +1,8 @@ -if(UNIX AND WITH_SNORE_DEAMON) +if(UNIX AND WITH_SNORE_DEAMON) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/snorenotify.desktop.in" "${CMAKE_CURRENT_BINARY_DIR}/snorenotify.desktop" @ONLY) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/snorenotify.desktop" DESTINATION ${XDG_APPS_INSTALL_DIR}) -endif(UNIX AND WITH_SNORE_DEAMON) +endif() if(WIN32) add_subdirectory(snoretoast) -endif(WIN32) +endif() diff --git a/src/plugins/backends/freedesktop/CMakeLists.txt b/src/plugins/backends/freedesktop/CMakeLists.txt index 6425b53..56796c5 100644 --- a/src/plugins/backends/freedesktop/CMakeLists.txt +++ b/src/plugins/backends/freedesktop/CMakeLists.txt @@ -1,14 +1,10 @@ if(NOT WITH_FREEDESKTOP_FRONTEND AND UNIX AND NOT APPLE) - - if(NOT WITH_QT4) - find_package(Qt5DBus QUIET) - set_package_properties(Qt5DBus PROPERTIES - PURPOSE "Support for Freedesktop Notifications" - TYPE OPTIONAL) - set(QT_QTDBUS_FOUND TRUE) - set(QT_QTDBUS_LIBRARY Qt5::DBus) - endif() - + find_package(Qt5DBus QUIET) + set_package_properties(Qt5DBus PROPERTIES + PURPOSE "Support for Freedesktop Notifications" + TYPE OPTIONAL) + set(QT_QTDBUS_FOUND TRUE) + set(QT_QTDBUS_LIBRARY Qt5::DBus) if(QT_QTDBUS_FOUND) message(STATUS "Adding Freedesktop notification backend") @@ -18,7 +14,7 @@ if(NOT WITH_FREEDESKTOP_FRONTEND AND UNIX AND NOT APPLE) fredesktopnotification.cpp ) - qt4_add_dbus_interface( FREEDESKTOP_NOTIFICATION_SRC ../../frontends/freedesktop/org.freedesktop.Notifications.xml notificationinterface ) + qt5_add_dbus_interface( FREEDESKTOP_NOTIFICATION_SRC ../../frontends/freedesktop/org.freedesktop.Notifications.xml notificationinterface ) add_library(libsnore_backend_freedesktop MODULE ${FREEDESKTOP_NOTIFICATION_SRC} ) diff --git a/src/plugins/backends/snore/notifywidget.cpp b/src/plugins/backends/snore/notifywidget.cpp index 805a48f..196002c 100644 --- a/src/plugins/backends/snore/notifywidget.cpp +++ b/src/plugins/backends/snore/notifywidget.cpp @@ -22,7 +22,6 @@ #include #include #include -#include #include #include using namespace Snore;