-
Notifications
You must be signed in to change notification settings - Fork 391
/
Copy pathbuild.sh
executable file
·35 lines (25 loc) · 880 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
#!/usr/bin/env bash
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # get script dir (this should be the main folder directory of PLVS)
SCRIPT_DIR=$(readlink -f $SCRIPT_DIR) # this reads the actual path if a symbolic directory is used
function make_dir(){
if [ ! -d $1 ]; then
mkdir $1
fi
}
# ====================================================
# check if we have external options
EXTERNAL_OPTIONS=$@
if [[ -n "$EXTERNAL_OPTIONS" ]]; then
echo "external option: $EXTERNAL_OPTIONS"
fi
OpenCV_DIR="$SCRIPT_DIR/../../thirdparty/opencv/install/lib/cmake/opencv4"
if [[ -d "$OpenCV_DIR" ]]; then
EXTERNAL_OPTIONS="$EXTERNAL_OPTIONS -DOpenCV_DIR=$OpenCV_DIR"
fi
echo "EXTERNAL_OPTIONS: $EXTERNAL_OPTIONS"
# ====================================================
make_dir build
cd build
cmake .. $EXTERNAL_OPTIONS
make -j 4
cd ..