aboutsummaryrefslogtreecommitdiff
path: root/modules/KDE4Macros.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'modules/KDE4Macros.cmake')
-rw-r--r--modules/KDE4Macros.cmake54
1 files changed, 34 insertions, 20 deletions
diff --git a/modules/KDE4Macros.cmake b/modules/KDE4Macros.cmake
index 3c785edc..fe08faa2 100644
--- a/modules/KDE4Macros.cmake
+++ b/modules/KDE4Macros.cmake
@@ -270,7 +270,9 @@ macro (KDE4_CREATE_HANDBOOK _docbook)
DEPENDS ${_docs} ${_KDE4_MEINPROC_EXECUTABLE_DEP} ${_ssheet}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
- add_custom_target(handbook ALL DEPENDS ${_doc})
+ get_filename_component(_targ ${CMAKE_CURRENT_SOURCE_DIR} NAME)
+ set(_targ "${_targ}-handbook")
+ add_custom_target(${_targ} ALL DEPENDS ${_doc})
if(KDE4_ENABLE_HTMLHANDBOOK)
set(_htmlDoc ${CMAKE_CURRENT_SOURCE_DIR}/index.html)
@@ -336,7 +338,9 @@ macro (KDE4_CREATE_MANPAGE _docbook _section)
COMMAND ${KDE4_MEINPROC_EXECUTABLE} --stylesheet ${_ssheet} --check ${_bootstrapOption} ${_input}
DEPENDS ${_input} ${_KDE4_MEINPROC_EXECUTABLE_DEP} ${_ssheet}
)
- add_custom_target(manpage ALL DEPENDS "${_outdoc}")
+ get_filename_component(_targ ${CMAKE_CURRENT_SOURCE_DIR} NAME)
+ set(_targ "${_targ}-manpage")
+ add_custom_target(${_targ} ALL DEPENDS "${_outdoc}")
set(_args ${ARGN})
@@ -406,7 +410,7 @@ set(_KDE4_ICON_THEME_hi "hicolor")
# 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 +418,8 @@ macro (_KDE4_ADD_ICON_INSTALL_RULE _install_SCRIPT _install_PATH _group _orig_NA
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 +427,14 @@ endmacro (_KDE4_ADD_ICON_INSTALL_RULE)
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 +447,7 @@ macro (KDE4_INSTALL_ICONS _defaultpath )
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 +463,7 @@ macro (KDE4_INSTALL_ICONS _defaultpath )
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 +478,7 @@ macro (KDE4_INSTALL_ICONS _defaultpath )
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)
@@ -1023,24 +1035,26 @@ macro (KDE4_ADD_APP_ICON appsources pattern)
set(WINDRES_EXECUTABLE TRUE)
endif(MSVC)
if (PNG2ICO_EXECUTABLE AND WINDRES_EXECUTABLE)
+ string(REPLACE "*" "(.*)" pattern_rx "${pattern}")
file(GLOB_RECURSE files "${pattern}")
- FOREACH (it ${files})
- if (it MATCHES ".*16.*" )
+ foreach (it ${files})
+ string(REGEX REPLACE "${pattern_rx}" "\\1" fn "${it}")
+ if (fn MATCHES ".*16.*" )
list (APPEND _icons ${it})
- endif (it MATCHES ".*16.*")
- if (it MATCHES ".*32.*" )
+ endif (fn MATCHES ".*16.*")
+ if (fn MATCHES ".*32.*" )
list (APPEND _icons ${it})
- endif (it MATCHES ".*32.*")
- if (it MATCHES ".*48.*" )
+ endif (fn MATCHES ".*32.*")
+ if (fn MATCHES ".*48.*" )
list (APPEND _icons ${it})
- endif (it MATCHES ".*48.*")
- if (it MATCHES ".*64.*" )
+ endif (fn MATCHES ".*48.*")
+ if (fn MATCHES ".*64.*" )
list (APPEND _icons ${it})
- endif (it MATCHES ".*64.*")
- if (it MATCHES ".*128.*" )
+ endif (fn MATCHES ".*64.*")
+ if (fn MATCHES ".*128.*" )
list (APPEND _icons ${it})
- endif (it MATCHES ".*128.*")
- ENDFOREACH (it)
+ endif (fn MATCHES ".*128.*")
+ endforeach (it)
if (_icons)
set (_outfilename ${CMAKE_CURRENT_BINARY_DIR}/${target})
add_custom_command(OUTPUT ${_outfilename}.ico ${_outfilename}.rc