forked from OAID/Tengine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
57 lines (50 loc) · 2.42 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
link_directories(${TENGINE_COMMON_LIB_DIRS})
# add examples with metal
# macro for adding test
macro (tengine_example name file)
add_executable(${name}
"${CMAKE_CURRENT_SOURCE_DIR}/${file}"
"${CMAKE_CURRENT_SOURCE_DIR}/common/tengine_operations.c")
target_link_libraries(${name} ${CMAKE_PROJECT_NAME})
include_directories("${PROJECT_SOURCE_DIR}/examples/common")
install (TARGETS ${name} DESTINATION bin)
endmacro()
# add c++ api examples
if (TENGINE_BUILD_CPP_API)
tengine_example(cpp_tm_classification cpp_tm_classification.cpp)
tengine_example(cpp_tm_mobilenet_ssd cpp_tm_mobilenet_ssd.cpp)
endif()
# add c api examples
tengine_example(tm_classification tm_classification.c)
tengine_example(tm_classification_fp16 tm_classification_fp16.c)
tengine_example(tm_classification_uint8 tm_classification_uint8.c)
tengine_example(tm_classification_vulkan tm_classification_vulkan.c)
tengine_example(tm_mobilenet_ssd tm_mobilenet_ssd.c)
tengine_example(tm_mobilenet_ssd_uint8 tm_mobilenet_ssd_uint8.cpp)
tengine_example(tm_mobilenet_ssd_acl tm_mobilenet_ssd_acl.c)
tengine_example(tm_retinaface tm_retinaface.cpp)
tengine_example(tm_yolov3_tiny tm_yolov3_tiny.cpp)
tengine_example(tm_yolov3_uint8 tm_yolov3_uint8.cpp)
tengine_example(tm_landmark tm_landmark.cpp)
tengine_example(tm_landmark_uint8 tm_landmark_uint8.cpp)
tengine_example(tm_mobilefacenet tm_mobilefacenet.cpp)
tengine_example(tm_yolov4 tm_yolov4.cpp)
# add examples with opencv
if (${TENGINE_TARGET_PROCESSOR} MATCHES "X86")
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
if(OpenCV_FOUND)
# macro for adding examples
macro (tengine_example_cv name file)
add_executable(${name}
"${CMAKE_CURRENT_SOURCE_DIR}/${file}"
"${CMAKE_CURRENT_SOURCE_DIR}/common/tengine_operations.c")
target_link_libraries(${name} ${CMAKE_PROJECT_NAME} ${OpenCV_LIBS})
install (TARGETS ${name} DESTINATION bin)
endmacro()
tengine_example_cv(tm_openpose tm_openpose.cpp)
tengine_example_cv(tm_yolact tm_yolact.cpp)
else()
message(WARNING "OpenCV not found, some examples won't be built")
endif()
endif()