forked from kmkolasinski/AwesomeBump
-
Notifications
You must be signed in to change notification settings - Fork 0
/
unixBuildScript.sh
executable file
·61 lines (50 loc) · 1.55 KB
/
unixBuildScript.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
59
#!/bin/bash
# Add your QT path here by setting MY_QT_PATH variable
# MY_QT_PATH=/YOUR_PATH_HERE/Qt/5.X/gcc_64/bin/
MY_QT_PATH=/opt/Qt5.9.0/5.9/gcc_64/bin/
BUILD_WITH_OPENGL_330_SUPPORT=$1
MAKE_NUM_THREADS='-j 8'
wget="wget"
tool="gcc_64"
exe=""
APP_SUFFIX=""
QMAKE_CONFIG=""
if [[ $BUILD_WITH_OPENGL_330_SUPPORT == "gl330" ]]; then
QMAKE_CONFIG="CONFIG+=gl330"
APP_SUFFIX="GL330"
fi
if [[ "$OSTYPE" == "darwin"* ]]; then
wget="curl -L -o master.zip"
tool="clang_64"
exe=".app"
fi
export PATH=$MY_QT_PATH:$PATH
if [ ! -e "$MY_QT_PATH" ]; then
echo " ---------------------------------"
echo " Error: Wrong Qt path."
echo " ---------------------------------"
echo " Qt not found at '$MY_QT_PATH'."
echo " Please set the MY_QT_PATH variable in the ./unixBuildScript.sh"
echo ""
exit 1
fi
if [ "$(ls -A Sources/utils/QtnProperty)" ]; then
echo "QtnProperty module is already initialized. No action is performed."
else
echo "Initializing QtnProperty module"
# Copy QtnProperty directly from the repository
cd Sources/utils/QtnProperty
$wget https://github.com/kmkolasinski/QtnProperty/archive/master.zip
unzip master.zip
rm master.zip
mv QtnProperty-master/* .
rm -r QtnProperty-master
cd ../../../
fi
rm .qmake.stash
rm Makefile
rm Sources/Makefile
${MY_QT_PATH}/qmake ./AwesomeBump.pro ${QMAKE_CONFIG} \
&& make clean && make $MAKE_NUM_THREADS \
&& echo "*** Copying binary from `cat workdir/current` ..." \
&& cp -vr workdir/`cat workdir/current`/bin/AwesomeBump$exe ./Bin/AwesomeBump$APP_SUFFIX$exe