From da7fb89c81a0b0b0e65849b0280961b764cd9a11 Mon Sep 17 00:00:00 2001 From: Aaron Raimist Date: Wed, 2 Jan 2019 21:36:17 -0600 Subject: [PATCH] Set version number like major.minor.patch.build on macOS Qt is supposed to work with these kinds of version numbers but it doesn't seem to actually work for some reason http://doc.qt.io/qt-5/qmake-variable-reference.html#version. You should eventually be able to revert this commit (and remove the VERSION line) once there are version numbers set that are just major.minor.patch. --- macOS/Info.plist | 4 ++-- spectral.pro | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/macOS/Info.plist b/macOS/Info.plist index 304f16d..930df5f 100644 --- a/macOS/Info.plist +++ b/macOS/Info.plist @@ -9,9 +9,9 @@ CFBundleIdentifier ${PRODUCT_BUNDLE_IDENTIFIER} CFBundleShortVersionString - ${QMAKE_FULL_VERSION} + CFBundleVersion - ${QMAKE_FULL_VERSION} + CFBundlePackageType APPL LSMinimumSystemVersion diff --git a/spectral.pro b/spectral.pro index f78e454..4a0a121 100644 --- a/spectral.pro +++ b/spectral.pro @@ -84,7 +84,12 @@ win32 { mac { QMAKE_TARGET_BUNDLE_PREFIX = org.eu.encom.spectral - VERSION = 0.0.$$system(git rev-list --count HEAD) + + VERSION = 0.0.0.$$system(git rev-list --count HEAD) + INFO_PLIST_PATH = $$shell_quote($${OUT_PWD}/$${TARGET}.app/Contents/Info.plist) + QMAKE_POST_LINK += /usr/libexec/PlistBuddy -c \"Set :CFBundleVersion $${VERSION}\" $${INFO_PLIST_PATH} + QMAKE_POST_LINK += && /usr/libexec/PlistBuddy -c \"Set :CFBundleShortVersionString $${VERSION}\" $${INFO_PLIST_PATH} + ICON = assets/img/icon.icns QMAKE_INFO_PLIST = macOS/Info.plist }