diff --git a/CMakeLists.txt b/CMakeLists.txt index 3be1f20..41b6b50 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt index 79e570d..35bff18 100644 --- a/data/CMakeLists.txt +++ b/data/CMakeLists.txt @@ -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) - 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) -endif(WIN32) +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_DEAMON_DEPS ${SNORENOTIFY_DEPS} ${CMAKE_CURRENT_BINARY_DIR}/${ICON_NAME}.rc PARENT_SCOPE) + endif(WIN32) -if(KDE4_FOUND) - install(FILES snore.png DESTINATION ${ICON_INSTALL_DIR}/hicolor/48x48/apps) - if(CMAKE_INSTALL_PREFIX STREQUAL "/usr") - install(FILES snore.png DESTINATION /usr/share/pixmaps) - endif(CMAKE_INSTALL_PREFIX STREQUAL "/usr") -endif(KDE4_FOUND) + if(KDE4_FOUND) + install(FILES snore.png DESTINATION ${ICON_INSTALL_DIR}/hicolor/48x48/apps) + if(CMAKE_INSTALL_PREFIX STREQUAL "/usr") + install(FILES snore.png DESTINATION /usr/share/pixmaps) + endif(CMAKE_INSTALL_PREFIX STREQUAL "/usr") + endif(KDE4_FOUND) +endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ebb3d61..0eb267b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,25 +1,25 @@ 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} ) + target_link_libraries( snorenotify snorecore ${QT_QTGUI_LIBRARY} ) -if(KDE4_FOUND) - target_link_libraries( snorenotify ${KDE4_KDEUI_LIBS} ) -endif(KDE4_FOUND) + if(KDE4_FOUND) + target_link_libraries( snorenotify ${KDE4_KDEUI_LIBS} ) + endif(KDE4_FOUND) -if(MSVC) - set_target_properties(snorenotify PROPERTIES LINK_FLAGS "/ENTRY:\"mainCRTStartup\"") -endif(MSVC) + if(MSVC) + set_target_properties(snorenotify PROPERTIES LINK_FLAGS "/ENTRY:\"mainCRTStartup\"") + endif(MSVC) -add_dependencies(snorenotify snorecore) + add_dependencies(snorenotify snorecore) -install(TARGETS snorenotify RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) + install(TARGETS snorenotify RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) + endif() add_subdirectory(plugins) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 2243c99..1601d0f 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -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}