make buildin backend optional

This commit is contained in:
Patrick von Reth 2015-07-28 02:14:35 +02:00
parent 08b8f662dd
commit 862a9d0362
2 changed files with 18 additions and 12 deletions

View File

@ -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)

View File

@ -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()