1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
#!/bin/sh
# Usage: ./deploy-mac [build-dir] [codesign]
# where build-dir is the folder where the executable has already been built (by default, "../bin/")
# and codesign is the input for performing an optional code signing.
# The qmake process already creates the bin folder ("../bin/"), but the cmake process
# usually uses another directory.
BUILD_DIR="$1"
if [ "$BUILD_DIR" = "" ]; then
BUILD_DIR="../bin/"
fi
MACDEPLOYQT=$(command -v macdeployqt)
if [ ! -x "$MACDEPLOYQT" ]; then
echo "macdeployqt is not in path."
exit 1
fi
test -d "$BUILD_DIR/XaoS.app/" || {
echo "Missing $BUILD_DIR/XaoS.app/. Build XaoS first."
exit 2
}
test -d ../bin || {
mkdir ../bin
cp -R $BUILD_DIR/XaoS.app ../bin
}
mkdir -p "../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 "$2" ]; then
$MACDEPLOYQT ../bin/XaoS.app -dmg
else
$MACDEPLOYQT ../bin/XaoS.app -dmg -codesign="$2"
fi
|