Add get_openvino_libs

This commit is contained in:
zhoushunjie
2022-09-25 18:26:04 +08:00
parent 870c22c8e9
commit f142fcdf60
4 changed files with 27 additions and 41 deletions

17
FastDeployUtils.cmake Normal file
View File

@@ -0,0 +1,17 @@
CMAKE_MINIMUM_REQUIRED (VERSION 3.12)
function(get_openvino_libs OPENVINO_RUNTIME_DIR)
set(LIB_LIST "")
find_library(OPENVINO_LIB openvino ${OPENVINO_RUNTIME_DIR}/lib/ NO_DEFAULT_PATH)
list(APPEND LIB_LIST ${OPENVINO_LIB})
find_package(TBB PATHS "${OPENVINO_RUNTIME_DIR}/3rdparty/tbb")
if (TBB_FOUND)
list(APPEND LIB_LIST ${TBB_IMPORTED_TARGETS})
else()
# TODO(zhoushunjie): Use openvino with tbb on linux in future.
set(OMP_LIB "${OPENVINO_RUNTIME_DIR}/3rdparty/omp/lib/libiomp5.so")
list(APPEND LIB_LIST ${OMP_LIB})
endif()
set(OPENVINO_LIBS ${LIB_LIST} PARENT_SCOPE)
endfunction()