Generate icns file with cmake (#201)
This commit is contained in:
parent
1cfa8cc339
commit
598faac7ef
2 changed files with 19 additions and 4 deletions
|
|
@ -1281,9 +1281,20 @@ elseif (APPLE)
|
||||||
target_link_libraries(Telegram PRIVATE desktop-app::external_iconv)
|
target_link_libraries(Telegram PRIVATE desktop-app::external_iconv)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(icons_path ${CMAKE_CURRENT_SOURCE_DIR}/Telegram/Images.xcassets)
|
set(appicon_path ${CMAKE_CURRENT_SOURCE_DIR}/Telegram/Images.xcassets/Icon.iconset)
|
||||||
set_target_properties(Telegram PROPERTIES RESOURCE ${icons_path})
|
|
||||||
target_sources(Telegram PRIVATE ${icons_path})
|
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
|
set(lang_packs
|
||||||
en
|
en
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,10 @@
|
||||||
<string>@output_name@</string>
|
<string>@output_name@</string>
|
||||||
<key>CFBundleGetInfoString</key>
|
<key>CFBundleGetInfoString</key>
|
||||||
<string>Telegram Desktop messaging app</string>
|
<string>Telegram Desktop messaging app</string>
|
||||||
|
<key>CFBundleIconFile</key>
|
||||||
|
<string>AppIcon</string>
|
||||||
|
<key>CFBundleIconName</key>
|
||||||
|
<string>AppIcon</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>@bundle_identifier@</string>
|
<string>@bundle_identifier@</string>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
|
|
@ -20,7 +24,7 @@
|
||||||
<key>CFBundleTypeRole</key>
|
<key>CFBundleTypeRole</key>
|
||||||
<string>Viewer</string>
|
<string>Viewer</string>
|
||||||
<key>CFBundleURLIconFile</key>
|
<key>CFBundleURLIconFile</key>
|
||||||
<string>Icon.icns</string>
|
<string>AppIcon</string>
|
||||||
<key>CFBundleURLName</key>
|
<key>CFBundleURLName</key>
|
||||||
<string>@bundle_identifier@</string>
|
<string>@bundle_identifier@</string>
|
||||||
<key>CFBundleURLSchemes</key>
|
<key>CFBundleURLSchemes</key>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue