3.4: Support of OpenVINO interface libraries

original commit: c703f1eed6
pull/21551/head
Ilya Lavrenov 3 years ago committed by Alexander Alekhin
parent 441b6dbda0
commit 5b3d5f9f3c
  1. 3
      CMakeLists.txt
  2. 13
      cmake/OpenCVUtils.cmake

@ -1528,6 +1528,7 @@ if(WITH_INF_ENGINE OR INF_ENGINE_TARGET)
if(INF_ENGINE_TARGET)
list(GET INF_ENGINE_TARGET 0 ie_target)
set(__msg "YES (${INF_ENGINE_RELEASE} / ${INF_ENGINE_VERSION})")
ocv_get_imported_target(ie_target "${ie_target}")
get_target_property(_lib ${ie_target} IMPORTED_LOCATION)
get_target_property(_lib_imp_rel ${ie_target} IMPORTED_IMPLIB_RELEASE)
get_target_property(_lib_imp_dbg ${ie_target} IMPORTED_IMPLIB_DEBUG)
@ -1551,7 +1552,7 @@ if(WITH_INF_ENGINE OR INF_ENGINE_TARGET)
endif()
if(WITH_NGRAPH OR HAVE_NGRAPH)
if(HAVE_NGRAPH)
set(__target ngraph::ngraph)
ocv_get_imported_target(__target ngraph::ngraph)
set(__msg "YES (${ngraph_VERSION})")
get_target_property(_lib ${__target} IMPORTED_LOCATION)
get_target_property(_lib_imp_rel ${__target} IMPORTED_IMPLIB_RELEASE)

@ -1580,6 +1580,19 @@ function(ocv_add_library target)
endfunction()
# Returns the first non-interface target
function(ocv_get_imported_target imported interface)
set(__result "${interface}")
get_target_property(__type "${__result}" TYPE)
if(__type STREQUAL "INTERFACE_LIBRARY")
get_target_property(__libs "${__result}" INTERFACE_LINK_LIBRARIES)
list(GET __libs 0 __interface)
ocv_get_imported_target(__result "${__interface}")
endif()
set(${imported} "${__result}" PARENT_SCOPE)
endfunction()
macro(ocv_get_libname var_name)
get_filename_component(__libname "${ARGN}" NAME)
# libopencv_core.so.3.3 -> opencv_core

Loading…
Cancel
Save