-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbuild.sh
executable file
·57 lines (48 loc) · 879 Bytes
/
build.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
#!/bin/bash
function title() { echo -e ">>> $1"; }
function hr() { echo -e "\n==================================================\n"; }
function runTests()
{
for file in $1
do
ls $file
./$file
echo -e "\n"
done
}
BASEDIR=`dirname $0`
cd $BASEDIR
rebuild=false
buildType="Release"
testApp="OFF"
doc="OFF"
while [ $# -gt 0 ]
do
if [ $1 == "-r" ]
then
rebuild=true
elif [ $1 == "-D" ]
then
buildType="Debug"
elif [ $1 == "-test" ]
then
testApp="ON"
elif [ $1 == "-doc" ]
then
doc="ON"
fi
shift
done
if [ $rebuild == true ]
then
rm -rf ./build
rm -rf ./bin
rm -rf ./doc
fi
mkdir ./build
cd ./build
clear &&
title "CMAKE:\n" &&
cmake -DCMAKE_BUILD_TYPE=$buildType -DTEST_APP=$testApp -DDOC=$doc ../ && hr &&
title "MAKE:\n" &&
make