Add Python API (#31)

This commit is contained in:
Fangjun Kuang
2023-02-19 19:36:03 +08:00
committed by GitHub
parent 8acc059b3f
commit ea09d5fbc5
51 changed files with 967 additions and 57 deletions

View File

@@ -85,6 +85,7 @@ function(download_onnxruntime)
message(STATUS "location_onnxruntime: ${location_onnxruntime}")
add_library(onnxruntime SHARED IMPORTED)
set_target_properties(onnxruntime PROPERTIES
IMPORTED_LOCATION ${location_onnxruntime}
INTERFACE_INCLUDE_DIRECTORIES "${onnxruntime_SOURCE_DIR}/include"
@@ -100,6 +101,18 @@ function(download_onnxruntime)
${CMAKE_BINARY_DIR}/bin/${CMAKE_BUILD_TYPE}
)
endif()
if(UNIX AND NOT APPLE)
file(GLOB onnxruntime_lib_files "${onnxruntime_SOURCE_DIR}/lib/lib*")
elseif(APPLE)
file(GLOB onnxruntime_lib_files "${onnxruntime_SOURCE_DIR}/lib/lib*dylib")
elseif(WIN32)
file(GLOB onnxruntime_lib_files "${onnxruntime_SOURCE_DIR}/lib/*.dll")
endif()
message(STATUS "onnxruntime lib files: ${onnxruntime_lib_files}")
install(FILES ${onnxruntime_lib_files} DESTINATION lib)
endfunction()
download_onnxruntime()