-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
63 lines (52 loc) · 1.45 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
59
60
61
62
63
# build script for cursorControl package
# update and upgrade packages
sudo apt-get -y update
sudo apt-get -y upgrade
# Install Dependencies
sudo apt-get -y install tar
# sudo apt-get -y install qt5-default
# download OpenCV from Github
mkdir -p third_party && cd third_party
git clone https://github.com/opencv/opencv.git
cd opencv
git checkout 4.5.1
cd ..
# download opencv_contrib from Github
# git clone https://github.com/opencv/opencv_contrib.git
# cd opencv_contrib
# git checkout 4.5.1
# cd ..
# compile and Install OpenCV with contrib
# create build directory inside opencv directory
cd opencv
mkdir -p build
cd build
# run CMake with the following options
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D INSTALL_CREATE_DISTRIB=ON \
-D BUILD_SHARED_LIBS=ON \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D BUILD_LIST=core,imgproc,objdetect,highgui,videoio \
-D WITH_TBB=ON \
-D WITH_V4L=ON \
-D WITH_QT=OFF \
-D WITH_OPENGL=ON ..
# compile and install
make -j4
sudo make install
sudo sh -c 'echo "/usr/local/lib" >> /etc/ld.so.conf.d/opencv.conf'
sudo ldconfig
# install Boost
cd ..
cd ..
wget https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.gz
tar -xzf boost_1_76_0.tar.gz
# configure cmake for project build
cd ..
mkdir -p build
cmake -B build ../cursorControl
# build the project
cmake --build build
# install the project
mkdir -p install
cmake --install build --config Debug --prefix install