-
Notifications
You must be signed in to change notification settings - Fork 649
/
Copy pathCMakeLists.txt
37 lines (34 loc) · 1.33 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
# Copyright (c) OpenMMLab. All rights reserved.
cmake_minimum_required(VERSION 3.14)
project(mmdeploy-example)
if (NOT (${CMAKE_PROJECT_NAME} STREQUAL "MMDeploy"))
find_package(MMDeploy REQUIRED)
endif ()
function(add_example task name)
if (TARGET mmdeploy_${task})
# Search for c/cpp sources
file(GLOB _SRCS ${name}.c*)
add_executable(${name} ${_SRCS})
if (NOT (MSVC OR APPLE))
# Disable new dtags so that executables can run even without LD_LIBRARY_PATH set
target_link_libraries(${name} PRIVATE -Wl,--disable-new-dtags)
endif ()
if (MMDEPLOY_BUILD_SDK_MONOLITHIC)
target_link_libraries(${name} PRIVATE mmdeploy ${OpenCV_LIBS})
else ()
# Load MMDeploy modules
mmdeploy_load_static(${name} MMDeployStaticModules)
mmdeploy_load_dynamic(${name} MMDeployDynamicModules)
# Link to MMDeploy libraries
target_link_libraries(${name} PRIVATE MMDeployLibs ${OpenCV_LIBS})
endif ()
install(TARGETS ${name} RUNTIME DESTINATION bin)
endif ()
endfunction()
add_example(classifier image_classification)
add_example(detector object_detection)
add_example(segmentor image_segmentation)
add_example(restorer image_restorer)
add_example(text_detector ocr)
add_example(pose_detector pose_detection)
add_example(rotated_detector rotated_object_detection)