Install tbbmalloc for pkg-config case (#12960)

This commit is contained in:
Ilya Lavrenov
2022-09-12 22:12:50 +04:00
committed by GitHub
parent 69f709028a
commit 3c24ee6cda
4 changed files with 45 additions and 28 deletions

View File

@@ -163,17 +163,15 @@ if((THREADING STREQUAL "TBB" OR THREADING STREQUAL "TBB_AUTO") AND NOT TBB_FOUND
pkg_search_module(tbb
${pkg_config_quiet_arg}
${pkg_config_required_arg}
IMPORTED_TARGET GLOBAL
IMPORTED_TARGET
tbb)
unset(pkg_config_quiet_arg)
unset(pkg_config_required_arg)
if(tbb_FOUND)
if(TARGET PkgConfig::tbb)
add_library(TBB::tbb ALIAS PkgConfig::tbb)
set(TBB_VERSION ${tbb_VERSION})
set(TBB_FOUND ${tbb_FOUND})
set(TBB_IMPORTED_TARGETS TBB::tbb)
elseif(${CMAKE_FIND_PACKAGE_NAME}_FIND_REQUIRED)
message(FATAL_ERROR "cmake v${CMAKE_VERSION} contains bug in function 'pkg_search_module', need to update to at least v3.16.0 version")
endif()
@@ -263,7 +261,7 @@ if(_OV_ENABLE_INTEL_MYRIAD AND NOT _OV_ENABLE_OPENVINO_BUILD_SHARED)
pkg_search_module(libusb
${pkg_config_quiet_arg}
${pkg_config_required_arg}
IMPORTED_TARGET GLOBAL
IMPORTED_TARGET
libusb-1.0)
unset(pkg_config_quiet_arg)
unset(pkg_config_required_arg)
@@ -280,7 +278,7 @@ if(NOT TARGET openvino)
# IMPORTED_LINK_DEPENDENT_LIBRARIES_** properties if no PUBLIC dependencies for the library
if((THREADING STREQUAL "TBB" OR THREADING STREQUAL "TBB_AUTO") AND TBB_FOUND)
foreach(type RELEASE DEBUG RELWITHDEBINFO MINSIZEREL)
foreach(tbb_target TBB::tbb TBB::tbbmalloc)
foreach(tbb_target TBB::tbb TBB::tbbmalloc PkgConfig::tbb)
if(TARGET ${tbb_target})
set_property(TARGET openvino::runtime APPEND PROPERTY IMPORTED_LINK_DEPENDENT_LIBRARIES_${type} "${tbb_target}")
endif()