Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. iOS: can I define PRODUCT_NAME (as used in Info.plist) in qmake .pro file
QtWS25 Last Chance

iOS: can I define PRODUCT_NAME (as used in Info.plist) in qmake .pro file

Scheduled Pinned Locked Moved Solved Mobile and Embedded
5 Posts 4 Posters 1.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Marc_Van_Daele
    wrote on 19 Aug 2019, 17:17 last edited by
    #1

    When deploying to an IOS device, the Info.plist contains an entry like

    <key>CFBundleDisplayName</key>
    <string>${PRODUCT_NAME}</string>
    

    Can I define PRODUCT_NAME somehow in the qmake .pro file (eg using PRODUCT_NAME=MyApp) or do I have to modify the Info.plist file directly?

    J 1 Reply Last reply 20 Aug 2019, 05:07
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 19 Aug 2019, 19:05 last edited by
      #2

      Hi,

      Is it a custom Info.plist file you are using ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kuzulis
        Qt Champions 2020
        wrote on 19 Aug 2019, 19:16 last edited by kuzulis
        #3

        We did this in this way:

        1. Create file 'Info.plist.in' with this content:
        ...
        	<key>CFBundleDisplayName</key>
        	<string>$$MY_COOL_PRODUCT_NAME</string>
        ...
        
        1. Create *.pro file with this content:
        ...
        ...
        
        MY_COOL_PRODUCT_NAME = MyCoolProduct
        ...
        
        } else:ios {
            # This is a workaround for the bug QTBUG-70072 for Qt 5.11.1.
            load(default_post.prf)
        ...
            info_plist.input = ios/Info.plist.in
            info_plist.output = $$OUT_PWD/Info.plist
            QMAKE_SUBSTITUTES += info_plist
            QMAKE_INFO_PLIST = $$OUT_PWD/Info.plist
        ...
        } else {
        

        But it was for Qt 5.11.1, as I remember... I don't know how it will be for a newest Qt... Maybe it was fixed in a simple way.

        1 Reply Last reply
        1
        • M Marc_Van_Daele
          19 Aug 2019, 17:17

          When deploying to an IOS device, the Info.plist contains an entry like

          <key>CFBundleDisplayName</key>
          <string>${PRODUCT_NAME}</string>
          

          Can I define PRODUCT_NAME somehow in the qmake .pro file (eg using PRODUCT_NAME=MyApp) or do I have to modify the Info.plist file directly?

          J Offline
          J Offline
          J.Hilk
          Moderators
          wrote on 20 Aug 2019, 05:07 last edited by
          #4

          @marc_van_daele
          usually the replace string to the key <key>CFBundleDisplayName</key> is

          <string>${PRODUCT_NAME}</string>

          And that one is constructed via

          TARGET and QMAKE_TARGET_BUNDLE_PREFIX

          so:
          TARGET = myApp
          QMAKE_TARGET_BUNDLE_PREFIX = xx.myCompany

          results in the bundle display name: xx.myCompany.myApp


          Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


          Q: What's that?
          A: It's blue light.
          Q: What does it do?
          A: It turns blue.

          1 Reply Last reply
          0
          • M Offline
            M Offline
            Marc_Van_Daele
            wrote on 21 Aug 2019, 18:17 last edited by
            #5

            @SGaist I indeed have a custom Info.plist

            @kuzulis This approach works indeed. Only drawback is that I have to escape all '"' in the Info.plist since otherwise, QMAKE_SUBSTITUTES removes them

            @J-Hilk Using TARGET indeed works and seems, to me, right now, the easiest solution.

            1 Reply Last reply
            1

            5/5

            21 Aug 2019, 18:17

            • Login

            • Login or register to search.
            5 out of 5
            • First post
              5/5
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved