mmdeploy/backend_ops/ncnn/CMakeLists.txt
lvhan028 6fdf6b8616
apply cmake-format and refactor cmake scripts of building onnx and te… (#99)
* apply cmake-format and refactor cmake scripts of building onnx and tensorrt ops

* add static target

* suppress 'CMAKE_CUDA_ARCHITECTURES' warning when cmake with version 18 or later is used

* fix typo
2021-10-13 16:42:11 +08:00

24 lines
603 B
CMake
Executable File

set(TARGET_NAME mmlab_ncnn_ops)
set(SHARED_TARGET ${TARGET_NAME})
# ncnn
set(ncnn_DIR ${NCNN_DIR}/build/install/lib/cmake/ncnn)
find_package(ncnn)
if(ncnn_FOUND)
message(STATUS "ncnn library found!")
else()
message(FATAL_ERROR "Could not locate ncnn")
endif()
if(NOT ANDROID AND NOT IOS)
add_subdirectory(ops)
add_subdirectory(onnx2ncnn)
add_subdirectory(pyncnn_ext)
else()
# In case of embedded platform, like android, or ios, we only build custom ncnn
# ops, and leave the executable converter(onnx2ncnn, pyncnn_ext) built under
# the host platforms
add_subdirectory(ops)
endif()