diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt index 5ffd513..0c4f991 100644 --- a/data/CMakeLists.txt +++ b/data/CMakeLists.txt @@ -1 +1,17 @@ set(SNORE_RCS ${SNORE_RCS} ../data/snore.qrc PARENT_SCOPE) + +if(WIN32) + if(MINGW) + file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/zzz.rc "IDI_ICON1 ICON DISCARDABLE \"zzz.ico\"\n") + find_program(WINDRES_EXECUTABLE NAMES windres) + if(WINDRES_EXECUTABLE) + exec_program(windres + ARGS "-i ${CMAKE_CURRENT_BINARY_DIR}/zzz.rc" + "-o ${CMAKE_CURRENT_BINARY_DIR}/zzz.o" + "--include-dir=${CMAKE_CURRENT_SOURCE_DIR}") + set(SNORENOTIFY_DEPS ${SNORENOTIFY_DEPS} ${CMAKE_CURRENT_BINARY_DIR}/zzz.o PARENT_SCOPE) + endif(WINDRES_EXECUTABLE) + else(MINGW) + set(SNORENOTIFY_DEPS ${SNORENOTIFY_DEPS} ../data/zzz.rc PARENT_SCOPE) + endif(MINGW) +endif(WIN32) \ No newline at end of file diff --git a/data/zzz.ico b/data/zzz.ico new file mode 100644 index 0000000..0ee89d6 Binary files /dev/null and b/data/zzz.ico differ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8a59367..0bc85fa 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -5,10 +5,18 @@ include_directories( add_subdirectory(core) -QT4_ADD_RESOURCES(snorenotify_DEPS ${SNORE_RCS}) -automoc4_add_executable( snorenotify main.cpp trayicon.cpp ${snorenotify_DEPS}) +QT4_ADD_RESOURCES(SNORENOTIFY_RCS ${SNORE_RCS}) +set(SNORENOTIFY_DEPS ${SNORENOTIFY_DEPS} ${SNORENOTIFY_RCS}) -target_link_libraries( snorenotify snorecore ${QT_QTGUI_LIBRARY} ) +if(WIN32 AND CMAKE_BUILD_TYPE MATCHES Debug) + set(WIN32_SPECIFIC) +else(WIN32 AND CMAKE_BUILD_TYPE MATCHES Debug) + set(WIN32_SPECIFIC WIN32) +endif(WIN32 AND CMAKE_BUILD_TYPE MATCHES Debug) + +automoc4_add_executable( snorenotify ${WIN32_SPECIFIC} main.cpp trayicon.cpp ${SNORENOTIFY_DEPS}) + +target_link_libraries( snorenotify snorecore ${QT_QTGUI_LIBRARY} ) add_dependencies(snorenotify snorecore) install(TARGETS snorenotify RUNTIME DESTINATION bin