1# cmake needs this line 2cmake_minimum_required(VERSION 2.8) 3 4# Define project name 5project(opencv_example_project) 6 7# Find OpenCV, you may need to set OpenCV_DIR variable 8# to the absolute path to the directory containing OpenCVConfig.cmake file 9# via the command line or GUI 10find_package(OpenCV REQUIRED) 11 12# If the package has been found, several variables will 13# be set, you can find the full list with descriptions 14# in the OpenCVConfig.cmake file. 15# Print some message showing some of them 16message(STATUS "OpenCV library status:") 17message(STATUS " version: ${OpenCV_VERSION}") 18message(STATUS " libraries: ${OpenCV_LIBS}") 19message(STATUS " include path: ${OpenCV_INCLUDE_DIRS}") 20 21# Add OpenCV headers location to your include paths 22include_directories(${OpenCV_INCLUDE_DIRS}) 23 24# Declare the executable target built from your sources 25add_executable(opencv_example example.cpp) 26 27# Link your application with OpenCV libraries 28target_link_libraries(opencv_example ${OpenCV_LIBS}) 29