aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorRivo Laks <rivolaks@hot.ee>2007-07-24 19:03:50 +0000
committerRivo Laks <rivolaks@hot.ee>2007-07-24 19:03:50 +0000
commit820f870c30d2c33ec9af47237573e44c526d406f (patch)
tree62a19bc82506ca15b3835b7600d72ae793257975 /modules
parentfda274b64c61ae5a65153af082c40a454f696d1c (diff)
downloadextra-cmake-modules-820f870c30d2c33ec9af47237573e44c526d406f.tar.gz
extra-cmake-modules-820f870c30d2c33ec9af47237573e44c526d406f.tar.bz2
Add KDE4_UPDATE_ICONCACHE() macro and call it from KDE4_INSTALL_ICONS()
svn path=/trunk/KDE/kdelibs/; revision=691973
Diffstat (limited to 'modules')
-rw-r--r--modules/FindKDE4Internal.cmake4
-rw-r--r--modules/KDE4Macros.cmake11
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)