Path: blob/master/samples/cpp/example_cmake/CMakeLists.txt
16337 views
# cmake needs this line1cmake_minimum_required(VERSION 3.1)23# Enable C++114set(CMAKE_CXX_STANDARD 11)5set(CMAKE_CXX_STANDARD_REQUIRED TRUE)67# Define project name8project(opencv_example_project)910# Find OpenCV, you may need to set OpenCV_DIR variable11# to the absolute path to the directory containing OpenCVConfig.cmake file12# via the command line or GUI13find_package(OpenCV REQUIRED)1415# If the package has been found, several variables will16# be set, you can find the full list with descriptions17# in the OpenCVConfig.cmake file.18# Print some message showing some of them19message(STATUS "OpenCV library status:")20message(STATUS " config: ${OpenCV_DIR}")21message(STATUS " version: ${OpenCV_VERSION}")22message(STATUS " libraries: ${OpenCV_LIBS}")23message(STATUS " include path: ${OpenCV_INCLUDE_DIRS}")2425# Declare the executable target built from your sources26add_executable(opencv_example example.cpp)2728# Link your application with OpenCV libraries29target_link_libraries(opencv_example ${OpenCV_LIBS})303132