-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.sh
executable file
·58 lines (49 loc) · 1.39 KB
/
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
58
#!/bin/bash
function print_help() {
cat << EOF
Usage: ./build.sh [-h|--help] [-p|--pybind] [-t|--tests] [-j[=N]|--jobs[=N]]
-p, --pybind, Enable python bindings compile
-t, --tests, Enable tests build and datasets unpacking
-h, --help, Display help
-j[=N], --jobs[=N], Allow N jobs at once. (Default [=1])
EOF
}
# Set default value for jobs
JOBS_AMOUNT=1
for i in "$@"
do
case $i in
-p|--pybind) # Enable python bindings compile
PYBIND=true
;;
-t|--tests) # Enable tests build and datasets unpacking
TESTS=true
;;
-j=*|--jobs=*)
JOBS_AMOUNT="${i#*=}"
;;
-h|--help|*) # Display help.
print_help
exit 0
;;
esac
done
mkdir -p lib
cd lib
git clone https://github.com/amrayn/easyloggingpp/ --branch v9.97.0 --depth 1
git clone https://github.com/aantron/better-enums.git --branch 0.11.3 --depth 1
if [[ $TESTS == true ]]; then
git clone https://github.com/google/googletest/ --branch release-1.12.1 --depth 1
else
PREFIX="$PREFIX -D ENABLE_TESTS_COMPILE=OFF"
fi
if [[ $PYBIND == true ]]; then
git clone https://github.com/pybind/pybind11.git --branch v2.10 --depth 1
else
PREFIX="$PREFIX -D ENABLE_PYBIND_COMPILE=OFF"
fi
cd ..
mkdir -p build
cd build
cmake $PREFIX .. "-DCMAKE_BUILD_TYPE=RELEASE"
make -j$JOBS_AMOUNT