diff options
-rw-r--r-- | modules/FindKDE4Internal.cmake | 4 | ||||
-rw-r--r-- | modules/KDE4Macros.cmake | 11 |
2 files changed, 15 insertions, 0 deletions
diff --git a/modules/FindKDE4Internal.cmake b/modules/FindKDE4Internal.cmake index f5d606fe..a0305d87 100644 --- a/modules/FindKDE4Internal.cmake +++ b/modules/FindKDE4Internal.cmake @@ -184,6 +184,10 @@ # KGlobal::dirs()->addResourceDir( "data", KDESRCDIR ); to be able to use xmlgui # and other things in the test, that normally require installation # +# KDE4_UPDATE_ICONCACHE() +# Notifies the icon cache that new icons have been installed by updating +# mtime of ${ICON_INSTALL_DIR}/hicolor directory. +# # KDE4_INSTALL_ICONS( path theme) # Installs all png and svgz files in the current directory to the icon # directoy given in path, in the subdirectory for the given icon theme. diff --git a/modules/KDE4Macros.cmake b/modules/KDE4Macros.cmake index 87acc626..cf7d769f 100644 --- a/modules/KDE4Macros.cmake +++ b/modules/KDE4Macros.cmake @@ -15,6 +15,7 @@ # KDE4_ADD_TEST_EXECUTABLE # KDE4_ADD_EXECUTABLE # KDE4_ADD_WIDGET_FILES +# KDE4_UPDATE_ICONCACHE # KDE4_INSTALL_ICONS # KDE4_REMOVE_OBSOLETE_CMAKE_FILES # KDE4_NO_ENABLE_FINAL @@ -323,6 +324,14 @@ macro (KDE4_CREATE_HTML_HANDBOOK _docbook) endmacro (KDE4_CREATE_HTML_HANDBOOK) +macro (KDE4_UPDATE_ICONCACHE) + # Update mtime of hicolor icon theme dir. + # We don't always have touch command (e.g. on Windows), so instead create + # and delete a temporary file in the theme dir. + install(CODE "file(WRITE \"${ICON_INSTALL_DIR}/hicolor/temp.txt\" \"update\")") + install(CODE "file(REMOVE \"${ICON_INSTALL_DIR}/hicolor/temp.txt\")") +endmacro (KDE4_UPDATE_ICONCACHE) + # a "map" of short type names to the directories # unknown names should give empty results # KDE 3 compatibility @@ -412,6 +421,8 @@ macro (KDE4_INSTALL_ICONS _defaultpath ) endif( _theme_GROUP) endforeach (_current_ICON) + KDE4_UPDATE_ICONCACHE() + endmacro (KDE4_INSTALL_ICONS) |