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
555 B
CMake
Executable File
15 lines
555 B
CMake
Executable File
find_package(Protobuf)
|
|
|
|
if(PROTOBUF_FOUND)
|
|
protobuf_generate_cpp(ONNX_PROTO_SRCS ONNX_PROTO_HDRS
|
|
${NCNN_DIR}/tools/onnx/onnx.proto)
|
|
add_executable(onnx2ncnn onnx2ncnn.cpp ${ONNX_PROTO_SRCS} ${ONNX_PROTO_HDRS})
|
|
target_include_directories(onnx2ncnn PRIVATE ${PROTOBUF_INCLUDE_DIR}
|
|
${CMAKE_CURRENT_BINARY_DIR})
|
|
target_link_libraries(onnx2ncnn PRIVATE ${PROTOBUF_LIBRARIES})
|
|
|
|
else()
|
|
message(
|
|
FATAL_ERROR "Protobuf not found, onnx model convert tool won't be built")
|
|
endif()
|