forked from laugh12321/TensorRT-YOLO
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
147 lines (144 loc) · 3.7 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
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# this is the build file for project TensorRT-YOLO
# it is autogenerated by the xmake build system.
# do not edit by hand.
# project
cmake_minimum_required(VERSION 3.15.0)
cmake_policy(SET CMP0091 NEW)
project(TensorRT-YOLO VERSION 3.0 LANGUAGES CXX CUDA)
# target
add_library(deploy SHARED "")
set_target_properties(deploy PROPERTIES OUTPUT_NAME "deploy")
set_target_properties(deploy PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib")
target_include_directories(deploy PRIVATE
include
/home/TensorRT-8.6.1.6/include
/usr/local/cuda/include
)
target_include_directories(deploy INTERFACE
include
)
target_include_directories(deploy SYSTEM PRIVATE
/home/laugh/.xmake/packages/o/opencv/4.9.0/1da15ca47abb49738188ca51cf591e44/include/opencv4
/home/laugh/.xmake/packages/f/ffmpeg/6.1/a22c8e3a23d6487ab1d84fda709a103d/include
)
target_compile_definitions(deploy PRIVATE
ENABLE_DEPLOY_BUILDING_DLL
)
target_compile_options(deploy PRIVATE
$<$<COMPILE_LANGUAGE:C>:-m64>
$<$<COMPILE_LANGUAGE:CXX>:-m64>
$<$<COMPILE_LANGUAGE:C>:-DNDEBUG>
$<$<COMPILE_LANGUAGE:CXX>:-DNDEBUG>
$<$<COMPILE_LANGUAGE:CUDA>:-m64>
$<$<COMPILE_LANGUAGE:CUDA>:-rdc=true>
$<$<COMPILE_LANGUAGE:CUDA>:-gencode arch=compute_75,code=sm_75>
)
set_target_properties(deploy PROPERTIES CXX_EXTENSIONS OFF)
target_compile_features(deploy PRIVATE cxx_std_17)
if(MSVC)
target_compile_options(deploy PRIVATE $<$<CONFIG:Release>:-Ox -fp:fast>)
else()
target_compile_options(deploy PRIVATE -O3)
endif()
if(MSVC)
set_property(TARGET deploy PROPERTY
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()
target_link_libraries(deploy PRIVATE
nvinfer
nvinfer_plugin
nvparsers
nvonnxparser
opencv_phase_unwrapping
opencv_surface_matching
opencv_saliency
opencv_wechat_qrcode
opencv_mcc
opencv_face
opencv_img_hash
opencv_videostab
opencv_structured_light
opencv_intensity_transform
opencv_ccalib
opencv_line_descriptor
opencv_stereo
opencv_dnn_objdetect
opencv_dnn_superres
opencv_fuzzy
opencv_hfs
opencv_rapid
opencv_bgsegm
opencv_bioinspired
opencv_rgbd
opencv_dpm
opencv_aruco
opencv_reg
opencv_tracking
opencv_datasets
opencv_xfeatures2d
opencv_shape
opencv_superres
opencv_plot
opencv_quality
opencv_text
opencv_optflow
opencv_ximgproc
opencv_xobjdetect
opencv_xphoto
opencv_stitching
opencv_ml
opencv_photo
opencv_gapi
opencv_objdetect
opencv_highgui
opencv_videoio
opencv_video
opencv_calib3d
opencv_dnn
opencv_features2d
opencv_flann
opencv_imgcodecs
opencv_imgproc
opencv_core
ade
quirc
libprotobuf
libwebp
zlib
libtiff
libpng
libjpeg-turbo
avfilter
avdevice
avformat
avcodec
swscale
swresample
avutil
cudadevrt
cudart_static
rt
pthread
dl
)
target_link_directories(deploy PRIVATE
/home/TensorRT-8.6.1.6/lib
/usr/local/cuda/lib64
/home/laugh/.xmake/packages/o/opencv/4.9.0/1da15ca47abb49738188ca51cf591e44/lib
/home/laugh/.xmake/packages/o/opencv/4.9.0/1da15ca47abb49738188ca51cf591e44/lib/opencv4/3rdparty
/home/laugh/.xmake/packages/f/ffmpeg/6.1/a22c8e3a23d6487ab1d84fda709a103d/lib
)
target_link_options(deploy PRIVATE
-m64
-Wl,-Bsymbolic
)
target_sources(deploy PRIVATE
source/deploy/utils/utils.cpp
source/deploy/vision/visualize.cpp
source/deploy/vision/detection.cpp
source/deploy/core/tensor.cpp
source/deploy/core/types.cpp
source/deploy/core/core.cpp
source/deploy/vision/warp_affine.cu
)
set_target_properties(deploy PROPERTIES CUDA_SEPARABLE_COMPILATION ON)