message("${Y}==== 进入find_opencv.cmake ====${E}")

set(USE_OPENCV OFF)
if (DEFINED PATH_OPENCV AND NOT "${PATH_OPENCV}" STREQUAL "")
    file(TO_CMAKE_PATH ${PATH_OPENCV} PATH_OPENCV)
    set(PATH_OPENCV ${PATH_OPENCV}/${CMAKE_BUILD_TYPE})
    if(EXISTS ${PATH_OPENCV})
        list(APPEND CMAKE_PREFIX_PATH ${PATH_OPENCV}/x64/vc17)
        set(OpenCV_DIR ${PATH_OPENCV}/x64/vc17/lib)
        find_package(OpenCV CONFIG REQUIRED)
        message("找到opencv,将启用opencv库")
        set(USE_OPENCV ON)
    else ()
        message("opencv根目录不正确,不启用opencv")
    endif ()
else ()
    message("未配置opencv根目录,不启用oepncv")
endif ()


