use ecm for the icon

This commit is contained in:
Patrick von Reth 2015-01-27 14:57:00 +01:00
parent 3044dbff33
commit 050efebe42
8 changed files with 7 additions and 21 deletions

View File

@ -1,7 +1,7 @@
project( SnoreNotify )
cmake_minimum_required( VERSION 2.8.12 )
find_package(ECM 1.2.0 REQUIRED NO_MODULE)
find_package(ECM 1.7.0 REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules )

BIN
data/128-snore.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -1,19 +1 @@
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_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)
endif()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

View File

@ -1,5 +1,5 @@
<RCC>
<qresource prefix="/root">
<file>snore.png</file>
<file alias="snore.png">128-snore.png</file>
</qresource>
</RCC>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

View File

@ -1,6 +1,7 @@
if(UNIX AND WITH_SNORE_DEAMON)
install(FILES 128x128-snore.png DESTINATION ${KDE_ICONDIR}/snore.png)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/snorenotify.desktop.in" "${CMAKE_CURRENT_BINARY_DIR}/snorenotify.desktop" @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/snorenotify.desktop" DESTINATION ${XDG_APPS_INSTALL_DIR})
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/snorenotify.desktop" DESTINATION ${KDE_APPDIR})
endif()
if(WIN32)

View File

@ -4,6 +4,9 @@ add_subdirectory(core)
if(WITH_SNORE_DEAMON)
include(ECMAddAppIcon)
ecm_add_app_icon(SNORENOTIFY_DEAMON_DEPS ICONS ${CMAKE_CURRENT_SOURCE_DIR}/../data/128-snore.png)
add_executable( snorenotify WIN32 main.cpp snorenotify.cpp trayicon.cpp ${SNORENOTIFY_DEAMON_DEPS})
target_link_libraries( snorenotify libsnore Qt5::Gui Qt5::Widgets )
install(TARGETS snorenotify RUNTIME DESTINATION bin