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_FREEDESKTOP_FRONTEND "Build the freedesktop frontend" OFF)
option(WITH_GROWL_BACKEND "Build the Growl backend" ON) 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) set(SNORE_VERSION_MAJOR 0)

View File

@ -1,17 +1,19 @@
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(WIN32) if(WITH_SNORE_DEAMON)
set(ICON_NAME zzz) if(WIN32)
FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/${ICON_NAME}.ico ICON) set(ICON_NAME zzz)
string(REPLACE "\\" "\\\\" ICON ${ICON}) FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/${ICON_NAME}.ico ICON)
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${ICON_NAME}.rc "IDI_ICON1 ICON DISCARDABLE \"${ICON}\"\n") string(REPLACE "\\" "\\\\" ICON ${ICON})
set(SNORENOTIFY_DEPS ${SNORENOTIFY_DEPS} ${CMAKE_CURRENT_BINARY_DIR}/${ICON_NAME}.rc PARENT_SCOPE) file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${ICON_NAME}.rc "IDI_ICON1 ICON DISCARDABLE \"${ICON}\"\n")
endif(WIN32) set(SNORENOTIFY_DEAMON_DEPS ${SNORENOTIFY_DEPS} ${CMAKE_CURRENT_BINARY_DIR}/${ICON_NAME}.rc PARENT_SCOPE)
endif(WIN32)
if(KDE4_FOUND) if(KDE4_FOUND)
install(FILES snore.png DESTINATION ${ICON_INSTALL_DIR}/hicolor/48x48/apps) install(FILES snore.png DESTINATION ${ICON_INSTALL_DIR}/hicolor/48x48/apps)
if(CMAKE_INSTALL_PREFIX STREQUAL "/usr") if(CMAKE_INSTALL_PREFIX STREQUAL "/usr")
install(FILES snore.png DESTINATION /usr/share/pixmaps) install(FILES snore.png DESTINATION /usr/share/pixmaps)
endif(CMAKE_INSTALL_PREFIX STREQUAL "/usr") endif(CMAKE_INSTALL_PREFIX STREQUAL "/usr")
endif(KDE4_FOUND) endif(KDE4_FOUND)
endif()

View File

@ -1,25 +1,25 @@
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
add_subdirectory(core) add_subdirectory(core)
QT4_ADD_RESOURCES(SNORENOTIFY_RCS ${SNORE_RCS}) if(WITH_SNORE_DEAMON)
set(SNORENOTIFY_DEPS ${SNORENOTIFY_DEPS} ${SNORENOTIFY_RCS})
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} ) target_link_libraries( snorenotify snorecore ${QT_QTGUI_LIBRARY} )
if(KDE4_FOUND) if(KDE4_FOUND)
target_link_libraries( snorenotify ${KDE4_KDEUI_LIBS} ) target_link_libraries( snorenotify ${KDE4_KDEUI_LIBS} )
endif(KDE4_FOUND) endif(KDE4_FOUND)
if(MSVC) if(MSVC)
set_target_properties(snorenotify PROPERTIES LINK_FLAGS "/ENTRY:\"mainCRTStartup\"") set_target_properties(snorenotify PROPERTIES LINK_FLAGS "/ENTRY:\"mainCRTStartup\"")
endif(MSVC) endif(MSVC)
add_dependencies(snorenotify snorecore) add_dependencies(snorenotify snorecore)
install(TARGETS snorenotify RUNTIME DESTINATION bin install(TARGETS snorenotify RUNTIME DESTINATION bin
LIBRARY DESTINATION lib LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib) ARCHIVE DESTINATION lib)
endif()
add_subdirectory(plugins) 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) 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") 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(notification)
add_subdirectory(plugins) add_subdirectory(plugins)
@ -15,6 +17,7 @@ set ( SnoreNotify_SRCS ${SnoreNotify_SRCS}
application.cpp application.cpp
hint.cpp hint.cpp
${CMAKE_CURRENT_BINARY_DIR}/version.cpp ${CMAKE_CURRENT_BINARY_DIR}/version.cpp
${SNORENOTIFY_RCS}
) )
set ( SnoreNotify_HDR ${SnoreNotify_HDR} set ( SnoreNotify_HDR ${SnoreNotify_HDR}