aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2011-01-22 17:13:56 +0100
committerPřemysl Janouch <p.janouch@gmail.com>2011-01-22 18:07:12 +0100
commit37e2c5f01f2ee00af3a10311b69f66f8653b42db (patch)
treea0c5fec3de69f589f80a09dd58aecb8eae2b4409
parent2f5f87119d4f9f3f2ccb177da1c0ac9da55611c8 (diff)
downloadlogdiag-37e2c5f01f2ee00af3a10311b69f66f8653b42db.tar.gz
logdiag-37e2c5f01f2ee00af3a10311b69f66f8653b42db.tar.xz
logdiag-37e2c5f01f2ee00af3a10311b69f66f8653b42db.zip
Generate more icons.
* Add automatic icon generation to CMakeLists.txt. These icons are generated from the scalable SVG image. * Add pregenerated icons to the tree. * Link an icon to the Windows binary.
-rw-r--r--CMakeLists.txt44
-rw-r--r--share/icons/hicolor/16x16/apps/logdiag.pngbin0 -> 1039 bytes
-rw-r--r--share/icons/hicolor/32x32/apps/logdiag.pngbin0 -> 3255 bytes
-rw-r--r--share/icons/hicolor/48x48/apps/logdiag.pngbin0 -> 4882 bytes
-rw-r--r--share/logdiag.icobin0 -> 15086 bytes
-rw-r--r--share/logdiag.rc1
6 files changed, 45 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 72f975d..2e1675c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -53,6 +53,35 @@ if (WIN32)
remove_directory ${WIN32_DEPENDS_PATH})
endif (WIN32)
+# Generate icons
+find_program (CONVERT_EXECUTABLE convert)
+mark_as_advanced (CONVERT_EXECUTABLE)
+
+if (CONVERT_EXECUTABLE AND NOT WIN32)
+ set (icon_base ${CMAKE_CURRENT_SOURCE_DIR}/share/icons/hicolor)
+ set (icon_svg ${icon_base}/scalable/apps/logdiag.svg)
+ set (icon_size_list 16x16 32x32 48x48)
+
+ set (icon_png_list)
+ foreach (icon_size ${icon_size_list})
+ set (icon_png_path ${icon_base}/${icon_size}/apps)
+ set (icon_png ${icon_png_path}/logdiag.png)
+ list (APPEND icon_png_list ${icon_png})
+
+ add_custom_command (OUTPUT ${icon_png}
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${icon_png_path}
+ COMMAND ${CONVERT_EXECUTABLE} -background none
+ -resize ${icon_size} ${icon_svg} ${icon_png}
+ DEPENDS ${icon_svg})
+ endforeach (icon_size)
+
+ set (icon_ico ${CMAKE_CURRENT_SOURCE_DIR}/share/logdiag.ico)
+ add_custom_command (OUTPUT ${icon_ico}
+ COMMAND ${CONVERT_EXECUTABLE} ${icon_png_list} ${icon_ico}
+ DEPENDS ${icon_png_list})
+ add_custom_target (logdiag_icons DEPENDS ${icon_ico})
+endif (CONVERT_EXECUTABLE AND NOT WIN32)
+
# Dependencies
find_package (GTK2 2.12 REQUIRED gtk)
find_package (Lua51 REQUIRED)
@@ -116,6 +145,21 @@ set (logdiag_HEADERS
${liblogdiag_HEADERS}
src/ld-window-main.h)
+# Resource compilation for MinGW
+if (MINGW)
+ set (CMAKE_RC_COMPILER_INIT windres)
+ enable_language (RC)
+ set (CMAKE_RC_FLAGS "-O coff")
+ set (CMAKE_RC_COMPILE_OBJECT
+ "<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> -o <OBJECT> <SOURCE>")
+endif (MINGW)
+
+if (WIN32)
+ set (logdiag_SOURCES
+ ${logdiag_SOURCES}
+ share/logdiag.rc)
+endif (WIN32)
+
# Generate a configure file
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
${CMAKE_CURRENT_BINARY_DIR}/config.h)
diff --git a/share/icons/hicolor/16x16/apps/logdiag.png b/share/icons/hicolor/16x16/apps/logdiag.png
new file mode 100644
index 0000000..23d6e80
--- /dev/null
+++ b/share/icons/hicolor/16x16/apps/logdiag.png
Binary files differ
diff --git a/share/icons/hicolor/32x32/apps/logdiag.png b/share/icons/hicolor/32x32/apps/logdiag.png
new file mode 100644
index 0000000..839ad59
--- /dev/null
+++ b/share/icons/hicolor/32x32/apps/logdiag.png
Binary files differ
diff --git a/share/icons/hicolor/48x48/apps/logdiag.png b/share/icons/hicolor/48x48/apps/logdiag.png
new file mode 100644
index 0000000..339254f
--- /dev/null
+++ b/share/icons/hicolor/48x48/apps/logdiag.png
Binary files differ
diff --git a/share/logdiag.ico b/share/logdiag.ico
new file mode 100644
index 0000000..846a328
--- /dev/null
+++ b/share/logdiag.ico
Binary files differ
diff --git a/share/logdiag.rc b/share/logdiag.rc
new file mode 100644
index 0000000..30684e2
--- /dev/null
+++ b/share/logdiag.rc
@@ -0,0 +1 @@
+LD_ICON ICON "logdiag.ico"