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

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)