-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcmakecompile.sh
More file actions
executable file
·45 lines (41 loc) · 1.01 KB
/
cmakecompile.sh
File metadata and controls
executable file
·45 lines (41 loc) · 1.01 KB
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
#!/usr/bin/env bash
mkdir build
mkdir debug
makearg=""
cmakearg=""
folder="build"
for arg in "$@"; do
if [ "$arg" = "--release" ]; then
cmakearg+=" -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=\"-O3\" "
elif [ "$arg" = "--debug" ]; then
cmakearg+=" -DCMAKE_BUILD_TYPE=Debug "
folder="debug"
elif [ "$arg" = "--fastcomile" ]; then
makearg+=" -j4 "
elif [ "$arg" = "--reset" ]; then
rm -rf build/*
rm -rf debug/*
fi
done
cd $folder/
cmake $cmakearg ..
if [[ $? != 0 ]]; then
err=$?
echo -ne "$(tput setaf 9)"
echo "Compilation of MicaClient went wrong.$(tput sgr0)"
cd ../
exit $err
fi
make $makearg
if [[ $? != 0 ]]; then
err=$?
echo -ne "$(tput setaf 9)"
echo "Compilation of MicaClient went wrong.$(tput sgr0)"
cd ../
exit $err
elif [[ $? == 0 ]]; then
echo "$(tput setaf 2)$(tput bold)Compilation of MicaClient finished.$(tput sgr0)
Execute MicaClient++ with build/MicaClient"
fi
cd ../
echo -ne "$(tput sgr0)"