aboutsummaryrefslogtreecommitdiff
path: root/tools/darwin
diff options
context:
space:
mode:
authorfuzzard <fuzzard@kodi.tv>2020-11-28 18:35:34 +1000
committerfuzzard <fuzzard@kodi.tv>2020-11-28 20:24:50 +1000
commit86bed35a5a298901a6d8ad9f7b7e51d2393dbcfc (patch)
tree602eb02fe7cbc250ff80cbf9ec55e9b41b9ed568 /tools/darwin
parent2dca05a1876409ac599678f91618e660543f221e (diff)
[OSX][packaging] allow the ability to create dmg from xcode generated project
currently the mkdmg-osx.sh script will fail when project is an xcode generated project You need to specify the build target The issue is that xcode projects arent a set configuration type at cmake generation time CORE_BUILD_CONFIG will be empty. This passes the xcode configuration type to the script so the type can be used to build the dmg correctly.
Diffstat (limited to 'tools/darwin')
-rwxr-xr-xtools/darwin/packaging/osx/mkdmg-osx.sh.in36
1 files changed, 24 insertions, 12 deletions
diff --git a/tools/darwin/packaging/osx/mkdmg-osx.sh.in b/tools/darwin/packaging/osx/mkdmg-osx.sh.in
index ac200a4c44..14456f78f1 100755
--- a/tools/darwin/packaging/osx/mkdmg-osx.sh.in
+++ b/tools/darwin/packaging/osx/mkdmg-osx.sh.in
@@ -2,20 +2,32 @@
# usage: ./mkdmg-osx.sh release/debug (case insensitive)
# Allows us to run mkdmg-osx.sh from anywhere in the three, rather than the tools/darwin/packaging/osx folder only
-SWITCH="$1"
+
+case "$XCODE_BUILDTYPE" in
+ ".") SWITCH="$1" ;;
+ *) SWITCH="$XCODE_BUILDTYPE" ;;
+esac
+
DIRNAME=`dirname $0`
-if [ ${SWITCH:-""} = "debug" ]; then
- echo "Packaging Debug target for OSX"
- APP="$DIRNAME/../../../../build/Debug/@APP_NAME@.app"
-elif [ ${SWITCH:-""} = "release" ]; then
- echo "Packaging Release target for OSX"
- APP="$DIRNAME/../../../../build/Release/@APP_NAME@.app"
- isReleaseBuild=1
-else
- echo "You need to specify the build target"
- exit 1
-fi
+# use for case insensitive match. revert to system default after this block
+shopt -s nocasematch
+case "$SWITCH" in
+ "debug" )
+ echo "Packaging Debug target for OSX"
+ APP="$DIRNAME/../../../../build/Debug/@APP_NAME@.app"
+ ;;
+ "release" )
+ echo "Packaging Release target for OSX"
+ APP="$DIRNAME/../../../../build/Release/@APP_NAME@.app"
+ isReleaseBuild=1
+ ;;
+ *)
+ echo "You need to specify the build target"
+ exit 1
+ ;;
+esac
+shopt -u nocasematch
if [ ! -d $APP ]; then
echo "@APP_NAME@.app not found! are you sure you built $1 target?"