opencv makefile install

举报
风吹稻花香 发表于 2021/06/04 23:13:02 2021/06/04
【摘要】 all: install   update: | opencv opencv_contrib cd opencv/ && git pull origin master cd opencv_contrib/ && git pull origin master   dep: sudo apt-get install...
all: install
 
update: | opencv opencv_contrib
cd opencv/ && git pull origin master
cd opencv_contrib/ && git pull origin master
 
dep:
sudo apt-get install -y cmake git checkinstall build-essential 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-vaapi1.0-dev libtbb-dev libgtkglext1 libilmbase-dev libjasper-dev libjbig-dev liblzma-dev libopenexr-dev libtiff5-dev libtiffxx5
 
dep-graphic: dep
sudo apt-get install -y libqt4-dev libqt4-opengl-dev
 
opencv_contrib:
git clone https://github.com/itseez/opencv_contrib.git
 
opencv:
git clone https://github.com/itseez/opencv.git
cd opencv && git checkout 3.0.0-beta
 
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 -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) - 1 )) -l $$(nproc)
 
opencv.deb: opencv/release/lib/libopencv_core.so
echo "OpenCV library compiled from git repository along with the contrib" > description-pak
sudo checkinstall --install=no --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-vaapi1.0-dev,libtbb-dev,libfaac0,libgtkglext1,libilmbase-dev,libjasper-dev,libjbig-dev,liblzma-dev,libopenexr-dev,libtiff5-dev,libtiffxx5"\
--replaces="libopencv-dev"\
make -C $(PWD)/opencv/release/ install
rm description-pak
sudo 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


源码地址:

https://github.com/Yougmark/opencv_gpu_benchmark/blob/master/Makefile

文章来源: blog.csdn.net,作者:网奇,版权归原作者所有,如需转载,请联系作者。

原文链接:blog.csdn.net/jacke121/article/details/56280621

【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。