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

CMake should support generation of Windows resource (RC) file

    XMLWordPrintable

Details

    • Windows

    Description

      With QMake, setting properties such as RC_ICONS, QMAKE_TARGET_PRODUCT, QMAKE_TARGET_COMPANY, and QMAKE_TARGET_COPYRIGHT would auto-generate an RC file for a Windows executable with the specified options. This could e.g. be used to set an application icon as documented.

      With CMake this is no longer officially supported, and instead the documentation suggests to write your own RC file, which is cumbersome.

      However, I found that using an internal Qt CMake macro it is still supported like this:

      set_target_properties(${PROJECT_NAME} PROPERTIES
          QT_TARGET_COMPANY_NAME "..."
          QT_TARGET_DESCRIPTION "..."
          QT_TARGET_VERSION ...
          QT_TARGET_COPYRIGHT "..."
          QT_TARGET_PRODUCT_NAME "..."
          QT_TARGET_RC_ICONS "..."
      )
      
      if(WIN32)
          _qt_internal_generate_win32_rc_file(${PROJECT_NAME})
      endif()

      This macro should be called automatically and the target options officially documented.

       

      Attachments

        Issue Links

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

          Activity

            People

              qtbuildsystem Qt Build System Team
              fseiffert Frederik Seiffert
              Votes:
              2 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes