mac10.12.6系统使用cmake安装opencv3.3.0+opencv_contrib-3.3.0

brew与cmake

brew安装

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 

brew卸载

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"

cmake安装

brew install cmake

下载相关源码包

cmake生成makefile、编译、安装

cd opencv-3.3.0
mkdir build 
cd build
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_EXTRA_MODULES_PATH=/Users/xx/Downloads/opencv_contrib-3.3.0/modules ..
make -j16 # 16线程编译
sudo make install # 安装

安装在/usr/local/lib以及/usr/local/include/opencv2

参考

posted @ 2018-10-19 10:59  小佬頭  阅读(629)  评论(0编辑  收藏  举报