forked from Smorodov/Multitarget-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
102 lines (81 loc) · 2.63 KB
/
CMakeLists.txt
File metadata and controls
102 lines (81 loc) · 2.63 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
cmake_minimum_required(VERSION 3.5)
project(mdetection)
set(detector_sources
BaseDetector.cpp
MotionDetector.cpp
BackgroundSubtract.cpp
vibe_src/vibe.cpp
Subsense/BackgroundSubtractorLBSP.cpp
Subsense/BackgroundSubtractorLOBSTER.cpp
Subsense/BackgroundSubtractorSuBSENSE.cpp
Subsense/LBSP.cpp
FaceDetector.cpp
PedestrianDetector.cpp
pedestrians/c4-pedestrian-detector.cpp
SSDMobileNetDetector.cpp
YoloDetector.cpp
OCVDNNDetector.cpp
BaseDetector.h
MotionDetector.h
BackgroundSubtract.h
vibe_src/vibe.hpp
Subsense/BackgroundSubtractorLBSP.h
Subsense/BackgroundSubtractorLOBSTER.h
Subsense/BackgroundSubtractorSuBSENSE.h
Subsense/DistanceUtils.h
Subsense/LBSP.h
Subsense/RandUtils.h
FaceDetector.h
PedestrianDetector.h
pedestrians/c4-pedestrian-detector.h
SSDMobileNetDetector.h
YoloDetector.h
OCVDNNDetector.h
)
if (BUILD_YOLO_LIB)
set(detector_sources ${detector_sources} YoloDarknetDetector.cpp YoloDarknetDetector.h)
endif()
if (BUILD_YOLO_TENSORRT)
set(detector_sources ${detector_sources} YoloTensorRTDetector.cpp YoloTensorRTDetector.h)
endif()
SOURCE_GROUP("Detector" FILES ${detector_sources})
include(CheckIncludeFileCXX)
check_include_file_cxx(opencv2/bgsegm.hpp HAVE_OPENCV_CONTRIB)
if(HAVE_OPENCV_CONTRIB)
add_definitions(-DHAVE_OPENCV_CONTRIB)
option(USE_OCV_BGFG "Should use the bgfg algorithms from opencv_contrib?" ON)
else(HAVE_OPENCV_CONTRIB)
option(USE_OCV_BGFG "Should use the bgfg algorithms from opencv_contrib?" OFF)
endif(HAVE_OPENCV_CONTRIB)
if(USE_OCV_BGFG)
add_definitions(-DUSE_OCV_BGFG)
else()
remove_definitions(-DUSE_OCV_BGFG)
endif(USE_OCV_BGFG)
include_directories(${PROJECT_SOURCE_DIR})
include_directories(${PROJECT_SOURCE_DIR}/../src)
include_directories(${PROJECT_SOURCE_DIR}/../common)
if (CMAKE_COMPILER_IS_GNUCXX)
add_library(${PROJECT_NAME} SHARED
${detector_sources})
else(CMAKE_COMPILER_IS_GNUCXX)
add_library(${PROJECT_NAME}
${detector_sources})
endif()
if (CMAKE_COMPILER_IS_GNUCXX)
set(LIBS
${OpenCV_LIBS}
# iconv
)
else(CMAKE_COMPILER_IS_GNUCXX)
set(LIBS
${OpenCV_LIBS}
)
endif()
if (BUILD_YOLO_LIB)
set(LIBS ${LIBS} yolo_lib)
endif(BUILD_YOLO_LIB)
if (BUILD_YOLO_TENSORRT)
set(LIBS ${LIBS} yolo_rt_lib)
endif(BUILD_YOLO_TENSORRT)
target_link_libraries(${PROJECT_NAME} ${LIBS})