aboutsummaryrefslogtreecommitdiff
path: root/modules/KDE4Macros.cmake
diff options
context:
space:
mode:
authorPatrick Spendrin <ps_ml@gmx.de>2007-11-09 12:43:19 +0000
committerPatrick Spendrin <ps_ml@gmx.de>2007-11-09 12:43:19 +0000
commit90f3ffd45a28a5f86d09e8371aa4897b0d91a9f2 (patch)
treebcabdff2eddaa338a3165ff56b899194298feee5 /modules/KDE4Macros.cmake
parentc5afd5be2d2baeff6a727b483d1791634170379c (diff)
downloadextra-cmake-modules-90f3ffd45a28a5f86d09e8371aa4897b0d91a9f2.tar.gz
extra-cmake-modules-90f3ffd45a28a5f86d09e8371aa4897b0d91a9f2.tar.bz2
changing macro to just work in case of png2ico's existance - removing duplication from FindKDEWIN32.cmake
svn path=/trunk/KDE/kdelibs/; revision=734634
Diffstat (limited to 'modules/KDE4Macros.cmake')
-rw-r--r--modules/KDE4Macros.cmake66
1 files changed, 32 insertions, 34 deletions
diff --git a/modules/KDE4Macros.cmake b/modules/KDE4Macros.cmake
index 7e4b5222..92ec5097 100644
--- a/modules/KDE4Macros.cmake
+++ b/modules/KDE4Macros.cmake
@@ -947,40 +947,38 @@ endmacro (KDE4_CREATE_HTML_HANDBOOK)
macro (KDE4_ADD_WIN32_APP_ICON outfiles pattern)
if (WIN32)
- #if (NOT PNG2ICO_EXECUTABLE)
- # find_executable(PNG2ICO_EXECUTABLE
- #endif (NOT PNG2ICO_EXECUTABLE)
- file(GLOB files "${pattern}")
-# message(${files})
- foreach (it ${files})
- get_filename_component(_name ${it} NAME_WE)
- #exclude 22'er icons, they do not fit into ico format
- if (NOT it MATCHES ".*22-.*")
+ if (NOT PNG2ICO_EXECUTABLE)
+ find_program(PNG2ICO_EXECUTABLE NAMES png2ico)
+ endif (NOT PNG2ICO_EXECUTABLE)
+ if (PNG2ICO_EXECUTABLE)
+ file(GLOB files "${pattern}")
+ foreach (it ${files})
+ get_filename_component(_name ${it} NAME_WE)
+ ##exclude 22'er icons, they do not fit into ico format - not needed anymore - you have to use the icons from kdebase / oxygen
+ #if (NOT it MATCHES ".*22-.*")
set (_icons "${_icons} ${it}")
- endif (NOT it MATCHES ".*22-.*")
- endforeach (it)
- set (_outfilename ${CMAKE_CURRENT_BINARY_DIR}/${_name})
- # png2ico is located in the recommended kdewin32 package
- message("png2ico ${_outfilename}.ico ${_icons}")
- exec_program(png2ico
- ARGS ${_outfilename}.ico ${_icons}
- )
-# does not work for unkwown reason
-# add_custom_command(OUTPUT ${_outfilename}.ico
-# COMMAND c:/Programme/kdewin-msvc/bin/png2ico.exe
-# ARGS ${_outfilename}.ico ${_icons}
-# DEPENDS ${_icons}
-# )
- file(WRITE ${_outfilename}.rc "IDI_ICON1 ICON DISCARDABLE \"${_outfilename}.ico\"\n")
- if (MINGW)
- add_custom_command(OUTPUT ${_outfilename}_res.o
- COMMAND windres
- ARGS -i ${_outfilename}.rc -o ${_outfilename}_res.o --include-dir=${CMAKE_CURRENT_SOURCE_DIR}
- DEPENDS ${_outfilename}.ico ${_outfilename}.rc
- )
- list(APPEND ${outfiles} ${_outfilename}_res.o)
- else(MINGW)
- list(APPEND ${outfiles} ${_outfilename}.rc)
- endif(MINGW)
+ #endif (NOT it MATCHES ".*22-.*")
+ endforeach (it)
+
+ set (_outfilename ${CMAKE_CURRENT_BINARY_DIR}/${_name})
+
+ # png2ico is found by the above find_program
+ message("png2ico ${_outfilename}.ico ${_icons}")
+ exec_program(png2ico ARGS ${_outfilename}.ico ${_icons})
+
+ # now make rc file for adding it to the sources
+ file(WRITE ${_outfilename}.rc "IDI_ICON1 ICON DISCARDABLE \"${_outfilename}.ico\"\n")
+ if (MINGW)
+ add_custom_command(OUTPUT ${_outfilename}_res.o
+ COMMAND windres
+ ARGS -i ${_outfilename}.rc -o ${_outfilename}_res.o --include-dir=${CMAKE_CURRENT_SOURCE_DIR}
+ DEPENDS ${_outfilename}.ico ${_outfilename}.rc
+ )
+ list(APPEND ${outfiles} ${_outfilename}_res.o)
+ else(MINGW)
+ list(APPEND ${outfiles} ${_outfilename}.rc)
+ endif(MINGW)
+ endif(PNG2ICO_EXECUTABLE)
endif(WIN32)
endmacro (KDE4_ADD_WIN32_APP_ICON)
+