mirror of
https://github.com/open-mmlab/mmdeploy.git
synced 2025-01-14 08:09:43 +08:00
* 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
15 lines
487 B
CMake
Executable File
15 lines
487 B
CMake
Executable File
# ncnn
|
|
set(ncnn_DIR ${NCNN_DIR}/build/install/lib/cmake/ncnn)
|
|
find_package(ncnn)
|
|
|
|
# pybind11
|
|
set(PYBIND11_DIR ${NCNN_DIR}/python/pybind11)
|
|
add_subdirectory(${PYBIND11_DIR} pybind11)
|
|
|
|
include_directories(${pybind11_INCLUDE_DIR} ${PYTHON_INCLUDE_DIRS})
|
|
pybind11_add_module(ncnn_ext ncnn_ext.cpp)
|
|
target_link_libraries(ncnn_ext PUBLIC ncnn ${SHARED_TARGET})
|
|
set_target_properties(
|
|
ncnn_ext PROPERTIES LIBRARY_OUTPUT_DIRECTORY
|
|
${CMAKE_SOURCE_DIR}/mmdeploy/apis/ncnn)
|