Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Tetragramm
GitHub Repository: Tetragramm/opencv
Path: blob/master/samples/cpp/example_cmake/CMakeLists.txt
16337 views
1
# cmake needs this line
2
cmake_minimum_required(VERSION 3.1)
3
4
# Enable C++11
5
set(CMAKE_CXX_STANDARD 11)
6
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
7
8
# Define project name
9
project(opencv_example_project)
10
11
# Find OpenCV, you may need to set OpenCV_DIR variable
12
# to the absolute path to the directory containing OpenCVConfig.cmake file
13
# via the command line or GUI
14
find_package(OpenCV REQUIRED)
15
16
# If the package has been found, several variables will
17
# be set, you can find the full list with descriptions
18
# in the OpenCVConfig.cmake file.
19
# Print some message showing some of them
20
message(STATUS "OpenCV library status:")
21
message(STATUS " config: ${OpenCV_DIR}")
22
message(STATUS " version: ${OpenCV_VERSION}")
23
message(STATUS " libraries: ${OpenCV_LIBS}")
24
message(STATUS " include path: ${OpenCV_INCLUDE_DIRS}")
25
26
# Declare the executable target built from your sources
27
add_executable(opencv_example example.cpp)
28
29
# Link your application with OpenCV libraries
30
target_link_libraries(opencv_example ${OpenCV_LIBS})
31
32