KDE4_INSTALL_ICONS does some fancy stuff with paths and names when installing icons, so I need it to support installing localized icons too. The possibility for these has been introduced by the new KLocale::localizedFilePath() method, http://api.kde.org/4.x-api/kdelibs-apidocs/kdecore/html/classKLocale.html#975b34c99346748abe454a20efaf2757 which is used within KIconLoader.
The patch just enables the macro to be called with optional language code
argument, e.g:
kde4_install_icons( ${DATA_INSTALL_DIR}/foo/bar de )
in the directory with localized icons, which will then be installed into
<paths_resolved_as_usual>/l10n/de.
The changes in the patch should be non-invasive enough, but... :)
--
Chusslove Illich (Часлав Илић)
Index: kdelibs/cmake/modules/KDE4Macros.cmake
===================================================================
--- kdelibs/cmake/modules/KDE4Macros.cmake (revision 763261)
+++ kdelibs/cmake/modules/KDE4Macros.cmake (working copy)
@@ -406,7 +406,7 @@
# only used internally by KDE4_INSTALL_ICONS
-macro (_KDE4_ADD_ICON_INSTALL_RULE _install_SCRIPT _install_PATH _group _orig_NAME _install_NAME)
+macro (_KDE4_ADD_ICON_INSTALL_RULE _install_SCRIPT _install_PATH _group _orig_NAME _install_NAME _l10n_SUBDIR)
# if the string doesn't match the pattern, the result is the full string, so all three have the same content
if (NOT ${_group} STREQUAL ${_install_NAME} )
@@ -414,8 +414,8 @@
if(NOT _icon_GROUP)
set(_icon_GROUP "actions")
endif(NOT _icon_GROUP)
-# message(STATUS "icon: ${_current_ICON} size: ${_size} group: ${_group} name: ${_name}" )
- install(FILES ${_orig_NAME} DESTINATION ${_install_PATH}/${_icon_GROUP}/ RENAME ${_install_NAME} )
+# message(STATUS "icon: ${_current_ICON} size: ${_size} group: ${_group} name: ${_name} l10n: ${_l10n_SUBDIR}")
+ install(FILES ${_orig_NAME} DESTINATION ${_install_PATH}/${_icon_GROUP}/${_l10n_SUBDIR}/ RENAME ${_install_NAME} )
endif (NOT ${_group} STREQUAL ${_install_NAME} )
endmacro (_KDE4_ADD_ICON_INSTALL_RULE)
@@ -423,6 +423,14 @@
macro (KDE4_INSTALL_ICONS _defaultpath )
+ # the l10n-subdir if language given as second argument (localized icon)
+ set(_lang ${ARGV1})
+ if(_lang)
+ set(_l10n_SUBDIR l10n/${_lang})
+ else(_lang)
+ set(_l10n_SUBDIR ".")
+ endif(_lang)
+
# first the png icons
file(GLOB _icons *.png)
foreach (_current_ICON ${_icons} )
@@ -435,7 +443,7 @@
if( _theme_GROUP)
_KDE4_ADD_ICON_INSTALL_RULE(${CMAKE_CURRENT_BINARY_DIR}/install_icons.cmake
${_defaultpath}/${_theme_GROUP}/${_size}x${_size}
- ${_group} ${_current_ICON} ${_name})
+ ${_group} ${_current_ICON} ${_name} ${_l10n_SUBDIR})
endif( _theme_GROUP)
endforeach (_current_ICON)
@@ -451,7 +459,7 @@
if( _theme_GROUP)
_KDE4_ADD_ICON_INSTALL_RULE(${CMAKE_CURRENT_BINARY_DIR}/install_icons.cmake
${_defaultpath}/${_theme_GROUP}/${_size}x${_size}
- ${_group} ${_current_ICON} ${_name})
+ ${_group} ${_current_ICON} ${_name} ${_l10n_SUBDIR})
endif( _theme_GROUP)
endforeach (_current_ICON)
@@ -466,7 +474,7 @@
if( _theme_GROUP)
_KDE4_ADD_ICON_INSTALL_RULE(${CMAKE_CURRENT_BINARY_DIR}/install_icons.cmake
${_defaultpath}/${_theme_GROUP}/scalable
- ${_group} ${_current_ICON} ${_name})
+ ${_group} ${_current_ICON} ${_name} ${_l10n_SUBDIR})
endif( _theme_GROUP)
endforeach (_current_ICON)
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Kde-buildsystem mailing list [email protected] https://mail.kde.org/mailman/listinfo/kde-buildsystem
