具体如下:
CMake Warning at cmake/OpenCVDetectCXXCompiler.cmake:182 (message):
OpenCV does not recognize MSVC_VERSION "1940". Cannot set OpenCV_RUNTIME
Call Stack (most recent call first):
CMakeLists.txt:174 (include)
打开源码\opencv\sources\cmake找到OpenCVDetectCXXCompiler.cmake
修改vc17内容
elseif(MSVC_VERSION MATCHES "^193[0-9]$")
set(OpenCV_RUNTIME vc17)
elseif(MSVC_VERSION MATCHES "^19[34][0-9]$")
set(OpenCV_RUNTIME vc17)