-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
116 lines (97 loc) · 2.17 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
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
if(EMSCRIPTEN)
return()
endif()
if(NOT TARGET score_lib_base)
include("${SCORE_SOURCE_DIR}/cmake/ScoreExternalAddon.cmake")
endif()
project(score_addon_onnx LANGUAGES CXX)
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/onnxruntime.cmake")
if(NOT TARGET onnxruntime::onnxruntime)
return()
endif()
# General initialization
score_common_setup()
if(0)
# Creation of the library
add_library(score_addon_onnx
Onnx/Executor.hpp
Onnx/Executor.cpp
Onnx/Metadata.hpp
Onnx/Process.hpp
Onnx/Process.cpp
Onnx/CommandFactory.hpp
Onnx/CommandFactory.cpp
score_addon_onnx.hpp
score_addon_onnx.cpp
)
# Scan for commands which creates necessary files
# Second argument must be a CMake list of all headers containing commands
score_generate_command_list_file(
score_addon_onnx
"Onnx/CommandFactory.hpp"
)
# Target-specific options
setup_score_plugin(score_addon_onnx)
endif()
avnd_score_plugin_init(BASE_TARGET score_addon_onnx_models)
avnd_score_plugin_add(
BASE_TARGET
score_addon_onnx_models
SOURCES
OnnxModels/YOLO-blob.hpp
OnnxModels/YOLO-blob.cpp
TARGET
yolo-blob
MAIN_CLASS
YOLOBlobDetector
NAMESPACE
OnnxModels
)
avnd_score_plugin_add(
BASE_TARGET
score_addon_onnx_models
SOURCES
OnnxModels/Resnet.hpp
OnnxModels/Resnet.cpp
TARGET
resnet
MAIN_CLASS
ResnetDetector
NAMESPACE
OnnxModels
)
avnd_score_plugin_add(
BASE_TARGET
score_addon_onnx_models
SOURCES
OnnxModels/YOLO-pose.hpp
OnnxModels/YOLO-pose.cpp
TARGET
yolo-pose
MAIN_CLASS
PoseDetector
NAMESPACE
OnnxModels::Yolo
)
avnd_score_plugin_add(
BASE_TARGET
score_addon_onnx_models
SOURCES
OnnxModels/BlazePose.hpp
OnnxModels/BlazePose.cpp
TARGET
blazepose
MAIN_CLASS
BlazePoseDetector
NAMESPACE
OnnxModels
)
# target_link_libraries(score_addon_onnx_models PRIVATE score_addon_onnx)
avnd_score_plugin_finalize(BASE_TARGET score_addon_onnx_models PLUGIN_VERSION 1
PLUGIN_UUID "24a98f5b-700f-401c-ab89-8c1173bda73f")
# Link
target_link_libraries(score_addon_onnx_models
PUBLIC
onnxruntime::onnxruntime
)