mirror of
https://github.com/opencv/opencv.git
synced 2024-11-27 12:40:05 +08:00
build(winpack_dldt): force using CMake config for InferenceEngine
This commit is contained in:
parent
3215db26aa
commit
888546b6f5
@ -26,7 +26,7 @@ endif()
|
||||
find_package(InferenceEngine QUIET)
|
||||
if(InferenceEngine_FOUND)
|
||||
set(INF_ENGINE_TARGET ${InferenceEngine_LIBRARIES})
|
||||
set(INF_ENGINE_VERSION "${InferenceEngine_VERSION}" CACHE STRING "")
|
||||
set(INF_ENGINE_VERSION "${InferenceEngine_VERSION}")
|
||||
message(STATUS "Detected InferenceEngine: cmake package (${InferenceEngine_VERSION})")
|
||||
endif()
|
||||
|
||||
|
@ -0,0 +1,29 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
set(PACKAGE_VERSION_MAJOR 2021)
|
||||
set(PACKAGE_VERSION_MINOR 4)
|
||||
set(PACKAGE_VERSION_PATCH 2)
|
||||
set(PACKAGE_VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}.${PACKAGE_VERSION_PATCH}")
|
||||
|
||||
set(PACKAGE_VERSION_EXACT False)
|
||||
set(PACKAGE_VERSION_COMPATIBLE False)
|
||||
|
||||
# Compatibility with old versioning for 2.x
|
||||
if(PACKAGE_FIND_VERSION_MAJOR VERSION_EQUAL 2)
|
||||
set(PACKAGE_VERSION_COMPATIBLE True)
|
||||
if(${CMAKE_FIND_PACKAGE_NAME}_FIND_REQUIRED)
|
||||
message(WARNING "Inference Engine versioning has changed. Use ${PACKAGE_VERSION} instead of ${PACKAGE_FIND_VERSION}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION)
|
||||
set(PACKAGE_VERSION_EXACT True)
|
||||
set(PACKAGE_VERSION_COMPATIBLE True)
|
||||
endif()
|
||||
|
||||
if(PACKAGE_FIND_VERSION_MAJOR EQUAL PACKAGE_VERSION_MAJOR AND
|
||||
PACKAGE_FIND_VERSION VERSION_LESS PACKAGE_VERSION)
|
||||
set(PACKAGE_VERSION_COMPATIBLE True)
|
||||
endif()
|
@ -0,0 +1,31 @@
|
||||
# Inference Engine CMake config for OpenCV windows package
|
||||
|
||||
get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
|
||||
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
|
||||
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
|
||||
|
||||
set(InferenceEngine_LIBRARIES IE::inference_engine)
|
||||
add_library(IE::inference_engine SHARED IMPORTED)
|
||||
|
||||
set_target_properties(IE::inference_engine PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/deployment_tools/inference_engine/include"
|
||||
)
|
||||
|
||||
# Import target "IE::inference_engine" for configuration "Debug"
|
||||
set_property(TARGET IE::inference_engine APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
|
||||
set_target_properties(IE::inference_engine PROPERTIES
|
||||
IMPORTED_IMPLIB_DEBUG "${_IMPORT_PREFIX}/deployment_tools/inference_engine/lib/intel64/inference_engined.lib"
|
||||
IMPORTED_LINK_DEPENDENT_LIBRARIES_DEBUG ""
|
||||
IMPORTED_LOCATION_DEBUG "${_IMPORT_PREFIX}/bin/inference_engined.dll"
|
||||
)
|
||||
|
||||
# Import target "IE::inference_engine" for configuration "Release"
|
||||
set_property(TARGET IE::inference_engine APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
set_target_properties(IE::inference_engine PROPERTIES
|
||||
IMPORTED_IMPLIB_RELEASE "${_IMPORT_PREFIX}/deployment_tools/inference_engine/lib/intel64/inference_engine.lib"
|
||||
IMPORTED_LINK_DEPENDENT_LIBRARIES_RELEASE ""
|
||||
IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/bin/inference_engine.dll"
|
||||
)
|
||||
|
||||
set(InferenceEngine_FOUND ON)
|
@ -1,3 +1,5 @@
|
||||
copytree(self.cpath / 'cmake', self.sysrootdir / 'deployment_tools' / 'inference_engine' / 'cmake')
|
||||
|
||||
sysroot_bin_dir = prepare_dir(self.sysrootdir / 'bin')
|
||||
copytree(self.build_dir / 'install', self.sysrootdir / 'ngraph')
|
||||
#rm_one(self.sysrootdir / 'ngraph' / 'lib' / 'ngraph.dll')
|
||||
|
@ -386,10 +386,9 @@ class Builder:
|
||||
if self.config.dldt_release:
|
||||
cmake_vars['INF_ENGINE_RELEASE'] = str(self.config.dldt_release)
|
||||
|
||||
cmake_vars['INF_ENGINE_LIB_DIRS:PATH'] = str(builderDLDT.sysrootdir / 'deployment_tools/inference_engine/lib/intel64')
|
||||
assert os.path.exists(cmake_vars['INF_ENGINE_LIB_DIRS:PATH']), cmake_vars['INF_ENGINE_LIB_DIRS:PATH']
|
||||
cmake_vars['INF_ENGINE_INCLUDE_DIRS:PATH'] = str(builderDLDT.sysrootdir / 'deployment_tools/inference_engine/include')
|
||||
assert os.path.exists(cmake_vars['INF_ENGINE_INCLUDE_DIRS:PATH']), cmake_vars['INF_ENGINE_INCLUDE_DIRS:PATH']
|
||||
InferenceEngine_DIR = str(builderDLDT.sysrootdir / 'deployment_tools' / 'inference_engine' / 'cmake')
|
||||
assert os.path.exists(InferenceEngine_DIR), InferenceEngine_DIR
|
||||
cmake_vars['InferenceEngine_DIR:PATH'] = InferenceEngine_DIR
|
||||
|
||||
ngraph_DIR = str(builderDLDT.sysrootdir / 'ngraph/cmake')
|
||||
if not os.path.exists(ngraph_DIR):
|
||||
|
Loading…
Reference in New Issue
Block a user