File tree Expand file tree Collapse file tree 5 files changed +20
-9
lines changed Expand file tree Collapse file tree 5 files changed +20
-9
lines changed Original file line number Diff line number Diff line change @@ -99,10 +99,12 @@ include(cmake/MMDeploy.cmake)
9999add_subdirectory (csrc/mmdeploy)
100100
101101if (MMDEPLOY_BUILD_SDK)
102- install (TARGETS MMDeployStaticModules
103- MMDeployDynamicModules
104- MMDeployLibs
105- EXPORT MMDeployTargets)
102+ if (NOT MMDEPLOY_BUILD_SDK_MONOLITHIC)
103+ install (TARGETS MMDeployStaticModules
104+ MMDeployDynamicModules
105+ MMDeployLibs
106+ EXPORT MMDeployTargets)
107+ endif ()
106108
107109 if (MMDEPLOY_BUILD_TEST)
108110 add_subdirectory (tests/test_csrc)
Original file line number Diff line number Diff line change 11# Copyright (c) OpenMMLab. All rights reserved.
22
3- function (mmdeploy_export NAME )
3+ function (mmdeploy_export_impl NAME )
44 set (_LIB_DIR lib)
55 if (MSVC )
66 set (_LIB_DIR bin)
@@ -15,13 +15,22 @@ endfunction ()
1515macro (mmdeploy_add_net NAME )
1616 if (MMDEPLOY_DYNAMIC_BACKEND)
1717 mmdeploy_add_library(${NAME} SHARED ${ARGN} )
18+ # DYNAMIC_BACKEND implies BUILD_SDK_MONOLITHIC
19+ mmdeploy_export_impl(${NAME} )
1820 target_link_libraries (${PROJECT_NAME} PRIVATE mmdeploy)
1921 set (BACKEND_LIB_NAMES ${BACKEND_LIB_NAMES} ${PROJECT_NAME} PARENT_SCOPE)
2022 else ()
2123 mmdeploy_add_module(${NAME} ${ARGN} )
2224 endif ()
2325endmacro ()
2426
27+ function (mmdeploy_export NAME )
28+ if (NOT MMDEPLOY_BUILD_SDK_MONOLITHIC)
29+ mmdeploy_export_impl(${NAME} )
30+ endif ()
31+ endfunction ()
32+
33+
2534function (mmdeploy_add_library NAME )
2635 # EXCLUDE: exclude from registering & exporting
2736 cmake_parse_arguments (_MMDEPLOY "EXCLUDE" "" "" ${ARGN} )
Original file line number Diff line number Diff line change @@ -89,5 +89,5 @@ if (MMDEPLOY_BUILD_SDK_CSHARP_API OR MMDEPLOY_BUILD_SDK_MONOLITHIC)
8989 INSTALL_RPATH "\$ ORIGIN"
9090 BUILD_RPATH "\$ ORIGIN" )
9191 endif ()
92- mmdeploy_export (mmdeploy)
92+ mmdeploy_export_impl (mmdeploy)
9393endif ()
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ if (TARGET mmdeploy)
3434else ()
3535 target_link_libraries (${PROJECT_NAME} INTERFACE mmdeploy::core)
3636endif ()
37- mmdeploy_export (${PROJECT_NAME} )
37+ mmdeploy_export_impl (${PROJECT_NAME} )
3838install (FILES ${CMAKE_CURRENT_SOURCE_DIR} /mmdeploy/common.hpp
3939 DESTINATION include /mmdeploy)
4040install (DIRECTORY ${CMAKE_SOURCE_DIR} /demo/csrc/ DESTINATION example/cpp
Original file line number Diff line number Diff line change @@ -7,8 +7,8 @@ if (NOT (${CMAKE_PROJECT_NAME} STREQUAL "MMDeploy"))
77endif ()
88
99
10- function (add_example dep folder name )
11- if (NOT dep OR TARGET mmdeploy_ ${dep} )
10+ function (add_example task folder name )
11+ if (( NOT task) OR (task IN_LIST MMDEPLOY_TASKS) )
1212 # Search for c/cpp sources
1313 file (GLOB _SRCS ${folder} /${name} .c*)
1414 add_executable (${name} ${_SRCS} )
You can’t perform that action at this time.
0 commit comments