-
Notifications
You must be signed in to change notification settings - Fork 15
/
make.sh
executable file
·44 lines (38 loc) · 869 Bytes
/
make.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
#!/bin/bash
# defaults
CMAKE_BUILD_TYPE=Release
GPIS_BUILD_DIRECTORY="build"
if [[ "$(uname)" == "Linux" || "$(uname)" == "Darwin" ]]; then
CMAKE_GENERATOR="Unix Makefiles"
else
CMAKE_GENERATOR="MSYS Makefiles"
fi
function make_clean {
rm -rf $GPIS_BUILD_DIRECTORY
rm -rf bin lib update
}
while (($#)); do
case $1 in
-r | --release | release)
CMAKE_BUILD_TYPE=Release
;;
-d | --debug | debug)
CMAKE_BUILD_TYPE=Debug
;;
--clean | clean)
make_clean
exit 0
;;
*)
echo "Incorrect argument given."
print_help
exit 0
;;
esac
shift
done
mkdir -p $GPIS_BUILD_DIRECTORY
cd $GPIS_BUILD_DIRECTORY
cmake .. -DCMAKE_BUILD_TYPE="$CMAKE_BUILD_TYPE" -G "$CMAKE_GENERATOR"
make -j3
cd ..