mmdeploy/csrc/apis/c/CMakeLists.txt
lvhan028 e10a1b7c9e
Add more demos (#305)
* add more examples

* change to restore's output image to BGR

* use BUILD_SHARED_LIBS

* update graph module's cmake

* add condition for spdlog package

* change cmakelists

* update cmakelists

* add device_name in each demo

* remove duplicate cmake function

* use palette to draw segmentation's result

* no need to find_package(pplnn) when use MMDeploy's static libs

* remove MMDeploy_LIBS' dependency on spdlog

* #include <opencv2/imgproc/imgproc.hpp>

* change from mmdeploy_core to mmdeploy::core
2021-12-21 21:32:39 +08:00

45 lines
1.4 KiB
CMake

# Copyright (c) OpenMMLab. All rights reserved.
cmake_minimum_required(VERSION 3.14)
project(capis)
include(${CMAKE_SOURCE_DIR}/cmake/common.cmake)
if ("all" IN_LIST MMDEPLOY_CODEBASES)
set(TASK_LIST "classifier;detector;segmentor;text_detector;text_recognizer;restorer;model")
else ()
set(TASK_LIST "model")
if ("mmcls" IN_LIST MMDEPLOY_CODEBASES)
list(APPEND TASK_LIST "classifier")
endif ()
if ("mmdet" IN_LIST MMDEPLOY_CODEBASES)
list(APPEND TASK_LIST "detector")
endif ()
if ("mmseg" IN_LIST MMDEPLOY_CODEBASES)
list(APPEND TASK_LIST "segmentor")
endif ()
if ("mmedit" IN_LIST MMDEPLOY_CODEBASES)
list(APPEND TASK_LIST "restorer")
endif ()
if ("mmocr" IN_LIST MMDEPLOY_CODEBASES)
list(APPEND TASK_LIST "text_detector")
list(APPEND TASK_LIST "text_recognizer")
endif ()
endif ()
foreach (TASK ${TASK_LIST})
set(TARGET_NAME mmdeploy_${TASK})
build_target(${TARGET_NAME} ${TASK}.cpp)
target_link_libraries(${TARGET_NAME} PRIVATE mmdeploy::core)
target_include_directories(${TARGET_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include/c>)
export_target(${TARGET_NAME})
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${TASK}.h
DESTINATION include/c)
endforeach ()
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/common.h
DESTINATION include/c)