Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-138578

CMake: Allow to generate .icns, .ico files at build time

XMLWordPrintable

    • Icon: User Story User Story
    • Resolution: Unresolved
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • None
    • Build System: CMake
    • None

      Research how we could support generating .ico, .icns files at build time.

      Why?

      .icns and .ico files are both binary files used for representing icons in different resolutions. As such, they can be generated on the fly from image files in different resolutions. Allowing the user to generate them, e.g., from .png files on the fly, would make it easier to update single-resolution files or add new resolution files. In particular, it would also allow sharing images between macOS and iOS bundles (iOS allows for packaging image files in the form of an .xcassets folder).

      Options

      icns: Using xcrun actool

      Qt Creator does generate its .icns file on macOS from a .xcasset directory using native command line tools :

        add_custom_command(
          OUTPUT qtcreator.icns qtcreator-project.icns
          COMMAND
            xcrun actool --app-icon qtcreator --output-partial-info-plist "${CMAKE_CURRENT_BINARY_DIR}/qtcreator.Info.plist"
            --platform macosx --minimum-deployment-target 10.7 --compile "${CMAKE_CURRENT_BINARY_DIR}"
            "${IDE_ICON_PATH}/qtcreator.xcassets"
            > /dev/null
          BYPRODUCTS qtcreator.Info.plist
          DEPENDS
            qtcreator.xcassets/qtcreator.appiconset/Contents.json
            qtcreator.xcassets/qtcreator.appiconset/icon_128x128.png
            ...
      

      icns: Using iconutil tool

      This is the command-line tool recommended in the current Qt documentation. It processes .iconset folders.

      .ico: Using ImageMagick

      ImageMagick is commonly used to create .ico files on Windows.

      Using a Qt native tool

      Qt imageformats does support both .icns and .ico files. Can we provide our own cross-platform binary tool to generate .ico and .icns files?

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qtbuildsystem Qt Build System Team
            kkohne Kai Köhne
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes