iOS: can I define PRODUCT_NAME (as used in Info.plist) in qmake .pro file
-
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? -
Hi,
Is it a custom Info.plist file you are using ?
-
We did this in this way:
- Create file 'Info.plist.in' with this content:
... <key>CFBundleDisplayName</key> <string>$$MY_COOL_PRODUCT_NAME</string> ...
- 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.
-
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?@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
andQMAKE_TARGET_BUNDLE_PREFIX
so:
TARGET = myApp
QMAKE_TARGET_BUNDLE_PREFIX = xx.myCompanyresults in the bundle display name:
xx.myCompany.myApp
-