-
Notifications
You must be signed in to change notification settings - Fork 152
/
CMakeLists.txt
39 lines (29 loc) · 1.07 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
cmake_minimum_required(VERSION 3.14)
project(yolo_inference)
find_package(Torch REQUIRED)
find_package(TorchVision REQUIRED)
find_package(OpenCV REQUIRED)
# 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
message(STATUS "OpenCV library status:")
message(STATUS " config: ${OpenCV_DIR}")
message(STATUS " version: ${OpenCV_VERSION}")
message(STATUS " libraries: ${OpenCV_LIBS}")
message(STATUS " include path: ${OpenCV_INCLUDE_DIRS}")
# This due to some headers importing Python.h
find_package(Python3 COMPONENTS Development)
include_directories(${PROJECT_SOURCE_DIR}/include)
FILE(GLOB YOLO_SOURCE_FILES src/*.cpp)
add_executable(yolo_inference ${YOLO_SOURCE_FILES})
target_compile_features(yolo_inference PUBLIC cxx_range_for)
target_link_libraries(
yolo_inference
${OpenCV_LIBS}
${TORCH_LIBRARIES}
TorchVision::TorchVision
Python3::Python
)
# set C++14 to compile
set_property(TARGET yolo_inference PROPERTY CXX_STANDARD 14)