下载源码
安装brew
MAC正确简单安装brew_柳鲲鹏-CSDN博客
安装工具
sudo chown -R $(whoami) /usr/local/share/zsh /usr/local/share/zsh/site-functions brew install make brew link make brew install cmake brew link cmake brew install ant brew link ant
构建脚本
LIB_DIR=${HOME}/lib-opencv cd /opencv-4.2.0 mkdir build cd build/ cmake \ -D CMAKE_BUILD_TYPE=RELEASE \ -D CMAKE_INSTALL_PREFIX=${LIB_DIR} \ .. make -j4 # sudo make install
检查
在目录目录下,可以看到libopencv*系列的文件。