#!/bin/sh

MACDEPLOYQT=$(which macdeployqt)
if [ ! -x "$MACDEPLOYQT" ]; then
    echo "macdeployqt is not in path."
    exit
fi

cd $(dirname $0)/..

mkdir bin/XaoS.app/Contents/Resources/examples/
cp examples/*/* bin/XaoS.app/Contents/Resources/examples/
cp -R catalogs bin/XaoS.app/Contents/Resources/
cp -R tutorial bin/XaoS.app/Contents/Resources/
if [ -z "$1" ]; then
	$MACDEPLOYQT bin/XaoS.app -dmg
else
	$MACDEPLOYQT bin/XaoS.app -dmg -codesign="$1"
fi
