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

Automatically set bundle version properties for CMake iOS app projects

    XMLWordPrintable

Details

    • iOS/tvOS/watchOS
    • b5d833730e758c63cdaf48c584e069bb82e68e38 (qt/qtbase/dev) 38a3f0a33cbbdc011da281cfe8f819c8014355cc (qt/qtbase/6.2)

    Description

      When building a Qt example CMake project targeting the iOS simulator, Xcode fails to deploy the project to the simulator with the error

      The application's Info.plist does not contain CFBundleVersion.
      Ensure your bundle contains a CFBundleVersion.
      
      Failed to install the requested application
      Domain: NSPOSIXErrorDomain
      Code: 22
      Failure Reason: The application's Info.plist does not contain CFBundleVersion.
      Recovery Suggestion: Ensure your bundle contains a CFBundleVersion.
      

      There's a similar requirement when targeting a real iOS device.

      The bundle version can be specified with the following target properties

      MACOSX_BUNDLE_BUNDLE_VERSION
      MACOSX_BUNDLE_LONG_VERSION_STRING
      MACOSX_BUNDLE_SHORT_VERSION_STRING
      

      https://cmake.org/cmake/help/latest/prop_tgt/MACOSX_BUNDLE_INFO_PLIST.html

      Currently Qt Creator has wizards where these properties are set in the newly generated project.

      https://codereview.qt-project.org/c/qt-creator/qt-creator/+/334230/2/share/qtcreator/templates/wizards/projects/qtquickapplication/CMakeLists.txt#76

      This is nice, except for the fact that almost none of our pre-existing Qt CMake examples set these properties, so they don't build / launch out of the box.

      We should try to augment _qt_internal_finalize_ios_app to set some default version numbers if the user hasn't specified them yet, to make the out-of-the-box iOS experience nicer.

      Attachments

        Issue Links

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

          Activity

            People

              alexandru.croitor Alexandru Croitor
              alexandru.croitor Alexandru Croitor
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes