有没有办法打印标题和lib包含Homebrew公式的路径(通常在安装过程中会短暂显示)?像这样:
$ brew paths opencv3
-I/path/to/opencv3/include
-L/path/to/opencv3/lib
答案 0 :(得分:1)
最简单的方法是使用pkgconfig:
pkg-config --cflags --libs opencv
输出
-I/usr/local/Cellar/opencv/2.4.13.2/include/opencv -I/usr/local/Cellar/opencv/2.4.13.2/include -L/usr/local/Cellar/opencv/2.4.13.2/lib -lopencv_calib3d -lopencv_contrib -lopencv_core -lopencv_features2d -lopencv_flann -lopencv_gpu -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml -lopencv_nonfree -lopencv_objdetect -lopencv_ocl -lopencv_photo -lopencv_stitching -lopencv_superres -lopencv_ts -lopencv_video -lopencv_videostab