Description: Install hicolor icons
Author: Boris Pek <tehnick-8@yandex.ru>
Last-Update: 2021-02-03
Forwarded: https://github.com/psi-im/psi/commit/ff7b8b01


--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -477,15 +477,28 @@
 
 #INSTALL SECTION
 if(LINUX)
+        if(NOT VERBOSED_NAME)
+            set(VERBOSED_NAME ${PROJECT_NAME})
+        endif()
+	set(DATA_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share")
+	set(ICONS_INSTALL_PREFIX "${DATA_INSTALL_DIR}/icons/hicolor")
+	set(RESOLUTIONS 16 32 48 64 128)
 	if(IS_PSIPLUS)
 		set(SHARE_SUFF "share/psi-plus")
+		set(PSI_LOGO_PREFIX ${PROJECT_SOURCE_DIR}/iconsets/system/default/psiplus)
 		install(FILES ${PROJECT_SOURCE_DIR}/psi.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications RENAME psi-plus.desktop)
 		install(FILES ${PROJECT_SOURCE_DIR}/iconsets/system/default/psiplus/logo_128.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/pixmaps RENAME psi-plus.png)
 	else()
 		set(SHARE_SUFF "share/psi")
+		set(PSI_LOGO_PREFIX ${PROJECT_SOURCE_DIR}/iconsets/system/default)
 		install(FILES ${PROJECT_SOURCE_DIR}/psi.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications)
 		install(FILES ${PROJECT_SOURCE_DIR}/iconsets/system/default/logo_128.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/pixmaps RENAME psi.png)
 	endif()
+	foreach(resolution ${RESOLUTIONS})
+		unset(LOGO_NAME)
+		set(LOGO_NAME "${PSI_LOGO_PREFIX}/logo_${resolution}.png")
+		install(FILES ${LOGO_NAME} DESTINATION "${ICONS_INSTALL_PREFIX}/${resolution}x${resolution}/apps" RENAME ${VERBOSED_NAME}.png)
+	endforeach()
 	install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
 	install(FILES ${PROJECT_SOURCE_DIR}/client_icons.txt DESTINATION ${CMAKE_INSTALL_PREFIX}/${SHARE_SUFF})
 	install(DIRECTORY ${OTHER_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/${SHARE_SUFF})
