Cmake编译C++程序报错Found OpenCV Windows Pack but it has no binaries compatible with your configuration. You should manually point CMake variable OpenCV_DIR to your build of OpenCV library.
解决办法
在CMakeLists.txt中使用set(OpenCV_DIR "D:/opencv/build/x64/vc15/lib") 设置OpenCV目录,
如果根据网络上的文章设置为set(OpenCV_DIR "D:/opencv/build") 就会报标题中的错误,需要配置成opencv/build/x64/vc15/lib这个目录。
更改后的配置如下:
set(OpenCV_DIR "D:/opencv/build/x64/vc15/lib")
find_package( OpenCV REQUIRED )