-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
30 lines (23 loc) · 841 Bytes
/
CMakeLists.txt
File metadata and controls
30 lines (23 loc) · 841 Bytes
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
cmake_minimum_required(VERSION 3.19)
set(CMAKE_CXX_STANDARD 17)
project(myproject)
# find_package(OpenCV 4.0 COMPONENTS [comp_name])
# if(OpenCV_[comp_name]_FOUND)
# add_definitions("-DHAVE_[comp_name]")
find_package(OpenCV REQUIRED dnn highgui imgproc)
add_executable(mobilenet_image dnn_mobilenet.cpp)
add_executable(yolo_image dnn_yolo.cpp)
add_executable(maskrcnn_image dnn_maskrcnn.cpp)
foreach(item mobilenet_image yolo_image maskrcnn_image)
target_include_directories(${item} PUBLIC ${OpenCV_INCLUDE_DIRS})
target_link_libraries(${item}
opencv_dnn
opencv_highgui
opencv_imgproc
)
set(out_directory "$<TARGET_FILE_DIR:${item}>")
add_custom_command(TARGET ${item} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/resources ${out_directory}/resources
)
endforeach()