diff --git a/CMakeLists.txt b/CMakeLists.txt index d7ef4044..8435c160 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,13 +11,14 @@ if(USE_KDE4) add_subdirectory(kstyle) else() find_package(ECM 0.0.9 REQUIRED NO_MODULE) - set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) + set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_SOURCE_DIR}/cmake) include(ECMInstallIcons) include(KDEInstallDirs) include(KDECMakeSettings) include(KDECompilerSettings) include(GenerateExportHeader) + include(GtkUpdateIconCache) add_subdirectory(cursors) add_subdirectory(icons) diff --git a/cmake/GtkUpdateIconCache.cmake b/cmake/GtkUpdateIconCache.cmake new file mode 100644 index 00000000..4be82c7b --- /dev/null +++ b/cmake/GtkUpdateIconCache.cmake @@ -0,0 +1,21 @@ +# Copyright 2015 Volker Krause +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file COPYING-CMAKE-SCRIPTS for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. + +find_program(GTK_UPDATE_ICON_CACHE_EXECUTABLE NAMES gtk-update-icon-cache) + +macro(gtk_update_icon_cache _dir) + if (GTK_UPDATE_ICON_CACHE_EXECUTABLE) + install(CODE " + set(DESTDIR_VALUE \"\$ENV{DESTDIR}\") + if (NOT DESTDIR_VALUE) + execute_process(COMMAND ${GTK_UPDATE_ICON_CACHE_EXECUTABLE} -q -i . WORKING_DIRECTORY ${_dir}) + endif() + ") + endif() +endmacro() diff --git a/icons-dark/CMakeLists.txt b/icons-dark/CMakeLists.txt index 9793950d..6e20fb67 100644 --- a/icons-dark/CMakeLists.txt +++ b/icons-dark/CMakeLists.txt @@ -18,4 +18,4 @@ set(BREEZE_INSTALL_DIR ${ICON_INSTALL_DIR}/breeze-dark) install( DIRECTORY ${breeze_icon_dark_dirs} DESTINATION ${BREEZE_INSTALL_DIR} PATTERN "*.sh" EXCLUDE ) install( FILES index.theme DESTINATION ${BREEZE_INSTALL_DIR}) - +gtk_update_icon_cache(${BREEZE_INSTALL_DIR}) diff --git a/icons/CMakeLists.txt b/icons/CMakeLists.txt index 814b5ade..6c6e3b7e 100644 --- a/icons/CMakeLists.txt +++ b/icons/CMakeLists.txt @@ -18,4 +18,4 @@ set(BREEZE_INSTALL_DIR ${ICON_INSTALL_DIR}/breeze) install( DIRECTORY ${breeze_icon_dirs} DESTINATION ${BREEZE_INSTALL_DIR} PATTERN "*.sh" EXCLUDE ) install( FILES index.theme DESTINATION ${BREEZE_INSTALL_DIR}) - +gtk_update_icon_cache(${BREEZE_INSTALL_DIR})