Rewrite the Info.plist variable replacement handling

This ensures that the same set of variables can be successfully replaced
in both the Makefile and Xcode generators. It also switches the default
templates to use the Xcode-style ${var} syntax instead of the @var@
syntax for better Info.plist compatibility across generators.

Change-Id: Iff330bafd152773aafac9143c4a34e34f92f0ce6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
Jake Petroules 2017-11-20 23:49:34 -08:00
parent b739b3a040
commit 0749ba2c5e
15 changed files with 176 additions and 75 deletions

View File

@ -47,6 +47,29 @@ app_extension_api_only {
} }
macx-xcode { macx-xcode {
qmake_pkginfo_typeinfo.name = QMAKE_PKGINFO_TYPEINFO
!isEmpty(QMAKE_PKGINFO_TYPEINFO): \
qmake_pkginfo_typeinfo.value = $$QMAKE_PKGINFO_TYPEINFO
else: \
qmake_pkginfo_typeinfo.value = "????"
QMAKE_MAC_XCODE_SETTINGS += qmake_pkginfo_typeinfo
!isEmpty(VERSION) {
l = $$split(VERSION, '.') 0 0 # make sure there are at least three
VER_MAJ = $$member(l, 0, 0)
VER_MIN = $$member(l, 1, 1)
VER_PAT = $$member(l, 2, 2)
unset(l)
qmake_full_version.name = QMAKE_FULL_VERSION
qmake_full_version.value = $${VER_MAJ}.$${VER_MIN}.$${VER_PAT}
QMAKE_MAC_XCODE_SETTINGS += qmake_full_version
qmake_short_version.name = QMAKE_SHORT_VERSION
qmake_short_version.value = $${VER_MAJ}.$${VER_MIN}
QMAKE_MAC_XCODE_SETTINGS += qmake_short_version
}
!isEmpty(QMAKE_XCODE_DEBUG_INFORMATION_FORMAT) { !isEmpty(QMAKE_XCODE_DEBUG_INFORMATION_FORMAT) {
debug_information_format.name = DEBUG_INFORMATION_FORMAT debug_information_format.name = DEBUG_INFORMATION_FORMAT
debug_information_format.value = $$QMAKE_XCODE_DEBUG_INFORMATION_FORMAT debug_information_format.value = $$QMAKE_XCODE_DEBUG_INFORMATION_FORMAT

View File

@ -3,17 +3,19 @@
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>@EXECUTABLE@</string> <string>${EXECUTABLE_NAME}</string>
<key>CFBundleGetInfoString</key> <key>CFBundleGetInfoString</key>
<string>Created by Qt/QMake</string> <string>Created by Qt/QMake</string>
<key>CFBundleIconFile</key> <key>CFBundleIconFile</key>
<string>@ICON@</string> <string>${ASSETCATALOG_COMPILER_APPICON_NAME}</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>@BUNDLEIDENTIFIER@</string> <string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>@TYPEINFO@</string> <string>${QMAKE_PKGINFO_TYPEINFO}</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NOTE</key> <key>NOTE</key>
<string>This file was generated by Qt/QMake.</string> <string>This file was generated by Qt/QMake.</string>
<key>NSPrincipalClass</key> <key>NSPrincipalClass</key>

View File

@ -3,19 +3,19 @@
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>@LIBRARY@</string> <string>${EXECUTABLE_NAME}</string>
<key>CFBundleGetInfoString</key> <key>CFBundleGetInfoString</key>
<string>Created by Qt/QMake</string> <string>Created by Qt/QMake</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>@BUNDLEIDENTIFIER@</string> <string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>FMWK</string> <string>FMWK</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>@SHORT_VERSION@</string> <string>${QMAKE_SHORT_VERSION}</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>@TYPEINFO@</string> <string>${QMAKE_PKGINFO_TYPEINFO}</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>@FULL_VERSION@</string> <string>${QMAKE_FULL_VERSION}</string>
<key>NOTE</key> <key>NOTE</key>
<string>Please, do NOT change this file -- It was generated by Qt/QMake.</string> <string>Please, do NOT change this file -- It was generated by Qt/QMake.</string>
</dict> </dict>

View File

@ -3,17 +3,19 @@
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>@EXECUTABLE@</string> <string>${EXECUTABLE_NAME}</string>
<key>CFBundleGetInfoString</key> <key>CFBundleGetInfoString</key>
<string>Created by Qt/QMake</string> <string>Created by Qt/QMake</string>
<key>CFBundleIconFile</key> <key>CFBundleIconFile</key>
<string>@ICON@</string> <string>${ASSETCATALOG_COMPILER_APPICON_NAME}</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>@BUNDLEIDENTIFIER@</string> <string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>@TYPEINFO@</string> <string>${QMAKE_PKGINFO_TYPEINFO}</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NOTE</key> <key>NOTE</key>
<string>This file was generated by Qt/QMake.</string> <string>This file was generated by Qt/QMake.</string>
<key>NSPrincipalClass</key> <key>NSPrincipalClass</key>

View File

@ -3,19 +3,19 @@
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>@LIBRARY@</string> <string>${EXECUTABLE_NAME}</string>
<key>CFBundleGetInfoString</key> <key>CFBundleGetInfoString</key>
<string>Created by Qt/QMake</string> <string>Created by Qt/QMake</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>@BUNDLEIDENTIFIER@</string> <string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>FMWK</string> <string>FMWK</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>@SHORT_VERSION@</string> <string>${QMAKE_SHORT_VERSION}</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>@TYPEINFO@</string> <string>${QMAKE_PKGINFO_TYPEINFO}</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>@FULL_VERSION@</string> <string>${QMAKE_FULL_VERSION}</string>
<key>NOTE</key> <key>NOTE</key>
<string>Please, do NOT change this file -- It was generated by Qt/QMake.</string> <string>Please, do NOT change this file -- It was generated by Qt/QMake.</string>
</dict> </dict>

View File

@ -3,17 +3,19 @@
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>@EXECUTABLE@</string> <string>${EXECUTABLE_NAME}</string>
<key>CFBundleGetInfoString</key> <key>CFBundleGetInfoString</key>
<string>Created by Qt/QMake</string> <string>Created by Qt/QMake</string>
<key>CFBundleIconFile</key> <key>CFBundleIconFile</key>
<string>@ICON@</string> <string>${ASSETCATALOG_COMPILER_APPICON_NAME}</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>@BUNDLEIDENTIFIER@</string> <string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>@TYPEINFO@</string> <string>${QMAKE_PKGINFO_TYPEINFO}</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NOTE</key> <key>NOTE</key>
<string>This file was generated by Qt/QMake.</string> <string>This file was generated by Qt/QMake.</string>
<key>NSPrincipalClass</key> <key>NSPrincipalClass</key>

View File

@ -3,19 +3,19 @@
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>@LIBRARY@</string> <string>${EXECUTABLE_NAME}</string>
<key>CFBundleGetInfoString</key> <key>CFBundleGetInfoString</key>
<string>Created by Qt/QMake</string> <string>Created by Qt/QMake</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>@BUNDLEIDENTIFIER@</string> <string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>FMWK</string> <string>FMWK</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>@SHORT_VERSION@</string> <string>${QMAKE_SHORT_VERSION}</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>@TYPEINFO@</string> <string>${QMAKE_PKGINFO_TYPEINFO}</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>@FULL_VERSION@</string> <string>${QMAKE_FULL_VERSION}</string>
<key>NOTE</key> <key>NOTE</key>
<string>Please, do NOT change this file -- It was generated by Qt/QMake.</string> <string>Please, do NOT change this file -- It was generated by Qt/QMake.</string>
</dict> </dict>

View File

@ -5,25 +5,27 @@
<key>CFBundleDisplayName</key> <key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string> <string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>@EXECUTABLE@</string> <string>${EXECUTABLE_NAME}</string>
<key>CFBundleGetInfoString</key> <key>CFBundleGetInfoString</key>
<string>Created by Qt/QMake</string> <string>Created by Qt/QMake</string>
<key>CFBundleIconFile</key> <key>CFBundleIconFile</key>
<string>@ICON@</string> <string>${ASSETCATALOG_COMPILER_APPICON_NAME}</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>@BUNDLEIDENTIFIER@</string> <string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundleName</key> <key>CFBundleName</key>
<string>${PRODUCT_NAME}</string> <string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.0</string> <string>${QMAKE_SHORT_VERSION}</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>@TYPEINFO@</string> <string>${QMAKE_PKGINFO_TYPEINFO}</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1.0</string> <string>${QMAKE_FULL_VERSION}</string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true/> <true/>
<key>MinimumOSVersion</key>
<string>${IPHONEOS_DEPLOYMENT_TARGET}</string>
<key>NOTE</key> <key>NOTE</key>
<string>This file was generated by Qt/QMake.</string> <string>This file was generated by Qt/QMake.</string>
<key>UILaunchStoryboardName</key> <key>UILaunchStoryboardName</key>

View File

@ -3,19 +3,19 @@
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>@LIBRARY@</string> <string>${EXECUTABLE_NAME}</string>
<key>CFBundleGetInfoString</key> <key>CFBundleGetInfoString</key>
<string>Created by Qt/QMake</string> <string>Created by Qt/QMake</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>@BUNDLEIDENTIFIER@</string> <string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>FMWK</string> <string>FMWK</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>@SHORT_VERSION@</string> <string>${QMAKE_SHORT_VERSION}</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>@TYPEINFO@</string> <string>${QMAKE_PKGINFO_TYPEINFO}</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>@FULL_VERSION@</string> <string>${QMAKE_FULL_VERSION}</string>
<key>NOTE</key> <key>NOTE</key>
<string>Please, do NOT change this file -- It was generated by Qt/QMake.</string> <string>Please, do NOT change this file -- It was generated by Qt/QMake.</string>
</dict> </dict>

View File

@ -7,7 +7,7 @@
<key>CFBundleDisplayName</key> <key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string> <string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>@EXECUTABLE@</string> <string>${EXECUTABLE_NAME}</string>
<key>CFBundleGetInfoString</key> <key>CFBundleGetInfoString</key>
<string>Created by Qt/QMake</string> <string>Created by Qt/QMake</string>
<key>CFBundleIcons</key> <key>CFBundleIcons</key>
@ -16,25 +16,25 @@
<string>App Icon - Small</string> <string>App Icon - Small</string>
</dict> </dict>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>@BUNDLEIDENTIFIER@</string> <string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundleName</key> <key>CFBundleName</key>
<string>${PRODUCT_NAME}</string> <string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.0</string> <string>${QMAKE_SHORT_VERSION}</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>@TYPEINFO@</string> <string>${QMAKE_PKGINFO_TYPEINFO}</string>
<key>CFBundleSupportedPlatforms</key> <key>CFBundleSupportedPlatforms</key>
<array> <array>
<string>AppleTVOS</string> <string>AppleTVOS</string>
</array> </array>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1.0</string> <string>${QMAKE_FULL_VERSION}</string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true/> <true/>
<key>MinimumOSVersion</key> <key>MinimumOSVersion</key>
<string>9.1</string> <string>${TVOS_DEPLOYMENT_TARGET}</string>
<key>NOTE</key> <key>NOTE</key>
<string>This file was generated by Qt/QMake.</string> <string>This file was generated by Qt/QMake.</string>
</dict> </dict>

View File

@ -3,19 +3,19 @@
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>@LIBRARY@</string> <string>${EXECUTABLE_NAME}</string>
<key>CFBundleGetInfoString</key> <key>CFBundleGetInfoString</key>
<string>Created by Qt/QMake</string> <string>Created by Qt/QMake</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>@BUNDLEIDENTIFIER@</string> <string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>FMWK</string> <string>FMWK</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>@SHORT_VERSION@</string> <string>${QMAKE_SHORT_VERSION}</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>@TYPEINFO@</string> <string>${QMAKE_PKGINFO_TYPEINFO}</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>@FULL_VERSION@</string> <string>${QMAKE_FULL_VERSION}</string>
<key>NOTE</key> <key>NOTE</key>
<string>Please, do NOT change this file -- It was generated by Qt/QMake.</string> <string>Please, do NOT change this file -- It was generated by Qt/QMake.</string>
</dict> </dict>

View File

@ -7,21 +7,23 @@
<key>CFBundleDisplayName</key> <key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string> <string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>@EXECUTABLE@</string> <string>${EXECUTABLE_NAME}</string>
<key>CFBundleGetInfoString</key> <key>CFBundleGetInfoString</key>
<string>Created by Qt/QMake</string> <string>Created by Qt/QMake</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>@BUNDLEIDENTIFIER@</string> <string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundleName</key> <key>CFBundleName</key>
<string>${PRODUCT_NAME}</string> <string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.0</string> <string>${QMAKE_SHORT_VERSION}</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>@TYPEINFO@</string> <string>${QMAKE_PKGINFO_TYPEINFO}</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1.0</string> <string>${QMAKE_FULL_VERSION}</string>
<key>MinimumOSVersion</key>
<string>${WATCHOS_DEPLOYMENT_TARGET}</string>
<key>NOTE</key> <key>NOTE</key>
<string>This file was generated by Qt/QMake.</string> <string>This file was generated by Qt/QMake.</string>
<key>UISupportedInterfaceOrientations</key> <key>UISupportedInterfaceOrientations</key>

View File

@ -3,19 +3,19 @@
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>@LIBRARY@</string> <string>${EXECUTABLE_NAME}</string>
<key>CFBundleGetInfoString</key> <key>CFBundleGetInfoString</key>
<string>Created by Qt/QMake</string> <string>Created by Qt/QMake</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>@BUNDLEIDENTIFIER@</string> <string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>FMWK</string> <string>FMWK</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>@SHORT_VERSION@</string> <string>${QMAKE_SHORT_VERSION}</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>@TYPEINFO@</string> <string>${QMAKE_PKGINFO_TYPEINFO}</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>@FULL_VERSION@</string> <string>${QMAKE_FULL_VERSION}</string>
<key>NOTE</key> <key>NOTE</key>
<string>Please, do NOT change this file -- It was generated by Qt/QMake.</string> <string>Please, do NOT change this file -- It was generated by Qt/QMake.</string>
</dict> </dict>

View File

@ -1821,9 +1821,55 @@
Specifies the name of the property list file, \c{.plist}, you Specifies the name of the property list file, \c{.plist}, you
would like to include in your \macos, iOS, tvOS, and watchOS application bundle. would like to include in your \macos, iOS, tvOS, and watchOS application bundle.
In the \c{.plist} file, you can define some variables, e.g., @EXECUTABLE@, In the \c{.plist} file, you can define some variables which
which qmake will replace with the actual executable name. Other variables qmake will replace with the relevant values:
include @ICON@, @TYPEINFO@, @LIBRARY@, and @SHORT_VERSION@.
\table
\header
\li Placeholder(s)
\li Effect
\row
\li \c ${PRODUCT_BUNDLE_IDENTIFIER}, \c @BUNDLEIDENTIFIER@
\li Expands to the target bundle's bundle identifier string,
for example: \c{com.example.myapp}. Determined by concatenating the
values of QMAKE_TARGET_BUNDLE_PREFIX and QMAKE_BUNDLE, separated
by a full stop (\c{.}).
\row
\li \c ${EXECUTABLE_NAME}, \c @EXECUTABLE@, \c @LIBRARY@
\li Equivalent to the value of QMAKE_APPLICATION_BUNDLE_NAME,
QMAKE_PLUGIN_BUNDLE_NAME, or QMAKE_FRAMEWORK_BUNDLE_NAME
(depending on the type of target being created),
or TARGET if none of the previous values are set.
\row
\li \c ${ASSETCATALOG_COMPILER_APPICON_NAME}, \c @ICON@
\li Expands to the value of ICON.
\row
\li \c ${QMAKE_PKGINFO_TYPEINFO}, \c @TYPEINFO@
\li Expands to the value of QMAKE_PKGINFO_TYPEINFO.
\row
\li \c ${QMAKE_FULL_VERSION}, \c @FULL_VERSION@
\li Expands to the value of VERSION expressed with three version components.
\row
\li \c ${QMAKE_SHORT_VERSION}, \c @SHORT_VERSION@
\li Expands to the value of VERSION expressed with two version components.
\row
\li \c ${MACOSX_DEPLOYMENT_TARGET}
\li Expands to the value of QMAKE_MACOSX_DEPLOYMENT_TARGET.
\row
\li \c ${IPHONEOS_DEPLOYMENT_TARGET}
\li Expands to the value of QMAKE_IPHONEOS_DEPLOYMENT_TARGET.
\row
\li \c ${TVOS_DEPLOYMENT_TARGET}
\li Expands to the value of QMAKE_TVOS_DEPLOYMENT_TARGET.
\row
\li \c ${WATCHOS_DEPLOYMENT_TARGET}
\li Expands to the value of QMAKE_WATCHOS_DEPLOYMENT_TARGET.
\endtable
\note When using the Xcode generator, the above \c{${var}}-style
placeholders are replaced directly by the Xcode build system and are not
handled by qmake. The \c{@var@} style placeholders work only with the qmake
Makefile generators and not with the Xcode generator.
If building for iOS, and the \c{.plist} file contains the key If building for iOS, and the \c{.plist} file contains the key
\c NSPhotoLibraryUsageDescription, qmake will include an additional plugin \c NSPhotoLibraryUsageDescription, qmake will include an additional plugin

View File

@ -806,14 +806,23 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << mkdir_p_asstring(destdir) << "\n\t"; t << mkdir_p_asstring(destdir) << "\n\t";
ProStringList commonSedArgs; ProStringList commonSedArgs;
if (!project->values("VERSION").isEmpty()) { if (!project->values("VERSION").isEmpty()) {
commonSedArgs << "-e \"s,@SHORT_VERSION@," << project->first("VER_MAJ") << "." const ProString shortVersion =
<< project->first("VER_MIN") << ",g\" "; project->first("VER_MAJ") + "." +
commonSedArgs << "-e \"s,@FULL_VERSION@," << project->first("VER_MAJ") << "." project->first("VER_MIN");
<< project->first("VER_MIN") << "." commonSedArgs << "-e \"s,@SHORT_VERSION@," << shortVersion << ",g\" ";
<< project->first("VER_PAT") << ",g\" "; commonSedArgs << "-e \"s,\\$${QMAKE_SHORT_VERSION}," << shortVersion << ",g\" ";
const ProString fullVersion =
project->first("VER_MAJ") + "." +
project->first("VER_MIN") + "." +
project->first("VER_PAT");
commonSedArgs << "-e \"s,@FULL_VERSION@," << fullVersion << ",g\" ";
commonSedArgs << "-e \"s,\\$${QMAKE_FULL_VERSION}," << fullVersion << ",g\" ";
} }
commonSedArgs << "-e \"s,@TYPEINFO@,"<< (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ? const ProString typeInfo = project->isEmpty("QMAKE_PKGINFO_TYPEINFO")
QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) << ",g\" "; ? QString::fromLatin1("????")
: project->first("QMAKE_PKGINFO_TYPEINFO").left(4);
commonSedArgs << "-e \"s,@TYPEINFO@," << typeInfo << ",g\" ";
commonSedArgs << "-e \"s,\\$${QMAKE_PKGINFO_TYPEINFO}," << typeInfo << ",g\" ";
QString bundlePrefix = project->first("QMAKE_TARGET_BUNDLE_PREFIX").toQString(); QString bundlePrefix = project->first("QMAKE_TARGET_BUNDLE_PREFIX").toQString();
if (bundlePrefix.isEmpty()) if (bundlePrefix.isEmpty())
@ -828,6 +837,16 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
// replace invalid bundle id characters // replace invalid bundle id characters
bundleIdentifier.replace('_', '-'); bundleIdentifier.replace('_', '-');
commonSedArgs << "-e \"s,@BUNDLEIDENTIFIER@," << bundleIdentifier << ",g\" "; commonSedArgs << "-e \"s,@BUNDLEIDENTIFIER@," << bundleIdentifier << ",g\" ";
commonSedArgs << "-e \"s,\\$${PRODUCT_BUNDLE_IDENTIFIER}," << bundleIdentifier << ",g\" ";
commonSedArgs << "-e \"s,\\$${MACOSX_DEPLOYMENT_TARGET},"
<< project->first("QMAKE_MACOSX_DEPLOYMENT_TARGET").toQString() << ",g\" ";
commonSedArgs << "-e \"s,\\$${IPHONEOS_DEPLOYMENT_TARGET},"
<< project->first("QMAKE_IPHONEOS_DEPLOYMENT_TARGET").toQString() << ",g\" ";
commonSedArgs << "-e \"s,\\$${TVOS_DEPLOYMENT_TARGET},"
<< project->first("QMAKE_TVOS_DEPLOYMENT_TARGET").toQString() << ",g\" ";
commonSedArgs << "-e \"s,\\$${WATCHOS_DEPLOYMENT_TARGET},"
<< project->first("QMAKE_WATCHOS_DEPLOYMENT_TARGET").toQString() << ",g\" ";
if (!isFramework) { if (!isFramework) {
ProString app_bundle_name = var("QMAKE_APPLICATION_BUNDLE_NAME"); ProString app_bundle_name = var("QMAKE_APPLICATION_BUNDLE_NAME");
@ -843,11 +862,14 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
<< "@sed "; << "@sed ";
for (const ProString &arg : qAsConst(commonSedArgs)) for (const ProString &arg : qAsConst(commonSedArgs))
t << arg; t << arg;
t << "-e \"s,@ICON@," << icon.section(Option::dir_sep, -1) << ",g\" " const QString iconName = icon.section(Option::dir_sep, -1);
t << "-e \"s,@ICON@," << iconName << ",g\" "
<< "-e \"s,\\$${ASSETCATALOG_COMPILER_APPICON_NAME}," << iconName << ",g\" "
<< "-e \"s,@EXECUTABLE@," << app_bundle_name << ",g\" " << "-e \"s,@EXECUTABLE@," << app_bundle_name << ",g\" "
<< "-e \"s,@LIBRARY@," << plugin_bundle_name << ",g\" " << "-e \"s,@LIBRARY@," << plugin_bundle_name << ",g\" "
<< "-e \"s,@TYPEINFO@,"<< (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ? << "-e \"s,\\$${EXECUTABLE_NAME}," << (app_bundle_name.isEmpty() ? app_bundle_name : plugin_bundle_name) << ",g\" "
QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) << ",g\" " << "-e \"s,@TYPEINFO@,"<< typeInfo << ",g\" "
<< "-e \"s,\\$${QMAKE_PKGINFO_TYPEINFO},"<< typeInfo << ",g\" "
<< "" << info_plist << " >" << info_plist_out << endl; << "" << info_plist << " >" << info_plist_out << endl;
//copy the icon //copy the icon
if (!project->isEmpty("ICON")) { if (!project->isEmpty("ICON")) {
@ -873,9 +895,9 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
for (const ProString &arg : qAsConst(commonSedArgs)) for (const ProString &arg : qAsConst(commonSedArgs))
t << arg; t << arg;
t << "-e \"s,@LIBRARY@," << lib_bundle_name << ",g\" " t << "-e \"s,@LIBRARY@," << lib_bundle_name << ",g\" "
<< "-e \"s,@TYPEINFO@," << "-e \"s,\\$${EXECUTABLE_NAME}," << lib_bundle_name << ",g\" "
<< (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ? << "-e \"s,@TYPEINFO@," << typeInfo << ",g\" "
QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) << ",g\" " << "-e \"s,\\$${QMAKE_PKGINFO_TYPEINFO}," << typeInfo << ",g\" "
<< "" << info_plist << " >" << info_plist_out << endl; << "" << info_plist << " >" << info_plist_out << endl;
} }
break; break;