-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
56 lines (40 loc) · 2.23 KB
/
makefile
File metadata and controls
56 lines (40 loc) · 2.23 KB
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
OPENCV_VERSION=4.5.4
all: install
update: | opencv opencv_contrib
cd opencv/ && git pull origin master
cd opencv_contrib/ && git pull origin master
dep:
apt-get install -q -y cmake git checkinstall build-essential libdc1394-*-dev libv4l-dev libavcodec-dev libavutil-dev libavformat-dev libavutil-dev libswscale-dev libx264-dev libeigen3-dev libgtk2.0-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libtbb-dev libgtkglext1 libilmbase-dev libjbig-dev liblzma-dev libopenexr-dev libtiff5-dev libtiffxx5
dep-graphic: dep
sudo apt-get install -y libqt5-dev libqt5opengl5-dev
opencv_contrib:
git clone -b $(OPENCV_VERSION) --depth 1 https://github.com/opencv/opencv_contrib
opencv:
git clone -b $(OPENCV_VERSION) --depth 1 https://github.com/opencv/opencv
opencv/release: | opencv
mkdir opencv/release
opencv/release/Makefile: | opencv/release opencv_contrib
make clean #necessary to make sure old configuration files are not present
make opencv/release
cd opencv/release/; cmake -D CMAKE_BUILD_TYPE=RELEASE -D OPENCV_GENERATE_PKGCONFIG=YES -DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules $(options) ..
opencv/release/lib/libopencv_core.so: build
build: opencv/release/Makefile
make -C opencv/release -j $$(( $$(nproc) - 2 )) -l $$(nproc)
opencv.deb: opencv/release/Makefile
echo "OpenCV library compiled from git repository along with the contrib" > description-pak
checkinstall --install=no --pkgversion="$(OPENCV_VERSION)" --maintainer="$(USER)" --nodoc --pkgname="opencv" --provides="opencv" --deldesc=yes --delspec=yes --backup=no --fstrans=yes --default\
--requires="libdc1394-22-dev,libv4l-dev,libavcodec-dev,libavutil-dev,libavformat-dev,libavutil-dev,libswscale-dev,libx264-dev,libeigen3-dev,libgtk2.0-dev,libgstreamer1.0-dev,libgstreamer-plugins-base1.0-dev,libtbb-dev,libgtkglext1,libilmbase-dev,libjbig-dev,liblzma-dev,libopenexr-dev,libtiff5-dev,libtiffxx5"\
--replaces="libopencv-dev"\
make -C opencv/release/ install -j $$(( $$(nproc) - 1 )) -l $$(nproc)
rm description-pak
mv opencv_*_*.deb opencv.deb
install: opencv.deb
sudo dpkg -i opencv.deb
sudo ldconfig
uninstall:
sudo dpkg -r opencv
clean:
rm -rf opencv/release
mrproper:
rm -rf opencv/ opencv_contrib/
.PHONY: dep-graphic clean mrproper uninstall