forked from mcallegari/qlcplus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
create-dmg-cmake.sh
executable file
·58 lines (48 loc) · 1.5 KB
/
create-dmg-cmake.sh
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
#VERSION=$(head -1 debian/changelog | sed 's/.*(\(.*\)).*/\1/')
VERSION=$(grep -m 1 APPVERSION variables.pri | cut -d '=' -f 2 | sed -e 's/^[[:space:]]*//' | tr ' ' _ | tr -d '\r\n')
rm -rf build
mkdir build
cd build
# Build
if [ -n "$QTDIR" ]; then
cmake -DCMAKE_PREFIX_PATH="$QTDIR/lib/cmake" ..
else
echo "QTDIR not set. Aborting."
exit 1
fi
NUM_CPUS=`sysctl -n hw.ncpu` || true
if [ -z "$NUM_CPUS" ]; then
NUM_CPUS=4
fi
make -j$NUM_CPUS
if [ ! $? -eq 0 ]; then
echo Compiler error. Aborting package creation.
exit $?
fi
# Install to ~/QLC+.app/
make install/fast
if [ ! $? -eq 0 ]; then
echo Installation error. Aborting package creation.
exit $?
fi
cd ..
echo "Run macdeployqt..."
$QTDIR/bin/macdeployqt ~/QLC+.app
echo "Fix some more dependencies..."
install_name_tool -change /usr/local/opt/fftw/lib/libfftw3.3.dylib @executable_path/../Frameworks/libfftw3.3.dylib ~/QLC+.app/Contents/MacOS/qlcplus
install_name_tool -change /usr/local/opt/fftw/lib/libfftw3.3.dylib @executable_path/../Frameworks/libfftw3.3.dylib ~/QLC+.app/Contents/MacOS/qlcplus-fixtureeditor
# Create Apple Disk iMaGe from ~/QLC+.app/
OUTDIR=$PWD
cd platforms/macos/dmg
./create-dmg --volname "Q Light Controller Plus $VERSION" \
--volicon $OUTDIR/resources/icons/qlcplus.icns \
--background background.png \
--window-size 400 300 \
--window-pos 200 100 \
--icon-size 64 \
--icon "QLC+" 0 150 \
--app-drop-link 200 150 \
$OUTDIR/QLC+_$VERSION.dmg \
~/QLC+.app
cd -