Make dependencie to QWidget optional

This commit is contained in:
Hannah von Reth 2015-12-02 17:15:31 +01:00
parent 6768fe024d
commit e7dec50230
6 changed files with 20 additions and 9 deletions

View File

@ -38,7 +38,12 @@ set(SNORE_CamelCase_SUFFIX "Qt5")
find_package(Qt5Core REQUIRED)
find_package(Qt5Network REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Gui REQUIRED)
find_package(Qt5Widgets QUIET)
set_package_properties(Qt5Widgets PROPERTIES
PURPOSE "Supprot for the daemon and the settings dialog as well as some backends."
TYPE OPTIONAL)
set(LIBSNORE_INCLUDE_DIR ${KDE_INSTALL_INCLUDEDIR}/libsnore)

View File

@ -2,11 +2,13 @@ include(libsnore/SnoreAddPlugin.cmake)
add_subdirectory(libsnore)
ecm_optional_add_subdirectory(daemon)
add_feature_info(BUILD_daemon BUILD_daemon "Build and installd the snorenotify daemon which recieves and redirects notifications.")
if(Qt5Widgets_FOUND)
ecm_optional_add_subdirectory(daemon)
add_feature_info(BUILD_daemon BUILD_daemon "Build and installd the snorenotify daemon which recieves and redirects notifications.")
ecm_optional_add_subdirectory(settings)
add_feature_info(BUILD_settings BUILD_settings "Build and installd the snorensettings application which allows the modification of the settings for all applications using libsnore.")
ecm_optional_add_subdirectory(settings)
add_feature_info(BUILD_settings BUILD_settings "Build and installd the snorensettings application which allows the modification of the settings for all applications using libsnore.")
endif()
ecm_optional_add_subdirectory(snoresend)
add_feature_info(BUILD_snoresend BUILD_snoresend "Build and installd the snoresend application, a commandline interface for sendig notifications.")

View File

@ -104,5 +104,6 @@ if(UNIX)
ecm_install_icons(ICONS ${PROJECT_SOURCE_DIR}/data/128-apps-snore.png DESTINATION ${KDE_INSTALL_ICONDIR})
endif()
add_subdirectory(settings)
if(Qt5Widgets_FOUND)
add_subdirectory(settings)
endif()

View File

@ -2,6 +2,7 @@
find_dependency(Qt5Core REQUIRED)
find_dependency(Qt5Network REQUIRED)
find_dependency(Qt5Gui REQUIRED)
include("${CMAKE_CURRENT_LIST_DIR}/Libsnore@SNORE_CamelCase_SUFFIX@Target.cmake")

View File

@ -11,7 +11,7 @@ function(add_snore_plugin name)
target_link_libraries(libsnore_${ARG_TYPE}_${name} Snore::Libsnore ${ARG_LIBS})
install(TARGETS libsnore_${ARG_TYPE}_${name} ${SNORE_PLUGIN_INSTALL_PATH})
if(ARG_SETTINGS_SOURCES)
if(ARG_SETTINGS_SOURCES AND Qt5Widgets_FOUND)
add_library(libsnore_settings_${ARG_TYPE}_${name} MODULE ${ARG_SETTINGS_SOURCES} )
target_link_libraries(libsnore_settings_${ARG_TYPE}_${name} Snore::Libsnore Snore::LibsnoreSettings ${ARG_SETTINGS_LIBS})
install(TARGETS libsnore_settings_${ARG_TYPE}_${name} ${SNORE_PLUGIN_INSTALL_PATH})

View File

@ -1 +1,3 @@
add_snore_plugin(trayicon SOURCES trayiconnotifer.cpp TYPE backend LIBS Qt5::Widgets)
if(Qt5Widgets_FOUND)
add_snore_plugin(trayicon SOURCES trayiconnotifer.cpp TYPE backend LIBS Qt5::Widgets)
endif()