diff options
author | Alex Merry <alex.merry@kde.org> | 2015-10-14 12:10:31 +0100 |
---|---|---|
committer | Alex Merry <alex.merry@kde.org> | 2015-10-20 13:00:49 +0100 |
commit | fb7b8eea7d91772f989d5b060c86df20f2ebdb66 (patch) | |
tree | 7631daf4c7d75676cecbaead90501dc40ddca3a3 | |
parent | 20bf1de42b035eb669d0250f4d549c15f9256e58 (diff) | |
download | extra-cmake-modules-fb7b8eea7d91772f989d5b060c86df20f2ebdb66.tar.gz extra-cmake-modules-fb7b8eea7d91772f989d5b060c86df20f2ebdb66.tar.bz2 |
Fix ECMInstallIconsTest.
ECMInstallIcons now updates the theme cache if gtk-update-icon-cache is
available, producing files the test hadn't been expecting.. Updating the
test revealed that the old-style ecm_install_icons call only updated the
hicolor cache, and not any of the other themes.
REVIEW: 125631
-rw-r--r-- | modules/ECMInstallIcons.cmake | 10 | ||||
-rw-r--r-- | tests/ECMInstallIconsTest/CMakeLists.txt | 7 | ||||
-rw-r--r-- | tests/ECMInstallIconsTest/check_tree.cmake.in | 7 | ||||
-rw-r--r-- | tests/ECMInstallIconsTest/expected-tree/badly-named-files-test/hicolor/icon-theme.cache | bin | 0 -> 124 bytes | |||
-rw-r--r-- | tests/ECMInstallIconsTest/expected-tree/lang-test/hicolor/icon-theme.cache | bin | 0 -> 548 bytes | |||
-rw-r--r-- | tests/ECMInstallIconsTest/expected-tree/multi-file-test/hicolor/icon-theme.cache | bin | 0 -> 472 bytes | |||
-rw-r--r-- | tests/ECMInstallIconsTest/expected-tree/single-file-test/hicolor/icon-theme.cache | bin | 0 -> 120 bytes | |||
-rw-r--r-- | tests/ECMInstallIconsTest/expected-tree/themed-lang-test/oxygen/icon-theme.cache | bin | 0 -> 548 bytes | |||
-rw-r--r-- | tests/ECMInstallIconsTest/expected-tree/themed-test/theme-name-2/icon-theme.cache | bin | 0 -> 472 bytes | |||
-rw-r--r-- | tests/ECMInstallIconsTest/expected-tree/v1-icons/crystalsvg/icon-theme.cache | bin | 0 -> 164 bytes | |||
-rw-r--r-- | tests/ECMInstallIconsTest/expected-tree/v1-icons/hicolor/icon-theme.cache | bin | 0 -> 452 bytes |
11 files changed, 23 insertions, 1 deletions
diff --git a/modules/ECMInstallIcons.cmake b/modules/ECMInstallIcons.cmake index 920c9490..8db486e7 100644 --- a/modules/ECMInstallIcons.cmake +++ b/modules/ECMInstallIcons.cmake @@ -111,6 +111,8 @@ macro(_ecm_install_icons_v1 _defaultpath) set(_l10n_SUBDIR ".") endif(_lang) + set(_themes) + # first the png icons file(GLOB _icons *.png) foreach (_current_ICON ${_icons} ) @@ -123,6 +125,7 @@ macro(_ecm_install_icons_v1 _defaultpath) set(_theme_GROUP ${_ECM_ICON_THEME_${_type}}) if( _theme_GROUP) + list(APPEND _themes "${_theme_GROUP}") _ECM_ADD_ICON_INSTALL_RULE(${CMAKE_CURRENT_BINARY_DIR}/install_icons.cmake ${_defaultpath}/${_theme_GROUP}/${_size}x${_size} ${_group} ${_current_ICON} ${_name} ${_l10n_SUBDIR}) @@ -141,6 +144,7 @@ macro(_ecm_install_icons_v1 _defaultpath) set(_theme_GROUP ${_ECM_ICON_THEME_${_type}}) if( _theme_GROUP) + list(APPEND _themes "${_theme_GROUP}") _ECM_ADD_ICON_INSTALL_RULE(${CMAKE_CURRENT_BINARY_DIR}/install_icons.cmake ${_defaultpath}/${_theme_GROUP}/${_size}x${_size} ${_group} ${_current_ICON} ${_name} ${_l10n_SUBDIR}) @@ -158,13 +162,17 @@ macro(_ecm_install_icons_v1 _defaultpath) set(_theme_GROUP ${_ECM_ICON_THEME_${_type}}) if( _theme_GROUP) + list(APPEND _themes "${_theme_GROUP}") _ECM_ADD_ICON_INSTALL_RULE(${CMAKE_CURRENT_BINARY_DIR}/install_icons.cmake ${_defaultpath}/${_theme_GROUP}/scalable ${_group} ${_current_ICON} ${_name} ${_l10n_SUBDIR}) endif( _theme_GROUP) endforeach (_current_ICON) - _ecm_update_iconcache("${_defaultpath}" hicolor) + list(REMOVE_DUPLICATES _themes) + foreach(_theme ${_themes}) + _ecm_update_iconcache("${_defaultpath}" "${_theme}") + endforeach() endmacro() diff --git a/tests/ECMInstallIconsTest/CMakeLists.txt b/tests/ECMInstallIconsTest/CMakeLists.txt index 7fe4ca35..738cba91 100644 --- a/tests/ECMInstallIconsTest/CMakeLists.txt +++ b/tests/ECMInstallIconsTest/CMakeLists.txt @@ -94,5 +94,12 @@ ecm_install_icons( DESTINATION badly-named-files-test ) +find_program(icon_cache_generator NAMES gtk-update-icon-cache) +if (icon_cache_generator) + set(GENERATE_ICON_CACHE TRUE) +else() + set(GENERATE_ICON_CACHE FALSE) +endif() + # this will be run by CTest configure_file(check_tree.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/check_tree.cmake" @ONLY) diff --git a/tests/ECMInstallIconsTest/check_tree.cmake.in b/tests/ECMInstallIconsTest/check_tree.cmake.in index 6d14246b..b9da1715 100644 --- a/tests/ECMInstallIconsTest/check_tree.cmake.in +++ b/tests/ECMInstallIconsTest/check_tree.cmake.in @@ -1,8 +1,15 @@ set(EXP_TREE "@CMAKE_CURRENT_SOURCE_DIR@/expected-tree") set(ACTUAL_TREE "@CMAKE_INSTALL_PREFIX@") +set(GENERATE_ICON_CACHE "@GENERATE_ICON_CACHE@") file(GLOB_RECURSE exp_files RELATIVE "${EXP_TREE}" "${EXP_TREE}/*") file(GLOB_RECURSE actual_files RELATIVE "${ACTUAL_TREE}" "${ACTUAL_TREE}/*") +if (NOT GENERATE_ICON_CACHE) + file(GLOB_RECURSE cache_files RELATIVE "${EXP_TREE}" "${EXP_TREE}/*.cache") + foreach(f ${cache_files}) + list(REMOVE_ITEM exp_files "${f}") + endforeach() +endif() list(SORT exp_files) list(SORT actual_files) diff --git a/tests/ECMInstallIconsTest/expected-tree/badly-named-files-test/hicolor/icon-theme.cache b/tests/ECMInstallIconsTest/expected-tree/badly-named-files-test/hicolor/icon-theme.cache Binary files differnew file mode 100644 index 00000000..50d52976 --- /dev/null +++ b/tests/ECMInstallIconsTest/expected-tree/badly-named-files-test/hicolor/icon-theme.cache diff --git a/tests/ECMInstallIconsTest/expected-tree/lang-test/hicolor/icon-theme.cache b/tests/ECMInstallIconsTest/expected-tree/lang-test/hicolor/icon-theme.cache Binary files differnew file mode 100644 index 00000000..babadff0 --- /dev/null +++ b/tests/ECMInstallIconsTest/expected-tree/lang-test/hicolor/icon-theme.cache diff --git a/tests/ECMInstallIconsTest/expected-tree/multi-file-test/hicolor/icon-theme.cache b/tests/ECMInstallIconsTest/expected-tree/multi-file-test/hicolor/icon-theme.cache Binary files differnew file mode 100644 index 00000000..60ac05d6 --- /dev/null +++ b/tests/ECMInstallIconsTest/expected-tree/multi-file-test/hicolor/icon-theme.cache diff --git a/tests/ECMInstallIconsTest/expected-tree/single-file-test/hicolor/icon-theme.cache b/tests/ECMInstallIconsTest/expected-tree/single-file-test/hicolor/icon-theme.cache Binary files differnew file mode 100644 index 00000000..f385659f --- /dev/null +++ b/tests/ECMInstallIconsTest/expected-tree/single-file-test/hicolor/icon-theme.cache diff --git a/tests/ECMInstallIconsTest/expected-tree/themed-lang-test/oxygen/icon-theme.cache b/tests/ECMInstallIconsTest/expected-tree/themed-lang-test/oxygen/icon-theme.cache Binary files differnew file mode 100644 index 00000000..babadff0 --- /dev/null +++ b/tests/ECMInstallIconsTest/expected-tree/themed-lang-test/oxygen/icon-theme.cache diff --git a/tests/ECMInstallIconsTest/expected-tree/themed-test/theme-name-2/icon-theme.cache b/tests/ECMInstallIconsTest/expected-tree/themed-test/theme-name-2/icon-theme.cache Binary files differnew file mode 100644 index 00000000..60ac05d6 --- /dev/null +++ b/tests/ECMInstallIconsTest/expected-tree/themed-test/theme-name-2/icon-theme.cache diff --git a/tests/ECMInstallIconsTest/expected-tree/v1-icons/crystalsvg/icon-theme.cache b/tests/ECMInstallIconsTest/expected-tree/v1-icons/crystalsvg/icon-theme.cache Binary files differnew file mode 100644 index 00000000..8b9c8d0c --- /dev/null +++ b/tests/ECMInstallIconsTest/expected-tree/v1-icons/crystalsvg/icon-theme.cache diff --git a/tests/ECMInstallIconsTest/expected-tree/v1-icons/hicolor/icon-theme.cache b/tests/ECMInstallIconsTest/expected-tree/v1-icons/hicolor/icon-theme.cache Binary files differnew file mode 100644 index 00000000..ab56337b --- /dev/null +++ b/tests/ECMInstallIconsTest/expected-tree/v1-icons/hicolor/icon-theme.cache |