buildOpencv.sh 611 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#! /bin/sh
echo "开始编译opencv ..."
cur_dir=$(pwd)
if [ ! -d "${cur_dir}/3rdParty/opencv-3.4.11" ];then
    tar -xvzf ${cur_dir}/3rdParty/opencv-3.4.11_mini.tar.gz -C ${cur_dir}/3rdParty/
fi

if [ -d "${cur_dir}/3rdParty/opencv" ];then
    rm -rf ${cur_dir}/3rdParty/opencv/* 
else
    mkdir -p ${cur_dir}/3rdParty/opencv
fi

mkdir -p  ${cur_dir}/3rdParty/opencv-3.4.11/build
cd ${cur_dir}/3rdParty/opencv-3.4.11/build
rm ./*ake* -rf
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=${cur_dir}/3rdParty/opencv  ..
make -j8 && make install 
rm ${cur_dir}/3rdParty/opencv-3.4.11 -rf
cd ${cur_dir}