101 lines
3.0 KiB
CMake
101 lines
3.0 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@;CMAKE_BUILD_TYPE;CMAKE_SKIP_RPATH")
|
|
list(APPEND ie_options CMAKE_CXX_COMPILER_LAUNCHER CMAKE_C_COMPILER_LAUNCHER)
|
|
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)
|
|
|
|
find_dependency(OpenVINODeveloperPackage
|
|
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(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(NOT MSVC)
|
|
ie_add_compiler_flags(-Wno-error=unused-variable)
|
|
if(CMAKE_COMPILER_IS_GNUCXX)
|
|
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()
|
|
endif()
|
|
|
|
# Don't threat deprecated API warnings as errors in 3rd party apps
|
|
ie_deprecated_no_errors()
|