aboutsummaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2012-03-27 12:33:36 +0000
committerPierre Ossman <ossman@cendio.se>2012-03-27 12:33:36 +0000
commit64127708e070f248f4db1ed57375de25c0ce0ce4 (patch)
treebf38bdd78b1c783f61e0d5dc29cd43ecfd8b294e /media
parentca937761f5e6cd915201d0691f6383fe52316c58 (diff)
downloadtigervnc-64127708e070f248f4db1ed57375de25c0ce0ce4.tar.gz
tigervnc-64127708e070f248f4db1ed57375de25c0ce0ce4.zip
Convert media Makefile to CMake.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4877 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'media')
-rw-r--r--media/CMakeLists.txt54
-rw-r--r--media/Makefile30
2 files changed, 54 insertions, 30 deletions
diff --git a/media/CMakeLists.txt b/media/CMakeLists.txt
new file mode 100644
index 00000000..d2cb912c
--- /dev/null
+++ b/media/CMakeLists.txt
@@ -0,0 +1,54 @@
+set(ICON_FILES
+ icons/tigervnc_16.png
+ icons/tigervnc_22.png
+ icons/tigervnc_24.png
+ icons/tigervnc_32.png
+ icons/tigervnc_48.png)
+
+find_program(CONVERT_EXECUTABLE convert)
+
+if(CONVERT_EXECUTABLE)
+ add_custom_target(icons-target ALL DEPENDS ${ICON_FILES})
+
+ if(UNIX AND NOT APPLE)
+ foreach(SIZE 16 22 24 32 48)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/icons/tigervnc_${SIZE}.png
+ DESTINATION ${DATA_DIR}/icons/hicolor/${SIZE}x${SIZE}/apps
+ RENAME tigervnc.png)
+ endforeach()
+ install(FILES icons/tigervnc.svg
+ DESTINATION ${DATA_DIR}/icons/hicolor/scalable/apps)
+ endif()
+endif()
+
+add_custom_command(OUTPUT icons COMMAND mkdir icons)
+
+add_custom_command(OUTPUT icons/tigervnc_16.png
+ COMMAND ${CONVERT_EXECUTABLE} -background transparent
+ ${CMAKE_CURRENT_SOURCE_DIR}/tigervnc_16.svg icons/tigervnc_16.png
+ DEPENDS icons ${CMAKE_CURRENT_SOURCE_DIR}/tigervnc_16.svg
+ COMMENT "Generating icons/tigervnc_16.png")
+
+add_custom_command(OUTPUT icons/tigervnc_22.png
+ COMMAND ${CONVERT_EXECUTABLE} -size 22x22 xc:none -gravity center -background transparent
+ ${CMAKE_CURRENT_SOURCE_DIR}/tigervnc_20.svg -composite icons/tigervnc_22.png
+ DEPENDS icons ${CMAKE_CURRENT_SOURCE_DIR}/tigervnc_20.svg
+ COMMENT "Generating icons/tigervnc_22.png")
+
+add_custom_command(OUTPUT icons/tigervnc_24.png
+ COMMAND ${CONVERT_EXECUTABLE} -size 24x24 xc:none -gravity center -background transparent
+ ${CMAKE_CURRENT_SOURCE_DIR}/tigervnc_20.svg -composite icons/tigervnc_24.png
+ DEPENDS icons ${CMAKE_CURRENT_SOURCE_DIR}/tigervnc_20.svg
+ COMMENT "Generating icons/tigervnc_24.png")
+
+add_custom_command(OUTPUT icons/tigervnc_32.png
+ COMMAND ${CONVERT_EXECUTABLE} -size 32x32 xc:none -gravity center -background transparent
+ ${CMAKE_CURRENT_SOURCE_DIR}/tigervnc_28.svg -composite icons/tigervnc_32.png
+ DEPENDS icons ${CMAKE_CURRENT_SOURCE_DIR}/tigervnc_28.svg
+ COMMENT "Generating icons/tigervnc_32.png")
+
+add_custom_command(OUTPUT icons/tigervnc_48.png
+ COMMAND ${CONVERT_EXECUTABLE} -size 48x48 xc:none -gravity center -background transparent
+ ${CMAKE_CURRENT_SOURCE_DIR}/tigervnc_42.svg -composite icons/tigervnc_48.png
+ DEPENDS icons ${CMAKE_CURRENT_SOURCE_DIR}/tigervnc_42.svg
+ COMMENT "Generating icons/tigervnc_48.png")
diff --git a/media/Makefile b/media/Makefile
deleted file mode 100644
index e2f016b1..00000000
--- a/media/Makefile
+++ /dev/null
@@ -1,30 +0,0 @@
-all: icons
-
-.PHONY: clean
-clean: clean-icons
-
-ICONS := \
- icons/tigervnc_16.png \
- icons/tigervnc_22.png \
- icons/tigervnc_24.png \
- icons/tigervnc_32.png \
- icons/tigervnc_48.png
-
-.PHONY: icons clean-icons
-icons: $(ICONS)
-
-clean-icons:
- rm -f $(ICONS)
-
-icons/tigervnc_16.png: tigervnc_16.svg
- convert -background transparent "$<" "$@"
-
-icons/tigervnc_22.png: tigervnc_20.svg
- convert -size 22x22 xc:none -gravity center -background transparent "$<" -composite "$@"
-icons/tigervnc_24.png: tigervnc_20.svg
- convert -size 24x24 xc:none -gravity center -background transparent "$<" -composite "$@"
-icons/tigervnc_32.png: tigervnc_28.svg
- convert -size 32x32 xc:none -gravity center -background transparent "$<" -composite "$@"
-icons/tigervnc_48.png: tigervnc_42.svg
- convert -size 48x48 xc:none -gravity center -background transparent "$<" -composite "$@"
-