From 446c9194bf05829eee4535e90dbdcbd21a2eb1c8 Mon Sep 17 00:00:00 2001 From: Aaron Raimist Date: Wed, 2 Jan 2019 20:58:43 -0600 Subject: [PATCH 1/3] Set macOS Info.plist --- .gitignore | 3 +++ macOS/Info.plist | 24 ++++++++++++++++++++++++ spectral.pro | 3 +++ 3 files changed, 30 insertions(+) create mode 100644 .gitignore create mode 100644 macOS/Info.plist diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c1a50b2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +build + +.DS_Store \ No newline at end of file diff --git a/macOS/Info.plist b/macOS/Info.plist new file mode 100644 index 0000000..304f16d --- /dev/null +++ b/macOS/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + ${ASSETCATALOG_COMPILER_APPICON_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleShortVersionString + ${QMAKE_FULL_VERSION} + CFBundleVersion + ${QMAKE_FULL_VERSION} + CFBundlePackageType + APPL + LSMinimumSystemVersion + 10.11 + NSPrincipalClass + NSApplication + NSSupportsAutomaticGraphicsSwitching + + + diff --git a/spectral.pro b/spectral.pro index 8c86282..f78e454 100644 --- a/spectral.pro +++ b/spectral.pro @@ -83,7 +83,10 @@ win32 { } mac { + QMAKE_TARGET_BUNDLE_PREFIX = org.eu.encom.spectral + VERSION = 0.0.$$system(git rev-list --count HEAD) ICON = assets/img/icon.icns + QMAKE_INFO_PLIST = macOS/Info.plist } HEADERS += \ From da7fb89c81a0b0b0e65849b0280961b764cd9a11 Mon Sep 17 00:00:00 2001 From: Aaron Raimist Date: Wed, 2 Jan 2019 21:36:17 -0600 Subject: [PATCH 2/3] 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 } From c90e96072c842508e66bcd98b409946cfeae7cd3 Mon Sep 17 00:00:00 2001 From: Aaron Raimist Date: Wed, 2 Jan 2019 21:40:36 -0600 Subject: [PATCH 3/3] Fix the CFBundleIdentifier --- spectral.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spectral.pro b/spectral.pro index 4a0a121..881e417 100644 --- a/spectral.pro +++ b/spectral.pro @@ -83,7 +83,7 @@ win32 { } mac { - QMAKE_TARGET_BUNDLE_PREFIX = org.eu.encom.spectral + QMAKE_TARGET_BUNDLE_PREFIX = org.eu.encom VERSION = 0.0.0.$$system(git rev-list --count HEAD) INFO_PLIST_PATH = $$shell_quote($${OUT_PWD}/$${TARGET}.app/Contents/Info.plist)