diff options
| author | Patrick Spendrin <ps_ml@gmx.de> | 2007-11-09 15:15:00 +0000 | 
|---|---|---|
| committer | Patrick Spendrin <ps_ml@gmx.de> | 2007-11-09 15:15:00 +0000 | 
| commit | 25b815e8dadc69adc91dc3395f0da6af42cebf56 (patch) | |
| tree | cdf9f5fe7fc7e75762ab3073e3f3408273f78b31 | |
| parent | 90f3ffd45a28a5f86d09e8371aa4897b0d91a9f2 (diff) | |
| download | extra-cmake-modules-25b815e8dadc69adc91dc3395f0da6af42cebf56.tar.gz extra-cmake-modules-25b815e8dadc69adc91dc3395f0da6af42cebf56.tar.bz2 | |
this is the current working solution but I couldn't set kate_KDEINIT_SRCS from the macro, that's why it isn't included anymore
svn path=/trunk/KDE/kdelibs/; revision=734672
| -rw-r--r-- | modules/KDE4Macros.cmake | 40 | 
1 files changed, 14 insertions, 26 deletions
| diff --git a/modules/KDE4Macros.cmake b/modules/KDE4Macros.cmake index 92ec5097..376201f3 100644 --- a/modules/KDE4Macros.cmake +++ b/modules/KDE4Macros.cmake @@ -941,44 +941,32 @@ endmacro (KDE4_CREATE_HTML_HANDBOOK)  # adds application icon to target source list -# 'outfiles' - specifies the list of source files -# 'pattern'  - regular expression for searching application icons -# example: KDE4_ADD_WIN32_APP_ICON(myapp_sources "pics/cr*-myapp.png") +#'appname' - an application name +# 'pngfiles' - specifies the list of icon files +# example: KDE4_ADD_WIN32_APP_ICON(myapp "pics/cr16-myapp.png;pics/cr32-myapp.png") -macro (KDE4_ADD_WIN32_APP_ICON outfiles pattern) +macro (KDE4_ADD_WIN32_APP_ICON appname pngfiles)      if (WIN32)          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}) +        if (NOT WINDRES_EXECUTABLE) +            find_program(WINDRES_EXECUTABLE NAMES windres) +        endif (NOT WINDRES_EXECUTABLE) +        if (PNG2ICO_EXECUTABLE AND WINDRES_EXECUTABLE) +            set (_outfilename ${CMAKE_CURRENT_BINARY_DIR}/${appname})              # png2ico is found by the above find_program -            message("png2ico ${_outfilename}.ico ${_icons}") -            exec_program(png2ico ARGS ${_outfilename}.ico ${_icons}) +            message("png2ico ${_outfilename}.ico ${pngfiles}") +            exec_program(png2ico ARGS ${_outfilename}.ico ${pngfiles})              # 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) +                exec_program(windres +                    ARGS "-i ${_outfilename}.rc -o ${_outfilename}_res.o --include-dir=${CMAKE_CURRENT_SOURCE_DIR}")              endif(MINGW) -        endif(PNG2ICO_EXECUTABLE) +        endif(PNG2ICO_EXECUTABLE AND WINDRES_EXECUTABLE)      endif(WIN32)  endmacro (KDE4_ADD_WIN32_APP_ICON) | 
