From 822dbbc7c67fb443f0f1bad4c2a906372679a503 Mon Sep 17 00:00:00 2001 From: Laurent Montel Date: Wed, 26 Jul 2006 12:53:45 +0000 Subject: Improve icon macro: Install just icon which is into good theme. But For me it will better to not specify theme name and use prefix of icon to add into good theme dir. I will wait Alexx to discute about it. I comment debug to see errors about icons Now all icons are installed into good directory Becarefull if we uncommente it it returns false true. svn path=/trunk/KDE/kdelibs/; revision=566519 --- modules/KDE4Macros.cmake | 81 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 69 insertions(+), 12 deletions(-) (limited to 'modules/KDE4Macros.cmake') diff --git a/modules/KDE4Macros.cmake b/modules/KDE4Macros.cmake index 40513c02..acf82128 100644 --- a/modules/KDE4Macros.cmake +++ b/modules/KDE4Macros.cmake @@ -223,23 +223,80 @@ MACRO (KDE4_INSTALL_ICONS _defaultpath _theme ) # first the png icons FILE(GLOB _icons *.png) foreach (_current_ICON ${_icons} ) - STRING(REGEX REPLACE "^.*/[a-zA-Z]+([0-9]+)\\-([a-z]+)\\-(.+\\.png)$" "\\1" _size "${_current_ICON}") - STRING(REGEX REPLACE "^.*/[a-zA-Z]+([0-9]+)\\-([a-z]+)\\-(.+\\.png)$" "\\2" _group "${_current_ICON}") - STRING(REGEX REPLACE "^.*/[a-zA-Z]+([0-9]+)\\-([a-z]+)\\-(.+\\.png)$" "\\3" _name "${_current_ICON}") - _KDE4_ADD_ICON_INSTALL_RULE(${CMAKE_CURRENT_BINARY_DIR}/install_icons.cmake - ${_defaultpath}/${_theme}/${_size}x${_size} - ${_group} ${_current_ICON} ${_name}) + STRING(REGEX REPLACE "^.*/([a-zA-Z]+)([0-9]+)\\-([a-z]+)\\-(.+\\.png)$" "\\1" _type "${_current_ICON}") + STRING(REGEX REPLACE "^.*/([a-zA-Z]+)([0-9]+)\\-([a-z]+)\\-(.+\\.png)$" "\\2" _size "${_current_ICON}") + STRING(REGEX REPLACE "^.*/([a-zA-Z]+)([0-9]+)\\-([a-z]+)\\-(.+\\.png)$" "\\3" _group "${_current_ICON}") + STRING(REGEX REPLACE "^.*/([a-zA-Z]+)([0-9]+)\\-([a-z]+)\\-(.+\\.png)$" "\\4" _name "${_current_ICON}") + + if( ${_type} STREQUAL "cr" ) + if(${_theme} STREQUAL "crystalsvg" ) + _KDE4_ADD_ICON_INSTALL_RULE(${CMAKE_CURRENT_BINARY_DIR}/install_icons.cmake + ${_defaultpath}/${_theme}/${_size}x${_size} + ${_group} ${_current_ICON} ${_name}) + #else(${_theme} STREQUAL "crystalsvg" ) + #MESSAGE(STATUS "icon : ${_current_ICON} is not put into good theme directory ${_theme}") + endif(${_theme} STREQUAL "crystalsvg" ) + endif(${_type} STREQUAL "cr" ) + + if( ${_type} STREQUAL "lo" ) + if(${_theme} STREQUAL "locolor" ) + _KDE4_ADD_ICON_INSTALL_RULE(${CMAKE_CURRENT_BINARY_DIR}/install_icons.cmake + ${_defaultpath}/${_theme}/${_size}x${_size}· + ${_group} ${_current_ICON} ${_name}) + #else(${_theme} STREQUAL "locolor" ) + # MESSAGE(STATUS "icon : ${_current_ICON} is not put into good theme directory ${_theme}") + endif(${_theme} STREQUAL "locolor" ) + endif(${_type} STREQUAL "lo" ) + + if( ${_type} STREQUAL "hi" ) + if( ${_theme} STREQUAL "hicolor" ) + _KDE4_ADD_ICON_INSTALL_RULE(${CMAKE_CURRENT_BINARY_DIR}/install_icons.cmake + ${_defaultpath}/${_theme}/${_size}x${_size}· + ${_group} ${_current_ICON} ${_name}) + #else(${_theme} STREQUAL "hicolor" ) + # MESSAGE(STATUS "icon : ${_current_ICON} is not put into good theme directory ${_theme}") + endif(${_theme} STREQUAL "hicolor" ) + endif(${_type} STREQUAL "hi" ) + ENDforeach (_current_ICON) # mng icons FILE(GLOB _icons *.mng) foreach (_current_ICON ${_icons} ) - STRING(REGEX REPLACE "^.*/[a-zA-Z]+([0-9]+)\\-([a-z]+)\\-(.+\\.mng)$" "\\1" _size "${_current_ICON}") - STRING(REGEX REPLACE "^.*/[a-zA-Z]+([0-9]+)\\-([a-z]+)\\-(.+\\.mng)$" "\\2" _group "${_current_ICON}") - STRING(REGEX REPLACE "^.*/[a-zA-Z]+([0-9]+)\\-([a-z]+)\\-(.+\\.mng)$" "\\3" _name "${_current_ICON}") - _KDE4_ADD_ICON_INSTALL_RULE(${CMAKE_CURRENT_BINARY_DIR}/install_icons.cmake - ${_defaultpath}/${_theme}/${_size}x${_size} - ${_group} ${_current_ICON} ${_name}) + STRING(REGEX REPLACE "^.*/([a-zA-Z]+)([0-9]+)\\-([a-z]+)\\-(.+\\.png)$" "\\1" _type "${_current_ICON}") + STRING(REGEX REPLACE "^.*/([a-zA-Z]+)([0-9]+)\\-([a-z]+)\\-(.+\\.mng)$" "\\2" _size "${_current_ICON}") + STRING(REGEX REPLACE "^.*/([a-zA-Z]+)([0-9]+)\\-([a-z]+)\\-(.+\\.mng)$" "\\3" _group "${_current_ICON}") + STRING(REGEX REPLACE "^.*/([a-zA-Z]+)([0-9]+)\\-([a-z]+)\\-(.+\\.mng)$" "\\4" _name "${_current_ICON}") + if( ${_type} STREQUAL "cr" ) + if( ${_theme} STREQUAL "crystalsvg" ) + _KDE4_ADD_ICON_INSTALL_RULE(${CMAKE_CURRENT_BINARY_DIR}/install_icons.cmake + ${_defaultpath}/${_theme}/${_size}x${_size} + ${_group} ${_current_ICON} ${_name}) + #else( ${_theme} STREQUAL "crystalsvg" ) + #MESSAGE(STATUS "icon : ${_current_ICON} is not put into good theme directory ${_theme}") + endif( ${_theme} STREQUAL "crystalsvg" ) + endif(${_type} STREQUAL "cr" ) + + if( ${_type} STREQUAL "lo" ) + if( ${_theme} STREQUAL "locolor" ) + _KDE4_ADD_ICON_INSTALL_RULE(${CMAKE_CURRENT_BINARY_DIR}/install_icons.cmake + ${_defaultpath}/${_theme}/${_size}x${_size} + ${_group} ${_current_ICON} ${_name}) + #else(${_theme} STREQUAL "locolor" ) + # MESSAGE(STATUS "icon : ${_current_ICON} is not put into good theme directory ${_theme}") + endif(${_theme} STREQUAL "locolor" ) + endif(${_type} STREQUAL "lo" ) + + if( ${_type} STREQUAL "hi" ) + if(${_theme} STREQUAL "hicolor" ) + _KDE4_ADD_ICON_INSTALL_RULE(${CMAKE_CURRENT_BINARY_DIR}/install_icons.cmake + ${_defaultpath}/${_theme}/${_size}x${_size} + ${_group} ${_current_ICON} ${_name}) + else(${_theme} STREQUAL "hicolor" ) + # MESSAGE(STATUS "icon : ${_current_ICON} is not put into good theme directory ${_theme}") + #endif(${_theme} STREQUAL "hicolor" ) + endif(${_type} STREQUAL "hi" ) + ENDforeach (_current_ICON) -- cgit v1.2.1