forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Openvino cmake config (openvinotoolkit#7419)
* Added OpenVINOConfig.cmake * OpenVINOConfig.cmake part 2 * Trying to fix cmake generation * Fixes * Export frontends as well * Fixed condition * Added OpenVINO cmake package usage: docs, C samples * Use more OpenVINO config * Install OpenVINOConfig.cmake * Trying to fix private plugins * Trying to fix .tox * Trying to fix ARM * Fixed samples build * Explicit ngraph duplicated targets * Fixed fuzzing tests build * Added IR frontend installation * Removed install directory for IE reader * Removed IR frontend from export list * Reverted ngraph_DIR * Try to fix .tox * Fixed ieFuncTests with ONNX extensions * Attempt #2 * Trying to fix ngraph setup.py * Fix * Trying to fix ONNX ngraph .tox CI * Trying to remove spaces * Fixed ngraph_DIR -> OpenVINO_DIR * Removed junk files * Try to fix ngraph wheel * Try to fix ie_wheel * Try to fix ngraph wheel
- Loading branch information
1 parent
deeb964
commit a952540
Showing
51 changed files
with
523 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright (C) 2018-2021 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
set(PACKAGE_VERSION_MAJOR @IE_VERSION_MAJOR@) | ||
set(PACKAGE_VERSION_MINOR @IE_VERSION_MINOR@) | ||
set(PACKAGE_VERSION_PATCH @IE_VERSION_PATCH@) | ||
set(PACKAGE_VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}.${PACKAGE_VERSION_PATCH}") | ||
|
||
set(PACKAGE_VERSION_EXACT False) | ||
set(PACKAGE_VERSION_COMPATIBLE False) | ||
|
||
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,203 @@ | ||
# Copyright (C) 2018-2021 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# FindOpenVINO | ||
# ------ | ||
# | ||
# Provides OpenVINO runtime for model creation and inference, frontend libraries | ||
# to convert models from framework specific formats. | ||
# | ||
# The following components are supported: | ||
# | ||
# * `Runtime`: OpenVINO C++ and C Core & Inference Runtime, frontend manager | ||
# * `ONNX`: OpenVINO ONNX frontend | ||
# * `PaddlePaddle`: OpenVINO PaddlePaddle frontend | ||
# | ||
# If no components are specified, `Runtime` component is provided: | ||
# | ||
# find_package(OpenVINO REQUIRED) # only Runtime component | ||
# | ||
# If specific components are required: | ||
# | ||
# find_package(OpenVINO REQUIRED COMPONENTS Runtime ONNX) | ||
# | ||
# Imported Targets: | ||
# ------ | ||
# | ||
# Runtime targets: | ||
# | ||
# `openvino::runtime` | ||
# The OpenVINO C++ Core & Inference Runtime | ||
# | ||
# `openvino::runtime::c` | ||
# The OpenVINO C Inference Runtime | ||
# | ||
# `openvino::core` | ||
# The OpenVINO C++ Core Runtime | ||
# | ||
# Frontend specific targets: | ||
# | ||
# `openvino::frontend::manager` | ||
# OpenVINO frontend manager | ||
# | ||
# `openvino::frontend::onnx` | ||
# ONNX FrontEnd target (optional) | ||
# | ||
# `openvino::frontend::paddlepaddle` | ||
# PaddlePaddle FrontEnd target (optional) | ||
# | ||
# Result variables: | ||
# ------ | ||
# | ||
# The module sets the following variables in your project: | ||
# | ||
# `OpenVINO_FOUND` | ||
# System has OpenVINO Runtime installed | ||
# | ||
# `OpenVINO_Runtime_FOUND` | ||
# OpenVINO C++ Core & Inference Runtime is available | ||
# | ||
# `OpenVINO_Frontend_ONNX_FOUND` | ||
# OpenVINO ONNX frontend is available | ||
# | ||
# `OpenVINO_Frontend_PaddlePaddle_FOUND` | ||
# OpenVINO PaddlePaddle frontend is available | ||
# | ||
# OpenVINO version variables: | ||
# | ||
# `OpenVINO_VERSION_MAJOR` | ||
# Major version component | ||
# | ||
# `OpenVINO_VERSION_MINOR` | ||
# minor version component | ||
# | ||
# `OpenVINO_VERSION_PATCH` | ||
# Patch version component | ||
# | ||
|
||
@PACKAGE_INIT@ | ||
|
||
# | ||
# Common functions | ||
# | ||
|
||
if(NOT DEFINED CMAKE_FIND_PACKAGE_NAME) | ||
set(CMAKE_FIND_PACKAGE_NAME OpenVINO) | ||
set(_need_package_name_reset ON) | ||
endif() | ||
|
||
# we have to use our own version of find_dependency because of support cmake 3.7 | ||
macro(_ov_find_dependency dep) | ||
set(cmake_fd_quiet_arg) | ||
if(${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY) | ||
set(cmake_fd_quiet_arg QUIET) | ||
endif() | ||
set(cmake_fd_required_arg) | ||
if(${CMAKE_FIND_PACKAGE_NAME}_FIND_REQUIRED) | ||
set(cmake_fd_required_arg REQUIRED) | ||
endif() | ||
|
||
get_property(cmake_fd_alreadyTransitive GLOBAL PROPERTY | ||
_CMAKE_${dep}_TRANSITIVE_DEPENDENCY) | ||
|
||
find_package(${dep} ${ARGN} | ||
${cmake_fd_quiet_arg} | ||
${cmake_fd_required_arg}) | ||
|
||
if(NOT DEFINED cmake_fd_alreadyTransitive OR cmake_fd_alreadyTransitive) | ||
set_property(GLOBAL PROPERTY _CMAKE_${dep}_TRANSITIVE_DEPENDENCY TRUE) | ||
endif() | ||
|
||
if(NOT ${dep}_FOUND) | ||
set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "${CMAKE_FIND_PACKAGE_NAME} could not be found because dependency ${dep} could not be found.") | ||
set(${CMAKE_FIND_PACKAGE_NAME}_FOUND False) | ||
return() | ||
endif() | ||
|
||
set(cmake_fd_required_arg) | ||
set(cmake_fd_quiet_arg) | ||
endmacro() | ||
|
||
function(_ov_target_no_deprecation_error) | ||
if(NOT MSVC) | ||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel") | ||
set(flags "-diag-warning=1786") | ||
else() | ||
set(flags "-Wno-error=deprecated-declarations") | ||
endif() | ||
if(CMAKE_CROSSCOMPILING) | ||
set_target_properties(${ARGV} PROPERTIES | ||
INTERFACE_LINK_OPTIONS "-Wl,--allow-shlib-undefined") | ||
endif() | ||
|
||
set_target_properties(${ARGV} PROPERTIES INTERFACE_COMPILE_OPTIONS ${flags}) | ||
endif() | ||
endfunction() | ||
|
||
# | ||
# OpenVINO config | ||
# | ||
|
||
# need to store current PACKAGE_PREFIX_DIR, because it's overwritten by sub-package one | ||
set(_ov_package_prefix_dir "${PACKAGE_PREFIX_DIR}") | ||
|
||
set(THREADING "@THREADING@") | ||
if(THREADING STREQUAL "TBB" OR THREADING STREQUAL "TBB_AUTO" AND NOT TBB_FOUND) | ||
set_and_check(_tbb_dir "@PACKAGE_IE_TBB_DIR@") | ||
_ov_find_dependency(TBB | ||
COMPONENTS tbb tbbmalloc | ||
CONFIG | ||
PATHS ${TBBROOT}/cmake | ||
${_tbb_dir} | ||
NO_CMAKE_FIND_ROOT_PATH | ||
NO_DEFAULT_PATH) | ||
endif() | ||
|
||
if(NOT TARGET inference_engine) | ||
set(_ov_as_external_package ON) | ||
include("${CMAKE_CURRENT_LIST_DIR}/OpenVINOTargets.cmake") | ||
endif() | ||
|
||
# | ||
# Components | ||
# | ||
|
||
set(${CMAKE_FIND_PACKAGE_NAME}_Runtime_FOUND ON) | ||
|
||
set(${CMAKE_FIND_PACKAGE_NAME}_ONNX_FOUND @NGRAPH_ONNX_FRONTEND_ENABLE@) | ||
set(${CMAKE_FIND_PACKAGE_NAME}_PaddlePaddle_FOUND @NGRAPH_PDPD_FRONTEND_ENABLE@) | ||
|
||
set(${CMAKE_FIND_PACKAGE_NAME}_Frontend_ONNX_FOUND ${${CMAKE_FIND_PACKAGE_NAME}_ONNX_FOUND}) | ||
set(${CMAKE_FIND_PACKAGE_NAME}_Frontend_PaddlePaddle_FOUND ${${CMAKE_FIND_PACKAGE_NAME}_PaddlePaddle_FOUND}) | ||
|
||
# if no components specified, only Runtime is provided | ||
if(NOT ${CMAKE_FIND_PACKAGE_NAME}_FIND_COMPONENTS) | ||
set(${CMAKE_FIND_PACKAGE_NAME}_FIND_COMPONENTS Runtime) | ||
endif() | ||
|
||
# | ||
# Apply common functions | ||
# | ||
|
||
foreach(target openvino::runtime openvino::runtime::c openvino::core | ||
openvino::frontend::manager openvino::frontend::onnx | ||
openvino::frontend::paddlepaddle) | ||
if(TARGET ${target} AND _ov_as_external_package) | ||
_ov_target_no_deprecation_error(${target}) | ||
endif() | ||
endforeach() | ||
unset(_ov_as_external_package) | ||
|
||
# restore PACKAGE_PREFIX_DIR | ||
set(PACKAGE_PREFIX_DIR ${_ov_package_prefix_dir}) | ||
unset(_ov_package_prefix_dir) | ||
|
||
check_required_components(${CMAKE_FIND_PACKAGE_NAME}) | ||
|
||
if(_need_package_name_reset) | ||
unset(CMAKE_FIND_PACKAGE_NAME) | ||
unset(_need_package_name_reset) | ||
endif() | ||
|
||
unset(${CMAKE_FIND_PACKAGE_NAME}_PaddlePaddle_FOUND) | ||
unset(${CMAKE_FIND_PACKAGE_NAME}_ONNX_FOUND) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.