Merge pull request #16544 from ilya-lavrenov:il/custom-ie-libraries

This commit is contained in:
Alexander Alekhin 2020-02-10 14:09:43 +00:00
commit a631196155

View File

@ -29,13 +29,16 @@ function(add_custom_ie_build _inc _lib _lib_rel _lib_dbg _msg)
INTERFACE_INCLUDE_DIRECTORIES "${_inc}" INTERFACE_INCLUDE_DIRECTORIES "${_inc}"
) )
find_library(ie_builder_custom_lib "inference_engine_nn_builder" PATHS "${INF_ENGINE_LIB_DIRS}" NO_DEFAULT_PATH) set(custom_libraries "")
if(EXISTS "${ie_builder_custom_lib}") file(GLOB libraries "${INF_ENGINE_LIB_DIRS}/${CMAKE_SHARED_LIBRARY_PREFIX}inference_engine_*${CMAKE_SHARED_LIBRARY_SUFFIX}")
add_library(inference_engine_nn_builder UNKNOWN IMPORTED) foreach(full_path IN LISTS libraries)
set_target_properties(inference_engine_nn_builder PROPERTIES get_filename_component(library "${full_path}" NAME_WE)
IMPORTED_LOCATION "${ie_builder_custom_lib}" string(REPLACE "${CMAKE_SHARED_LIBRARY_PREFIX}" "" library "${library}")
) add_library(${library} UNKNOWN IMPORTED)
endif() set_target_properties(${library} PROPERTIES
IMPORTED_LOCATION "${full_path}")
list(APPEND custom_libraries ${library})
endforeach()
if(NOT INF_ENGINE_RELEASE VERSION_GREATER "2018050000") if(NOT INF_ENGINE_RELEASE VERSION_GREATER "2018050000")
find_library(INF_ENGINE_OMP_LIBRARY iomp5 PATHS "${INF_ENGINE_OMP_DIR}" NO_DEFAULT_PATH) find_library(INF_ENGINE_OMP_LIBRARY iomp5 PATHS "${INF_ENGINE_OMP_DIR}" NO_DEFAULT_PATH)
@ -46,12 +49,7 @@ function(add_custom_ie_build _inc _lib _lib_rel _lib_dbg _msg)
endif() endif()
endif() endif()
set(INF_ENGINE_VERSION "Unknown" CACHE STRING "") set(INF_ENGINE_VERSION "Unknown" CACHE STRING "")
set(INF_ENGINE_TARGET inference_engine) set(INF_ENGINE_TARGET "inference_engine;${custom_libraries}" PARENT_SCOPE)
if(TARGET inference_engine_nn_builder)
list(APPEND INF_ENGINE_TARGET inference_engine_nn_builder)
set(_msg "${_msg}, with IE NN Builder API")
endif()
set(INF_ENGINE_TARGET "${INF_ENGINE_TARGET}" PARENT_SCOPE)
message(STATUS "Detected InferenceEngine: ${_msg}") message(STATUS "Detected InferenceEngine: ${_msg}")
endfunction() endfunction()