Generate icns file with cmake (#201)

This commit is contained in:
ilya-fedin 2021-07-25 18:19:40 +00:00 committed by GitHub
parent 1cfa8cc339
commit 598faac7ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 4 deletions

View file

@ -1281,9 +1281,20 @@ elseif (APPLE)
target_link_libraries(Telegram PRIVATE desktop-app::external_iconv)
endif()
set(icons_path ${CMAKE_CURRENT_SOURCE_DIR}/Telegram/Images.xcassets)
set_target_properties(Telegram PROPERTIES RESOURCE ${icons_path})
target_sources(Telegram PRIVATE ${icons_path})
set(appicon_path ${CMAKE_CURRENT_SOURCE_DIR}/Telegram/Images.xcassets/Icon.iconset)
add_custom_command(
OUTPUT AppIcon.icns
COMMAND iconutil
ARGS
--convert icns
--output AppIcon.icns
${appicon_path}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
set_source_files_properties(AppIcon.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
target_sources(Telegram PRIVATE AppIcon.icns)
set(lang_packs
en

View file

@ -6,6 +6,10 @@
<string>@output_name@</string>
<key>CFBundleGetInfoString</key>
<string>Telegram Desktop messaging app</string>
<key>CFBundleIconFile</key>
<string>AppIcon</string>
<key>CFBundleIconName</key>
<string>AppIcon</string>
<key>CFBundleIdentifier</key>
<string>@bundle_identifier@</string>
<key>CFBundlePackageType</key>
@ -20,7 +24,7 @@
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>CFBundleURLIconFile</key>
<string>Icon.icns</string>
<string>AppIcon</string>
<key>CFBundleURLName</key>
<string>@bundle_identifier@</string>
<key>CFBundleURLSchemes</key>