From 4196534759f7f7aa04c8675378cfec57539abc75 Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Wed, 5 Jul 2017 15:53:53 -0700 Subject: [PATCH] Fix the deployment target problem once and for all Instead of hardcoding the value of LSMinimumSystemVersion in Info.plist where we will always forget to update it (and since Qt Creator can be built with multiple versions of Qt, it will almost certainly be wrong for one of those versions), automatically determine the value from QMAKE_MACOSX_DEPLOYMENT_TARGET, which is authoritative. This should prevent mishaps where users try to run Qt Creator on older OS versions and receive a crash dialog instead of the friendly "This app requires a newer version of macOS" message that a properly set LSMinimumSystemVersion value will induce. The Qbs build is not affected by this problem, as Qbs automatically handles the minimum deployment target even when a custom Info.plist is specified. The solution chosen in this patch was used instead of QMAKE_SUBSTITUTES because the Qbs build also uses the Info.plist input file and it would break the Qbs build if the quotes were to be escaped, since it would become invalid XML. Change-Id: I20625a2fae546c6597a567f28864b12917e8ac39 Reviewed-by: Oswald Buddenhagen --- src/app/Info.plist | 2 +- src/app/app.pro | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/app/Info.plist b/src/app/Info.plist index 6d31c52d266..8447dd66d4a 100644 --- a/src/app/Info.plist +++ b/src/app/Info.plist @@ -253,6 +253,6 @@ CFBundleShortVersionString @SHORT_VERSION@ LSMinimumSystemVersion - 10.8 + @MACOSX_DEPLOYMENT_TARGET@ diff --git a/src/app/app.pro b/src/app/app.pro index fee710e99d7..58dca7ba050 100644 --- a/src/app/app.pro +++ b/src/app/app.pro @@ -53,7 +53,12 @@ win32 { INSTALLS += icns } } - QMAKE_INFO_PLIST = Info.plist + + infoplist = $$cat($$PWD/Info.plist, blob) + infoplist = $$replace(infoplist, @MACOSX_DEPLOYMENT_TARGET@, $$QMAKE_MACOSX_DEPLOYMENT_TARGET) + write_file($$OUT_PWD/Info.plist, infoplist) + + QMAKE_INFO_PLIST = $$OUT_PWD/Info.plist } target.path = $$INSTALL_APP_PATH