-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup_external.sh
More file actions
32 lines (29 loc) · 868 Bytes
/
setup_external.sh
File metadata and controls
32 lines (29 loc) · 868 Bytes
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
#!/bin/sh
# folder for externals
EXT="${PWD}/libs"
EXT_OPENCV="${EXT}/opencv"
EXT_SRCS="${EXT}/sources"
EXT_OPENCV_CONTRIB_MODULES="${EXT_SRCS}/opencv_contrib/modules"
echo "External folder: $EXT"
echo "External folder sources: $EXT_SRCS"
echo "External folder OpenCV: $EXT_OPENCV"
echo "External folder OpenCV_Contrib: $EXT_OPENCV_CONTRIB_MODULES"
if [ ! -d "$EXT" ]; then
mkdir $EXT
fi
if [ ! -d "$EXT_SRCS" ]; then
mkdir $EXT_SRCS
fi
cd $EXT_SRCS
#Install OpenCV
cd $EXT_SRCS
git clone https://github.com/opencv/opencv.git
git clone https://github.com/opencv/opencv_contrib.git
cd opencv
mkdir build_opencv
cd build_opencv
cmake -DCMAKE_BUILD_TYPE=Release -DWITH_CUDA=OFF -DCMAKE_INSTALL_PREFIX=$EXT_OPENCV -DOPENCV_EXTRA_MODULES_PATH=${EXT_OPENCV_CONTRIB_MODULES} -DBUILD_opencv_dnn_modern=OFF ..
make -j4
make install
cd $EXT
rm -rf $EXT_SRCS