mirror of
https://github.com/transmission/transmission
synced 2025-01-30 19:03:04 +00:00
Generate app icon file for CMake build
TODO: Look into switching to .car file for all resources. Fixes: #1672
This commit is contained in:
parent
28b0e53006
commit
faafc9e02f
1 changed files with 32 additions and 1 deletions
|
@ -9,6 +9,7 @@ else()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_program(IBTOOL_EXECUTABLE ibtool REQUIRED)
|
find_program(IBTOOL_EXECUTABLE ibtool REQUIRED)
|
||||||
|
find_program(ICONUTIL_EXECUTABLE iconutil REQUIRED)
|
||||||
find_program(TIFFUTIL_EXECUTABLE tiffutil REQUIRED)
|
find_program(TIFFUTIL_EXECUTABLE tiffutil REQUIRED)
|
||||||
find_program(INSTALL_NAME_TOOL_EXECUTABLE install_name_tool REQUIRED)
|
find_program(INSTALL_NAME_TOOL_EXECUTABLE install_name_tool REQUIRED)
|
||||||
|
|
||||||
|
@ -195,12 +196,42 @@ set(${PROJECT_NAME}_XIB_FILES
|
||||||
URLSheetWindow.xib
|
URLSheetWindow.xib
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set(APPICONSET_DIR "${PROJECT_SOURCE_DIR}/Images/Images.xcassets/AppIcon.appiconset")
|
||||||
|
set(APPICON_FILE "${PROJECT_BINARY_DIR}/Transmission.icns")
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT "${APPICON_FILE}"
|
||||||
|
COMMAND "${CMAKE_COMMAND}" -E rm -f
|
||||||
|
"${PROJECT_BINARY_DIR}/Transmission.iconset"
|
||||||
|
COMMAND "${CMAKE_COMMAND}" -E copy_directory
|
||||||
|
"${APPICONSET_DIR}"
|
||||||
|
"${PROJECT_BINARY_DIR}/Transmission.iconset"
|
||||||
|
COMMAND "${CMAKE_COMMAND}" -E rm
|
||||||
|
"${PROJECT_BINARY_DIR}/Transmission.iconset/Contents.json"
|
||||||
|
COMMAND "${ICONUTIL_EXECUTABLE}"
|
||||||
|
--convert icns
|
||||||
|
--output "${APPICON_FILE}"
|
||||||
|
"${PROJECT_BINARY_DIR}/Transmission.iconset"
|
||||||
|
DEPENDS
|
||||||
|
"${APPICONSET_DIR}/icon_128x128.png"
|
||||||
|
"${APPICONSET_DIR}/icon_128x128@2x.png"
|
||||||
|
"${APPICONSET_DIR}/icon_16x16.png"
|
||||||
|
"${APPICONSET_DIR}/icon_16x16@2x.png"
|
||||||
|
"${APPICONSET_DIR}/icon_256x256.png"
|
||||||
|
"${APPICONSET_DIR}/icon_256x256@2x.png"
|
||||||
|
"${APPICONSET_DIR}/icon_32x32.png"
|
||||||
|
"${APPICONSET_DIR}/icon_32x32@2x.png"
|
||||||
|
"${APPICONSET_DIR}/icon_512x512.png"
|
||||||
|
"${APPICONSET_DIR}/icon_512x512@2x.png"
|
||||||
|
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
|
||||||
|
VERBATIM
|
||||||
|
)
|
||||||
|
|
||||||
set(${PROJECT_NAME}_RESOURCES
|
set(${PROJECT_NAME}_RESOURCES
|
||||||
Defaults.plist
|
Defaults.plist
|
||||||
Credits.rtf
|
Credits.rtf
|
||||||
sparkle_dsa_pub.pem
|
sparkle_dsa_pub.pem
|
||||||
../COPYING
|
../COPYING
|
||||||
Images/Transmission.icns
|
"${APPICON_FILE}"
|
||||||
Images/TransmissionDocument.icns
|
Images/TransmissionDocument.icns
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue