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
下载相关源码包
- :下载的是source源码
- :直接下载zip压缩包
cmake生成makefile、编译、安装
cd opencv-3.3.0mkdir build cd buildcmake -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