Could not find module FindOpenCV.cmake ( Error in configuration process)

前端 未结 12 2220
既然无缘
既然无缘 2020-11-29 02:04

I wrote a CMakeLists.txt for a project in C++, which uses OpenCV libraries. When I try to create the project using cmake, I ge

12条回答
  •  执念已碎
    2020-11-29 02:25

    On my Fedora machine, when I typed "make" I got an error saying it could not find "cv.h". I fixed this by modifying my "OpenCVConfig.cmake" file.

    Before:

    SET(OpenCV_INCLUDE_DIRS "${OpenCV_INSTALL_PATH}/include/opencv;${OpenCV_INSTALL_PATH}/include")

    SET(OpenCV_LIB_DIR "${OpenCV_INSTALL_PATH}/lib64")

    After:

    SET(OpenCV_INCLUDE_DIRS "/usr/include/opencv;/usr/include/opencv2")

    SET(OpenCV_LIB_DIR "/usr/lib64")

提交回复
热议问题