aboutsummaryrefslogtreecommitdiff
path: root/modules/KDE4Macros.cmake
diff options
context:
space:
mode:
authorLaurent Montel <montel@kde.org>2006-07-26 12:53:45 +0000
committerLaurent Montel <montel@kde.org>2006-07-26 12:53:45 +0000
commit822dbbc7c67fb443f0f1bad4c2a906372679a503 (patch)
treef2a255364ed98032164e6c4634a97c2f522ef21e /modules/KDE4Macros.cmake
parent85aabf8054acef5660b8ae7c6551a9bbfbc41f39 (diff)
downloadextra-cmake-modules-822dbbc7c67fb443f0f1bad4c2a906372679a503.tar.gz
extra-cmake-modules-822dbbc7c67fb443f0f1bad4c2a906372679a503.tar.bz2
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
Diffstat (limited to 'modules/KDE4Macros.cmake')
-rw-r--r--modules/KDE4Macros.cmake81
1 files changed, 69 insertions, 12 deletions
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)