-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·57 lines (49 loc) · 989 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
57
#!/bin/bash
CURRENT_DIR=$(cd $(dirname $0); pwd)
FILE=${CURRENT_DIR}/products
if [ ! -d "$FILE" ]; then
echo "$FILE not exist"
mkdir ${FILE}
fi
parseArguments()
{
echo Build ARGS: $@
while true
do
case "$1" in
--clean)
rm -rf CMakeCache.txt CMakeFiles/
;;
--clean-all)
rm -rf CMakeCache.txt CMakeFiles/ ../bin/ ../lib
;;
-h|--help)
echo -e "\033[32m==================================\033[0m"
echo "Usage"
echo " build.sh [options]"
echo
echo "Options"
echo " --clean "
echo " --clean-all = Clean all tmp files before building."
echo
echo "Example"
echo " ./build.sh --clean"
echo -e "\033[32m==================================\033[0m"
exit -1
;;
*)
if [ -z "$1" ]; then
break
fi
;;
esac
shift
done
}
cd products
parseArguments $@
cmake ..
make -j16
#post build
cp -r ../*net.txt ../products/bin
cp -r ../res ../products/bin