Files
openvino/cmake/templates/InferenceEngineDeveloperPackageConfig.cmake.in
Ilya Lavrenov 4ad20fb53f Use system dependencies (#11419)
* Try to improve gflags

* Try to improve gflags: part 2

* Tried to use dependencies on system

* Use nlohmann_jsonConfig from system

* Enabled nlohmann_json from system

* Improvements

* handle system gflags in developer package

* Simplifications

* Simplify dependency management

* Corrected package names

* Fixed subgraphsDumper configure stage

* Try to fix rhel8

* Try to fix macosx

* Fixed VPUX build

* Fixed aliasing issues

* Suppress some wanrings

* export gflags when build it

* Fixed some LTO

* Try to fix Mac

* revert

* use gflags as private dependency

* Aligned targets in developer package

* Fixed frontends tests build on U20 with LTO

* PAssed

* Don't use pkg_search_module(zlib ..) during cross-compilation

* Removed unused variables

* Fixed finding of zlib during cross-compilation
2022-04-05 04:47:22 +03:00

107 lines
3.3 KiB
CMake

# Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
@PACKAGE_INIT@
include(CMakeFindDependencyMacro)
# TODO: remove after changing [private plugins]
set_and_check(OpenVINO_SOURCE_DIR "@OpenVINO_SOURCE_DIR@") # KMB
set_and_check(OpenVINO_MAIN_SOURCE_DIR "@OpenVINO_SOURCE_DIR@") # KMB
# Variables to export in plugin's projects
set(ie_options "@IE_OPTIONS@")
list(APPEND ie_options CMAKE_CXX_COMPILER_LAUNCHER CMAKE_C_COMPILER_LAUNCHER
CMAKE_BUILD_TYPE CMAKE_SKIP_RPATH CMAKE_INSTALL_PREFIX)
file(TO_CMAKE_PATH "${CMAKE_CURRENT_LIST_DIR}" cache_path)
message(STATUS "The following CMake options are exported from Inference Engine Developer package")
message(" ")
foreach(option IN LISTS ie_options)
if(NOT DEFINED "${option}")
load_cache("${cache_path}" READ_WITH_PREFIX "" ${option})
endif()
message(" ${option}: ${${option}}")
endforeach()
message(" ")
# for samples in 3rd party projects
set_and_check(gflags_DIR "@gflags_BINARY_DIR@")
#
# Content
#
find_dependency(IEDevScripts
PATHS "${OpenVINO_SOURCE_DIR}/cmake/developer_package"
NO_CMAKE_FIND_ROOT_PATH
NO_DEFAULT_PATH)
find_dependency(InferenceEngine
PATHS "${CMAKE_CURRENT_LIST_DIR}"
NO_CMAKE_FIND_ROOT_PATH
NO_DEFAULT_PATH)
find_dependency(ngraph
PATHS "${CMAKE_CURRENT_LIST_DIR}"
NO_CMAKE_FIND_ROOT_PATH
NO_DEFAULT_PATH)
if(TARGET openvino::runtime AND NOT TARGET IE::runtime)
add_library(IE::runtime INTERFACE IMPORTED)
set_target_properties(IE::runtime PROPERTIES
INTERFACE_LINK_LIBRARIES openvino::runtime)
endif()
# WA for cmake: it exports ngraph as IE::ngraph in the IE export list
# while we already have ngraph export in its own export list as ngraph::ngraph
if(TARGET ngraph::ngraph AND NOT TARGET IE::ngraph)
add_library(IE::ngraph INTERFACE IMPORTED)
set_target_properties(IE::ngraph PROPERTIES INTERFACE_LINK_LIBRARIES ngraph::ngraph)
endif()
foreach(component @openvino_export_components@)
include("${CMAKE_CURRENT_LIST_DIR}/${component}_dev_targets.cmake")
endforeach()
if(TARGET IE::ov_core_dev AND NOT TARGET openvino::core::dev)
add_library(openvino::core::dev INTERFACE IMPORTED)
set_target_properties(openvino::core::dev PROPERTIES
INTERFACE_LINK_LIBRARIES IE::ov_core_dev)
endif()
if(TARGET IE::runtime::dev AND NOT TARGET openvino::runtime::dev)
add_library(openvino::runtime::dev INTERFACE IMPORTED)
set_target_properties(openvino::runtime::dev PROPERTIES
INTERFACE_LINK_LIBRARIES IE::runtime::dev)
endif()
if(ENABLE_SYSTEM_PUGIXML)
find_dependency(PugiXML)
set_property(TARGET pugixml PROPERTY IMPORTED_GLOBAL TRUE)
add_library(IE::pugixml ALIAS pugixml)
endif()
# inherit OpenCV from main IE project if enabled
if ("@OpenCV_FOUND@")
load_cache("${cache_path}" READ_WITH_PREFIX "" OpenCV_DIR)
find_dependency(OpenCV)
endif()
#
# Extra Compile Flags
#
if(CMAKE_COMPILER_IS_GNUCXX)
ie_add_compiler_flags(-Wno-error=unused-variable)
ie_add_compiler_flags(-Wno-error=unused-but-set-variable)
if(SUGGEST_OVERRIDE_SUPPORTED)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-suggest-override")
endif()
endif()
# Don't threat deprecated API warnings as errors in 3rd party apps
ie_deprecated_no_errors()