summaryrefslogtreecommitdiffstats
path: root/src/desktop/CMakeLists.txt
diff options
context:
space:
mode:
authorDidier Raboud <odyx@debian.org>2012-12-27 09:54:55 +0100
committerDidier Raboud <odyx@debian.org>2012-12-27 10:02:18 +0100
commitc2ebd5551ff2569f56e3321efd2d9bedaf079955 (patch)
treec3f9c867393982c4400f1378801c5184b2a363b2 /src/desktop/CMakeLists.txt
parenta75f02089cd97b62cb7cf1505bd38e32da14eb69 (diff)
downloadcolobot-c2ebd5551ff2569f56e3321efd2d9bedaf079955.tar.gz
colobot-c2ebd5551ff2569f56e3321efd2d9bedaf079955.tar.bz2
colobot-c2ebd5551ff2569f56e3321efd2d9bedaf079955.zip
Add SVG colobot icon
- Refer to the icon in the desktop file - Use rsvg-convert to get scaled PNG versions - Add librsvg2-bin to travis
Diffstat (limited to 'src/desktop/CMakeLists.txt')
-rw-r--r--src/desktop/CMakeLists.txt24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/desktop/CMakeLists.txt b/src/desktop/CMakeLists.txt
index 6deac2f..cc159a9 100644
--- a/src/desktop/CMakeLists.txt
+++ b/src/desktop/CMakeLists.txt
@@ -14,6 +14,30 @@ install(
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications/
)
+# Install Icon
+set(COLOBOT_ICON_FILE colobot.svg)
+install(
+ FILES ${CMAKE_CURRENT_SOURCE_DIR}/${COLOBOT_ICON_FILE}
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/apps/
+ )
+
+# Render SVG icon in various sizes
+find_program(RSVG_CONVERT rsvg-convert)
+if(RSVG_CONVERT)
+ foreach(PNGSIZE "48" "32" "16")
+ file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${PNGSIZE})
+ add_custom_target(resize_icon_${PNGSIZE} ALL
+ COMMAND ${RSVG_CONVERT} -w ${PNGSIZE} -h ${PNGSIZE} ${CMAKE_CURRENT_SOURCE_DIR}/${COLOBOT_ICON_FILE}
+ > ${CMAKE_CURRENT_BINARY_DIR}/${PNGSIZE}/colobot.png
+ )
+ install(
+ FILES ${CMAKE_CURRENT_BINARY_DIR}/${PNGSIZE}/colobot.png
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/${PNGSIZE}x${PNGSIZE}/apps/
+ )
+ endforeach()
+endif()
+
+# Translate translatable material
find_program(PO4A po4a)
if(PO4A)