aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2023-07-14 08:40:06 +0100
committerSimon Tatham <anakin@pobox.com>2023-07-14 08:40:06 +0100
commit6de17a7511bf67e999c450851d5bc9e4892367bb (patch)
tree1d66e9699fbddad9d448c3879639bb9fff6da099
parentc99fbed8c9d957de5b2094b54c7ec7e38979d770 (diff)
downloadpuzzles-6de17a7511bf67e999c450851d5bc9e4892367bb.zip
puzzles-6de17a7511bf67e999c450851d5bc9e4892367bb.tar.gz
puzzles-6de17a7511bf67e999c450851d5bc9e4892367bb.tar.bz2
puzzles-6de17a7511bf67e999c450851d5bc9e4892367bb.tar.xz
Refactor the new icon installation code.
It's horribly repetitive, and we had a list of all the icons' pixel sizes anyway!
-rw-r--r--cmake/platforms/unix.cmake21
1 files changed, 7 insertions, 14 deletions
diff --git a/cmake/platforms/unix.cmake b/cmake/platforms/unix.cmake
index c6916aa..a582d6f 100644
--- a/cmake/platforms/unix.cmake
+++ b/cmake/platforms/unix.cmake
@@ -110,20 +110,13 @@ function(set_platform_puzzle_target_properties NAME TARGET)
install(TARGETS ${TARGET})
endif()
configure_file(${CMAKE_SOURCE_DIR}/puzzle.desktop.in ${binary_name}.desktop)
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/icons/${NAME}-16d24.png
- DESTINATION share/icons/hicolor/16x16/apps OPTIONAL RENAME ${binary_name}.png)
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/icons/${NAME}-24d24.png
- DESTINATION share/icons/hicolor/24x24/apps OPTIONAL RENAME ${binary_name}.png)
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/icons/${NAME}-32d24.png
- DESTINATION share/icons/hicolor/32x32/apps OPTIONAL RENAME ${binary_name}.png)
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/icons/${NAME}-48d24.png
- DESTINATION share/icons/hicolor/48x48/apps OPTIONAL RENAME ${binary_name}.png)
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/icons/${NAME}-64d24.png
- DESTINATION share/icons/hicolor/64x64/apps OPTIONAL RENAME ${binary_name}.png)
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/icons/${NAME}-96d24.png
- DESTINATION share/icons/hicolor/96x96/apps OPTIONAL RENAME ${binary_name}.png)
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/icons/${NAME}-128d24.png
- DESTINATION share/icons/hicolor/128x128/apps OPTIONAL RENAME ${binary_name}.png)
+ foreach(icon_size ${all_icon_sizes})
+ install(
+ FILES ${CMAKE_CURRENT_BINARY_DIR}/icons/${NAME}-${icon_size}d24.png
+ DESTINATION share/icons/hicolor/${icon_size}x${icon_size}/apps
+ OPTIONAL
+ RENAME ${binary_name}.png)
+ endforeach()
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${binary_name}.desktop
DESTINATION share/applications)
endif()