diff --git a/CMakeLists.txt b/CMakeLists.txt index 1d2ccec..0cb8cb2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,6 @@ set(SNORE_CamelCase_SUFFIX "Qt5") find_package(Qt5Core REQUIRED) find_package(Qt5Network REQUIRED) -find_package(Qt5Quick REQUIRED) find_package(Qt5Widgets REQUIRED) diff --git a/src/plugins/backends/snore/CMakeLists.txt b/src/plugins/backends/snore/CMakeLists.txt index 55899ac..4fabec1 100644 --- a/src/plugins/backends/snore/CMakeLists.txt +++ b/src/plugins/backends/snore/CMakeLists.txt @@ -1,15 +1,22 @@ -QT5_ADD_RESOURCES(SNORENOTIFIER_RCS ${CMAKE_CURRENT_SOURCE_DIR}/snore_notification.qrc) +find_package(Qt5Quick QUIET) +set_package_properties(Qt5Quick PROPERTIES + PURPOSE "Adding buildin notifiaction backend." + TYPE OPTIONAL) -set( SNORE_SRC - snorenotifier.cpp - snorenotifiersettings.cpp - notifywidget.cpp - ${SNORENOTIFIER_RCS} - ) + +if(Qt5Quick_FOUND) + QT5_ADD_RESOURCES(SNORENOTIFIER_RCS ${CMAKE_CURRENT_SOURCE_DIR}/snore_notification.qrc) + + set( SNORE_SRC + snorenotifier.cpp + snorenotifiersettings.cpp + notifywidget.cpp + ${SNORENOTIFIER_RCS} + ) -add_library(libsnore_backend_snore MODULE ${SNORE_SRC} ) -target_link_libraries(libsnore_backend_snore Snore::Libsnore Qt5::Quick) - -install(TARGETS libsnore_backend_snore ${SNORE_PLUGIN_INSTALL_PATH}) + add_library(libsnore_backend_snore MODULE ${SNORE_SRC} ) + target_link_libraries(libsnore_backend_snore Snore::Libsnore Qt5::Quick) + install(TARGETS libsnore_backend_snore ${SNORE_PLUGIN_INSTALL_PATH}) +endif() \ No newline at end of file