Compiling opencv samples: unknown cmake command ocv_check_dependencies

后端 未结 8 1075
余生分开走
余生分开走 2020-12-06 02:05

I am trying to build the OpenCV samples which come with the source package and I get the following:

CMake Error at CMakeLists.txt:10 (ocv_check_dependencies)         


        
相关标签:
8条回答
  • 2020-12-06 02:30

    Actually for OpenCV 2.4.4 beta the root CMakeList.txt file says:

    OCV_OPTION(BUILD_EXAMPLES "Build all examples"

    -DBUILD_EXAMPLES=ON worked just fine for me.

    0 讨论(0)
  • 2020-12-06 02:35

    The macro 'ocv_check_dependencies' is defined in: your_path_to/opencv/cmake/OpenCVModule.cmake

    # ensures that all passed modules are available
    # sets OCV_DEPENDENCIES_FOUND variable to TRUE/FALSE
    macro(ocv_check_dependencies)
      set(OCV_DEPENDENCIES_FOUND TRUE)
      foreach(d ${ARGN})
        if(d MATCHES "^opencv_[^ ]+$" AND NOT HAVE_${d})
          set(OCV_DEPENDENCIES_FOUND FALSE)
          break()
        endif()
      endforeach()
    endmacro()
    

    The top level CMakeLists.txt contains 'include' commands for files from opencv/cmake/ . Which is why the macro is available when you compile by calling cmake from the root of the opencv sources.

    0 讨论(0)
提交回复
热议问题