Fix mac build, split PlistBuddy use to separate script, suppress errors

* There's no "add or replace" so we have to just delete and ignore if
  it fails, then add/set as normal.
This commit is contained in:
baldurk
2017-07-25 22:06:17 +01:00
parent fb1c75ab1c
commit 8476be2300
2 changed files with 13 additions and 1 deletions
+1 -1
View File
@@ -133,7 +133,7 @@ win32 {
ICON = $$OSX_ICONFILE
INFO_PLIST_PATH = $$shell_quote($$DESTDIR/$${TARGET}.app/Contents/Info.plist)
QMAKE_POST_LINK += /usr/libexec/PlistBuddy -c \"Delete :CFBundleShortVersionString\" -c \"Add :CFBundleShortVersionString string $${RENDERDOC_VERSION}.0\" -c \"Set :CFBundleIdentifier org.renderdoc.qrenderdoc\" $${INFO_PLIST_PATH}
QMAKE_POST_LINK += $$_PRO_FILE_PWD_/../scripts/set_plist_version.sh $${RENDERDOC_VERSION}.0 $${INFO_PLIST_PATH}
} else {
QT += x11extras
DEFINES += RENDERDOC_PLATFORM_POSIX RENDERDOC_PLATFORM_LINUX RENDERDOC_WINDOWING_XLIB RENDERDOC_WINDOWING_XCB
+12
View File
@@ -0,0 +1,12 @@
#!/bin/sh
VERSION=$1
PLIST=$2
# Delete the key if it already exists
/usr/libexec/PlistBuddy -c "Delete :CFBundleShortVersionString" "$PLIST" >/dev/null 2>&1
# Now add with the right value
/usr/libexec/PlistBuddy -c "Add :CFBundleShortVersionString string $VERSION" "$PLIST" || exit 1
# Set identifier
/usr/libexec/PlistBuddy -c "Set :CFBundleIdentifier org.renderdoc.qrenderdoc" "$PLIST" || exit 1