在qt上 .pro文件添加:
INCLUDEPATH += /usr/local/Cellar/opencv/4.1.2/include/opencv4/opencv2/
INCLUDEPATH += /usr/local/Cellar/opencv/4.1.2/include/
INCLUDEPATH += /usr/local/Cellar/opencv/4.1.2/include/opencv4/
LIBS += -L/usr/local/Cellar/opencv/4.1.2/lib/ -lopencv_core -lopencv_highgui -lopencv_imgproc -lopencv_imgcodecs
另外可以在构建环境中添加如下:
/usr/local/bin