make snore deamon optional

This commit is contained in:
Patrick von Reth 2013-07-24 12:34:45 +02:00
parent aa8b67c8a8
commit f96c882ea2
4 changed files with 35 additions and 29 deletions

View File

@ -9,6 +9,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
#######################################################################
option(WITH_FREEDESKTOP_FRONTEND "Build the freedesktop frontend" OFF)
option(WITH_GROWL_BACKEND "Build the Growl backend" ON)
option(WITH_SNORE_DEAMON "Build the Snore deamon, which redirects notifications" OFF)
#######################################################################
set(SNORE_VERSION_MAJOR 0)

View File

@ -1,12 +1,13 @@
set(SNORE_RCS ${SNORE_RCS} ../data/snore.qrc PARENT_SCOPE)
set(SNORE_RCS ${SNORE_RCS} ${CMAKE_CURRENT_SOURCE_DIR}/../data/snore.qrc PARENT_SCOPE)
if(WITH_SNORE_DEAMON)
if(WIN32)
set(ICON_NAME zzz)
FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/${ICON_NAME}.ico ICON)
string(REPLACE "\\" "\\\\" ICON ${ICON})
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${ICON_NAME}.rc "IDI_ICON1 ICON DISCARDABLE \"${ICON}\"\n")
set(SNORENOTIFY_DEPS ${SNORENOTIFY_DEPS} ${CMAKE_CURRENT_BINARY_DIR}/${ICON_NAME}.rc PARENT_SCOPE)
set(SNORENOTIFY_DEAMON_DEPS ${SNORENOTIFY_DEPS} ${CMAKE_CURRENT_BINARY_DIR}/${ICON_NAME}.rc PARENT_SCOPE)
endif(WIN32)
if(KDE4_FOUND)
@ -15,3 +16,4 @@ if(KDE4_FOUND)
install(FILES snore.png DESTINATION /usr/share/pixmaps)
endif(CMAKE_INSTALL_PREFIX STREQUAL "/usr")
endif(KDE4_FOUND)
endif()

View File

@ -1,10 +1,9 @@
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
add_subdirectory(core)
QT4_ADD_RESOURCES(SNORENOTIFY_RCS ${SNORE_RCS})
set(SNORENOTIFY_DEPS ${SNORENOTIFY_DEPS} ${SNORENOTIFY_RCS})
if(WITH_SNORE_DEAMON)
add_executable( snorenotify WIN32 main.cpp snorenotify.cpp trayicon.cpp ${SNORENOTIFY_DEPS})
add_executable( snorenotify WIN32 main.cpp snorenotify.cpp trayicon.cpp ${SNORENOTIFY_DEAMON_DEPS})
target_link_libraries( snorenotify snorecore ${QT_QTGUI_LIBRARY} )
@ -21,5 +20,6 @@ add_dependencies(snorenotify snorecore)
install(TARGETS snorenotify RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
endif()
add_subdirectory(plugins)

View File

@ -1,4 +1,4 @@
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
include(GetGitRevisionDescription)
@ -7,6 +7,8 @@ get_git_head_revision(GIT_REFSPEC SNORE_REVISION)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/version.cpp.in" "${CMAKE_CURRENT_BINARY_DIR}/version.cpp")
QT4_ADD_RESOURCES(SNORENOTIFY_RCS ${SNORE_RCS})
add_subdirectory(notification)
add_subdirectory(plugins)
@ -15,6 +17,7 @@ set ( SnoreNotify_SRCS ${SnoreNotify_SRCS}
application.cpp
hint.cpp
${CMAKE_CURRENT_BINARY_DIR}/version.cpp
${SNORENOTIFY_RCS}
)
set ( SnoreNotify_HDR ${SnoreNotify_HDR}