find_package(OpenCV REQUIRED) if (OpenCV_FOUND) # If the package has been found, several variables will # be set, you can find the full list with descriptions # in the OpenCVConfig.cmake file. # Print some message showing some of them include_directories(${OpenCV_INCLUDE_DIRS}) link_libraries(${OpenCV_LIBRARIES}) message(STATUS "OpenCV library status:") message(STATUS " version: ${OpenCV_VERSION}") message(STATUS " include path: ${OpenCV_INCLUDE_DIRS}") else () message(FATAL_ERROR "Could not locate OpenCV") endif()