-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-requirements-ubuntu.mk
41 lines (34 loc) · 1.06 KB
/
install-requirements-ubuntu.mk
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
all: dependencies
dependencies: gcc pkg-config qmake qt opencv
gcc:
# install gcc
sudo apt-get install build-essential
pkg-config:
# install pkg-config
sudo apt-get install pkg-config
qmake:
# install qmake
sudo apt install qtchooser
qt:
# install qt
sudo apt-get install qt5-default
opencv:
# install opencv required packages
sudo apt-get install cmake git libgtk2.0-dev libavcodec-dev libavformat-dev libswscale-dev
# download opencv source
sudo apt-get install wget
sudo apt-get install unzip
wget github.com/opencv/opencv/archive/4.3.0.zip -O opencv-4.3.0.zip
unzip opencv-4.3.0.zip
# build opencv source
mkdir opencv-4.3.0/build
cd opencv-4.3.0/build && cmake -DBUILD_LIST=calib3d,core,features2d,flann,highgui,imgcodecs,imgproc,objdetect -DOPENCV_GENERATE_PKGCONFIG=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local .. && make -j7 && sudo make install
# ensures opencv shared libraries link
sudo ldconfig
clean:
ifneq (,$(wildcard ./opencv-4.3.0.zip))
rm opencv-4.3.0.zip
endif
ifneq (,$(wildcard ./opencv-4.3.0))
rm -r opencv-4.3.0
endif