Skip to content

Commit

Permalink
avoid linking static libs in monolithic build (#1797)
Browse files Browse the repository at this point in the history
  • Loading branch information
lzhangzz authored Feb 23, 2023
1 parent f78a452 commit 7029e90
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion csrc/mmdeploy/apis/cxx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,28 @@ target_include_directories(${PROJECT_NAME} INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include>)
target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_17)
target_link_libraries(${PROJECT_NAME} INTERFACE mmdeploy::core)
set(_tasks ${MMDEPLOY_TASKS} pipeline)
foreach (task ${_tasks})
target_link_libraries(mmdeploy_${task} INTERFACE ${PROJECT_NAME})
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/mmdeploy/${task}.hpp
DESTINATION include/mmdeploy)
endforeach ()
if (TARGET mmdeploy)
target_include_directories(${PROJECT_NAME} INTERFACE
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/csrc>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/third_party/outcome>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/third_party/json>
)
target_include_directories(${PROJECT_NAME} INTERFACE
$<INSTALL_INTERFACE:include>
$<INSTALL_INTERFACE:include/mmdeploy/third_party/outcome>
$<INSTALL_INTERFACE:include/mmdeploy/third_party/json>
)
if (NOT MMDEPLOY_SPDLOG_EXTERNAL)
target_include_directories(${PROJECT_NAME} INTERFACE
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/third_party/spdlog/include>
$<INSTALL_INTERFACE:include/mmdeploy/third_party>)
endif ()
target_link_libraries(mmdeploy INTERFACE ${PROJECT_NAME})
endif ()
mmdeploy_export(${PROJECT_NAME})
Expand Down

0 comments on commit 7029e90

Please sign in to comment.