buildsystem fixes

This commit is contained in:
Patrick von Reth 2014-09-09 13:37:17 +02:00
parent 62ec81a414
commit 12a2886a74
4 changed files with 61 additions and 37 deletions

View File

@ -14,7 +14,6 @@ include(FeatureSummary)
#######################################################################
option(WITH_FRONTENDS "Build frontends currently only useful if WITH_SNORE_DEAMON=ON" OFF)
option(WITH_GROWL_BACKEND "Build the Growl backend" ON)
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)
@ -40,7 +39,6 @@ else()
find_package(Qt5Core REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Network REQUIRED)
find_package(Qt5DBus QUIET)
find_package(Qt5Declarative REQUIRED)
include(ECMQt4To5Porting)
set(SNORE_SUFFIX "-qt5")
@ -50,7 +48,7 @@ endif()
find_package(Doxygen QUIET)
set_package_properties(Doxygen PROPERTIES
DESCRIPTION "Doxygen is the de facto standard tool for generating documentation from annotated C++ sources, but it also supports other popular programming languages such as C, Objective-C, C#, PHP, Java, Python, IDL (Corba, Microsoft, and UNO/OpenOffice flavors), Fortran, VHDL, Tcl, and to some extent D."
DESCRIPTION "Doxygen a tool for generating documentation."
URL "http://www.stack.nl/~dimitri/doxygen/"
PURPOSE "Generation of API documentation"
TYPE OPTIONAL)
@ -84,4 +82,4 @@ add_subdirectory(share)
add_subdirectory(src)
feature_summary(WHAT ALL)
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES)

View File

@ -1,17 +1,30 @@
if(QT_QTDBUS_FOUND AND NOT WITH_FREEDESKTOP_FRONTEND AND UNIX AND NOT APPLE)
message(STATUS "Adding Freedesktop notification backend")
if(NOT WITH_FREEDESKTOP_FRONTEND AND UNIX AND NOT APPLE)
set ( FREEDESKTOP_NOTIFICATION_SRC
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()
if(QT_QTDBUS_FOUND)
message(STATUS "Adding Freedesktop notification backend")
set ( FREEDESKTOP_NOTIFICATION_SRC
freedesktopnotification_backend.cpp
fredesktopnotification.cpp
)
qt4_add_dbus_interface( FREEDESKTOP_NOTIFICATION_SRC ../../frontends/freedesktop/org.freedesktop.Notifications.xml notificationinterface )
qt4_add_dbus_interface( FREEDESKTOP_NOTIFICATION_SRC ../../frontends/freedesktop/org.freedesktop.Notifications.xml notificationinterface )
add_library(libsnore_backend_freedesktop MODULE ${FREEDESKTOP_NOTIFICATION_SRC} )
target_link_libraries(libsnore_backend_freedesktop libsnore ${QT_QTGUI_LIBRARY} ${QT_QTDBUS_LIBRARY} )
add_library(libsnore_backend_freedesktop MODULE ${FREEDESKTOP_NOTIFICATION_SRC} )
target_link_libraries(libsnore_backend_freedesktop libsnore ${QT_QTGUI_LIBRARY} ${QT_QTDBUS_LIBRARY} )
install(TARGETS libsnore_backend_freedesktop ${SNORE_PLUGIN_INSTALL_PATH})
endif(QT_QTDBUS_FOUND AND NOT WITH_FREEDESKTOP_FRONTEND AND UNIX AND NOT APPLE)
install(TARGETS libsnore_backend_freedesktop ${SNORE_PLUGIN_INSTALL_PATH})
endif()
endif()

View File

@ -1,4 +1,4 @@
find_package(SnoreGrowl++)
find_package(SnoreGrowl++ QUIET)
set_package_properties(SnoreGrowl++ PROPERTIES
DESCRIPTION "SnoreGrowl is a library providing Growl network notifications."
URL "https://github.com/Snorenotify/SnoreGrowl"

View File

@ -1,33 +1,46 @@
if(QT_QTDBUS_FOUND AND WITH_FREEDESKTOP_FRONTEND)
message(STATUS "Adding freedesktop notification frontend")
if(WITH_FREEDESKTOP_FRONTEND)
set( FREEDESKTOP_NOTIFICATION_FRONTEND_SRC
freedesktopnotificationfrontend.cpp
../../backends/freedesktop/fredesktopnotification.cpp
)
qt4_add_dbus_adaptor( FREEDESKTOP_NOTIFICATION_FRONTEND_SRC org.freedesktop.Notifications.xml freedesktopnotificationfrontend.h FreedesktopFrontend)
add_library(libsnore_frontend_freedesktop MODULE ${FREEDESKTOP_NOTIFICATION_FRONTEND_SRC} )
target_link_libraries(libsnore_frontend_freedesktop Snore::Libsnore ${QT_QTDBUS_LIBRARY} ${QT_QTGUI_LIBRARY} )
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()
#install the dbus interface
if(WITH_SNORE_DEAMON)
if(WIN32)
set(SNORE_LOCATION ../bin/snorenotify)
else(WIN32)
set(SNORE_LOCATION ${CMAKE_INSTALL_PREFIX}/bin/snorenotify)
endif(WIN32)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/org.freedesktop.Notifications.service.cmake ${CMAKE_CURRENT_BINARY_DIR}/org.freedesktop.Notifications.service)
if(QT_QTDBUS_FOUND)
message(STATUS "Adding freedesktop notification frontend")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.freedesktop.Notifications.service
DESTINATION share/dbus-1/services/)
endif(WITH_SNORE_DEAMON)
set( FREEDESKTOP_NOTIFICATION_FRONTEND_SRC
freedesktopnotificationfrontend.cpp
../../backends/freedesktop/fredesktopnotification.cpp
)
install(TARGETS libsnore_frontend_freedesktop ${SNORE_PLUGIN_INSTALL_PATH})
qt4_add_dbus_adaptor( FREEDESKTOP_NOTIFICATION_FRONTEND_SRC org.freedesktop.Notifications.xml freedesktopnotificationfrontend.h FreedesktopFrontend)
endif(QT_QTDBUS_FOUND AND WITH_FREEDESKTOP_FRONTEND)
add_library(libsnore_frontend_freedesktop MODULE ${FREEDESKTOP_NOTIFICATION_FRONTEND_SRC} )
target_link_libraries(libsnore_frontend_freedesktop Snore::Libsnore ${QT_QTDBUS_LIBRARY} ${QT_QTGUI_LIBRARY} )
#install the dbus interface
if(WITH_SNORE_DEAMON)
if(WIN32)
set(SNORE_LOCATION ../bin/snorenotify)
else(WIN32)
set(SNORE_LOCATION ${CMAKE_INSTALL_PREFIX}/bin/snorenotify)
endif(WIN32)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/org.freedesktop.Notifications.service.cmake ${CMAKE_CURRENT_BINARY_DIR}/org.freedesktop.Notifications.service)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.freedesktop.Notifications.service
DESTINATION share/dbus-1/services/)
endif(WITH_SNORE_DEAMON)
install(TARGETS libsnore_frontend_freedesktop ${SNORE_PLUGIN_INSTALL_PATH})
endif()
endif()