2022-01-19 01:07:49 +03:00
|
|
|
# Copyright (C) 2018-2022 Intel Corporation
|
2021-03-25 02:40:09 +03:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
2021-02-03 13:13:56 +03:00
|
|
|
#
|
|
|
|
|
|
2021-07-16 18:55:05 +03:00
|
|
|
if(SUGGEST_OVERRIDE_SUPPORTED)
|
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-suggest-override")
|
|
|
|
|
endif()
|
|
|
|
|
|
2021-06-23 09:53:18 +03:00
|
|
|
if(ENABLE_LTO)
|
|
|
|
|
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE ON)
|
|
|
|
|
endif()
|
|
|
|
|
|
2022-10-12 12:16:13 +04:00
|
|
|
if(ENABLE_PROFILING_ITT)
|
|
|
|
|
add_subdirectory(ittapi)
|
|
|
|
|
add_subdirectory(itt_collector EXCLUDE_FROM_ALL)
|
|
|
|
|
endif()
|
|
|
|
|
|
2022-11-14 12:57:27 +04:00
|
|
|
if(ENABLE_SAMPLES OR ENABLE_TESTS)
|
|
|
|
|
add_subdirectory(cnpy EXCLUDE_FROM_ALL)
|
|
|
|
|
endif()
|
2022-10-12 12:16:13 +04:00
|
|
|
|
2021-11-30 17:26:09 +03:00
|
|
|
if(ENABLE_INTEL_GPU)
|
2021-11-15 13:44:11 +03:00
|
|
|
add_subdirectory(ocl)
|
2021-09-23 18:42:19 +03:00
|
|
|
endif()
|
2021-06-22 17:39:39 +03:00
|
|
|
|
2021-06-23 09:53:18 +03:00
|
|
|
add_subdirectory(xbyak EXCLUDE_FROM_ALL)
|
|
|
|
|
openvino_developer_export_targets(COMPONENT openvino_common TARGETS xbyak)
|
2022-08-23 01:39:23 +04:00
|
|
|
ov_install_static_lib(xbyak ${OV_CPACK_COMP_CORE})
|
2021-06-23 09:53:18 +03:00
|
|
|
|
2022-04-05 04:47:22 +03:00
|
|
|
#
|
|
|
|
|
# zlib
|
|
|
|
|
#
|
|
|
|
|
|
2022-11-14 12:57:27 +04:00
|
|
|
if(ENABLE_SAMPLES OR ENABLE_TESTS)
|
|
|
|
|
if(NOT ANDROID)
|
|
|
|
|
find_package(PkgConfig QUIET)
|
|
|
|
|
if(PkgConfig_FOUND)
|
|
|
|
|
pkg_search_module(zlib QUIET
|
|
|
|
|
IMPORTED_TARGET GLOBAL
|
|
|
|
|
zlib)
|
|
|
|
|
if(zlib_FOUND)
|
|
|
|
|
add_library(zlib::zlib ALIAS PkgConfig::zlib)
|
|
|
|
|
message(STATUS "${PKG_CONFIG_EXECUTABLE}: zlib (${zlib_VERSION}) is found at ${zlib_PREFIX}")
|
|
|
|
|
endif()
|
2022-04-05 04:47:22 +03:00
|
|
|
endif()
|
|
|
|
|
endif()
|
|
|
|
|
|
2022-11-14 12:57:27 +04:00
|
|
|
if(NOT zlib_FOUND)
|
|
|
|
|
add_subdirectory(zlib EXCLUDE_FROM_ALL)
|
|
|
|
|
endif()
|
2022-04-05 04:47:22 +03:00
|
|
|
endif()
|
|
|
|
|
|
2021-07-02 11:36:31 +03:00
|
|
|
#
|
|
|
|
|
# Pugixml
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
if(ENABLE_SYSTEM_PUGIXML)
|
2022-09-10 02:10:24 +04:00
|
|
|
find_package(PkgConfig QUIET)
|
2022-07-20 08:53:17 +04:00
|
|
|
# try system pugixml first
|
|
|
|
|
find_package(PugiXML QUIET)
|
|
|
|
|
if(PugiXML_FOUND)
|
2022-09-06 13:03:40 +04:00
|
|
|
if(TARGET pugixml::shared)
|
|
|
|
|
# example: cross-compilation on debian
|
|
|
|
|
set(pugixml_target pugixml::shared)
|
2022-10-12 12:16:13 +04:00
|
|
|
elseif(TARGET pugixml::pugixml)
|
|
|
|
|
# or create an alias for pugixml::pugixml shared library
|
|
|
|
|
# example: pugixml brew package
|
|
|
|
|
set(pugixml_target pugixml::pugixml)
|
2022-08-12 11:35:56 +04:00
|
|
|
elseif(TARGET pugixml)
|
|
|
|
|
# or create an alias for pugixml shared library
|
|
|
|
|
# example: libpugixml-dev debian package
|
|
|
|
|
set(pugixml_target pugixml)
|
2022-09-10 02:10:24 +04:00
|
|
|
elseif(TARGET pugixml::static)
|
|
|
|
|
# sometimes pugixml::static target already exists, just need to make it global
|
|
|
|
|
# example: building using conda environment
|
|
|
|
|
set(pugixml_target pugixml::static)
|
2022-08-08 13:59:24 +04:00
|
|
|
else()
|
2022-08-12 11:35:56 +04:00
|
|
|
message(FATAL_ERROR "Failed to detect pugixml library target name")
|
2022-08-08 13:59:24 +04:00
|
|
|
endif()
|
2022-11-28 11:54:54 +04:00
|
|
|
# to property generate OpenVINO Developer packages files
|
|
|
|
|
set(PugiXML_FOUND ${PugiXML_FOUND} CACHE BOOL "" FORCE)
|
2022-09-12 07:57:21 +04:00
|
|
|
elseif(PkgConfig_FOUND AND NOT ANDROID)
|
2022-09-10 02:10:24 +04:00
|
|
|
# U18 case when cmake interface is not available
|
|
|
|
|
pkg_search_module(pugixml QUIET
|
|
|
|
|
IMPORTED_TARGET GLOBAL
|
|
|
|
|
pugixml)
|
|
|
|
|
if(pugixml_FOUND)
|
|
|
|
|
set(pugixml_target PkgConfig::pugixml)
|
|
|
|
|
# PATCH: on Ubuntu 18.04 pugixml.pc contains incorrect include directories
|
|
|
|
|
get_target_property(interface_include_dir ${pugixml_target} INTERFACE_INCLUDE_DIRECTORIES)
|
|
|
|
|
if(interface_include_dir AND NOT EXISTS "${interface_include_dir}")
|
|
|
|
|
set_target_properties(${pugixml_target} PROPERTIES
|
|
|
|
|
INTERFACE_INCLUDE_DIRECTORIES "")
|
|
|
|
|
endif()
|
|
|
|
|
message(STATUS "${PKG_CONFIG_EXECUTABLE}: pugixml (${pugixml_VERSION}) is found at ${pugixml_PREFIX}")
|
|
|
|
|
endif()
|
|
|
|
|
endif()
|
2022-08-12 11:35:56 +04:00
|
|
|
|
2022-11-28 11:54:54 +04:00
|
|
|
# debian 9 case: no cmake, no pkg-config files
|
|
|
|
|
if(NOT TARGET ${pugixml_target})
|
|
|
|
|
find_library(PUGIXML_LIBRARY NAMES pugixml DOC "Path to pugixml library")
|
|
|
|
|
if(PUGIXML_LIBRARY)
|
|
|
|
|
add_library(pugixml INTERFACE IMPORTED GLOBAL)
|
|
|
|
|
set_target_properties(pugixml PROPERTIES INTERFACE_LINK_LIBRARIES "${PUGIXML_LIBRARY}")
|
|
|
|
|
set(pugixml_target pugixml)
|
|
|
|
|
set(PugiXML_FOUND ON)
|
|
|
|
|
endif()
|
|
|
|
|
endif()
|
|
|
|
|
|
2022-09-10 02:10:24 +04:00
|
|
|
if(TARGET ${pugixml_target})
|
2022-08-12 11:35:56 +04:00
|
|
|
# we need to install dynamic library for wheel package
|
|
|
|
|
get_target_property(target_type ${pugixml_target} TYPE)
|
|
|
|
|
if(target_type STREQUAL "SHARED_LIBRARY")
|
2022-09-07 18:07:43 +04:00
|
|
|
get_target_property(imported_config ${pugixml_target} IMPORTED_CONFIGURATIONS)
|
|
|
|
|
get_target_property(pugixml_loc ${pugixml_target} IMPORTED_LOCATION_${imported_config})
|
2022-08-30 01:41:49 +04:00
|
|
|
get_filename_component(pugixml_dir "${pugixml_loc}" DIRECTORY)
|
2022-09-19 10:14:07 +04:00
|
|
|
get_filename_component(name_we "${pugixml_loc}" NAME_WE)
|
|
|
|
|
# grab all tbb files matching pattern
|
|
|
|
|
file(GLOB pugixml_files "${pugixml_dir}/${name_we}.*")
|
|
|
|
|
foreach(pugixml_file IN LISTS pugixml_files)
|
2022-11-02 07:58:58 +04:00
|
|
|
ov_install_with_name("${pugixml_file}" pugixml)
|
2022-09-19 10:14:07 +04:00
|
|
|
endforeach()
|
2022-09-10 02:10:24 +04:00
|
|
|
elseif(target_type STREQUAL "INTERFACE_LIBRARY")
|
|
|
|
|
get_target_property(pugixml_loc ${pugixml_target} INTERFACE_LINK_LIBRARIES)
|
2022-11-02 07:58:58 +04:00
|
|
|
file(GLOB pugixml_libs "${pugixml_loc}.*")
|
|
|
|
|
foreach(pugixml_lib IN LISTS pugixml_libs)
|
|
|
|
|
ov_install_with_name("${pugixml_lib}" pugixml)
|
2022-09-10 02:10:24 +04:00
|
|
|
endforeach()
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
# if dynamic libpugixml.so.1 and libpugixml.so.1.X are found
|
2022-11-02 07:58:58 +04:00
|
|
|
if(NOT pugixml_INSTALLED AND CPACK_GENERATOR MATCHES "^(DEB|RPM)$")
|
2022-10-12 12:16:13 +04:00
|
|
|
message(FATAL_ERROR "Debian | RPM package build requires shared Pugixml library")
|
2022-08-12 11:35:56 +04:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
set_target_properties(${pugixml_target} PROPERTIES IMPORTED_GLOBAL ON)
|
|
|
|
|
# create an alias for real target which can be shared or static
|
|
|
|
|
add_library(openvino::pugixml ALIAS ${pugixml_target})
|
2022-07-20 08:53:17 +04:00
|
|
|
else()
|
|
|
|
|
# reset to prevent improper code generation in OpenVINODeveloperPackage
|
|
|
|
|
set(ENABLE_SYSTEM_PUGIXML OFF CACHE BOOL "" FORCE)
|
|
|
|
|
endif()
|
|
|
|
|
endif()
|
|
|
|
|
|
2022-08-12 11:35:56 +04:00
|
|
|
if(NOT TARGET openvino::pugixml)
|
|
|
|
|
# use OpenVINO pugixml copy if system one is not found
|
2021-07-02 11:36:31 +03:00
|
|
|
function(ie_build_pugixml)
|
2021-11-12 22:42:27 +03:00
|
|
|
function(ie_build_pugixml_static)
|
|
|
|
|
set(BUILD_SHARED_LIBS OFF)
|
|
|
|
|
add_subdirectory(pugixml EXCLUDE_FROM_ALL)
|
|
|
|
|
endfunction()
|
|
|
|
|
ie_build_pugixml_static()
|
2021-07-02 11:36:31 +03:00
|
|
|
set_property(TARGET pugixml-static PROPERTY EXPORT_NAME pugixml)
|
2022-08-12 11:35:56 +04:00
|
|
|
add_library(openvino::pugixml ALIAS pugixml-static)
|
|
|
|
|
openvino_developer_export_targets(COMPONENT openvino_common TARGETS openvino::pugixml)
|
2022-08-23 01:39:23 +04:00
|
|
|
ov_install_static_lib(pugixml-static ${OV_CPACK_COMP_CORE})
|
2021-07-02 11:36:31 +03:00
|
|
|
endfunction()
|
|
|
|
|
|
|
|
|
|
ie_build_pugixml()
|
|
|
|
|
endif()
|
|
|
|
|
|
2021-06-23 09:53:18 +03:00
|
|
|
#
|
|
|
|
|
# Fluid, G-API, OpenCV HAL
|
|
|
|
|
#
|
|
|
|
|
|
2022-10-12 12:16:13 +04:00
|
|
|
if(ENABLE_GAPI_PREPROCESSING)
|
|
|
|
|
add_library(ocv_hal INTERFACE)
|
|
|
|
|
target_include_directories(ocv_hal INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/ocv")
|
2021-06-23 09:53:18 +03:00
|
|
|
|
2022-10-12 12:16:13 +04:00
|
|
|
add_subdirectory(ade EXCLUDE_FROM_ALL)
|
|
|
|
|
add_subdirectory(fluid/modules/gapi EXCLUDE_FROM_ALL)
|
2022-07-17 11:10:02 +04:00
|
|
|
|
2022-10-12 12:16:13 +04:00
|
|
|
if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 11 AND NOT OV_COMPILER_IS_CLANG)
|
|
|
|
|
target_compile_options(fluid PRIVATE "-Wno-maybe-uninitialized")
|
|
|
|
|
endif()
|
2022-07-17 11:10:02 +04:00
|
|
|
|
2022-10-12 12:16:13 +04:00
|
|
|
set_target_properties(ade fluid PROPERTIES FOLDER thirdparty)
|
|
|
|
|
openvino_developer_export_targets(COMPONENT openvino_common TARGETS ade fluid)
|
2021-06-23 09:53:18 +03:00
|
|
|
|
2022-10-12 12:16:13 +04:00
|
|
|
ov_install_static_lib(ade ${OV_CPACK_COMP_CORE})
|
|
|
|
|
ov_install_static_lib(fluid ${OV_CPACK_COMP_CORE})
|
|
|
|
|
endif()
|
2021-11-10 18:25:51 +03:00
|
|
|
|
2021-06-23 09:53:18 +03:00
|
|
|
#
|
|
|
|
|
# Gflags
|
|
|
|
|
#
|
|
|
|
|
|
2022-11-14 12:57:27 +04:00
|
|
|
if(ENABLE_SAMPLES OR ENABLE_COMPILE_TOOL OR ENABLE_TESTS)
|
2022-12-01 23:57:23 +04:00
|
|
|
if(LINUX)
|
2022-12-04 22:55:52 +04:00
|
|
|
if(OV_OS_RHEL)
|
2022-12-01 23:57:23 +04:00
|
|
|
set(gflag_component nothreads_shared)
|
2022-12-04 22:55:52 +04:00
|
|
|
elseif(OV_OS_DEBIAN)
|
2022-12-01 23:57:23 +04:00
|
|
|
set(gflag_component nothreads_static)
|
2022-11-08 15:04:57 +04:00
|
|
|
endif()
|
2022-12-01 23:57:23 +04:00
|
|
|
find_package(gflags QUIET OPTIONAL_COMPONENTS ${gflag_component})
|
2022-10-12 12:16:13 +04:00
|
|
|
endif()
|
2022-04-05 22:16:32 +03:00
|
|
|
|
2022-11-08 15:04:57 +04:00
|
|
|
if(gflags_FOUND)
|
|
|
|
|
if(TARGET gflags)
|
|
|
|
|
set_target_properties(gflags PROPERTIES IMPORTED_GLOBAL ON)
|
|
|
|
|
elseif(TARGET gflags_nothreads-static)
|
2022-12-01 23:57:23 +04:00
|
|
|
# Debian 9: gflag_component is ignored
|
2022-11-08 15:04:57 +04:00
|
|
|
set_target_properties(gflags_nothreads-static PROPERTIES IMPORTED_GLOBAL ON)
|
|
|
|
|
add_library(gflags ALIAS gflags_nothreads-static)
|
2022-12-01 23:57:23 +04:00
|
|
|
elseif(TARGET gflags_nothreads-shared)
|
|
|
|
|
# CentOS / RHEL / Fedora case
|
|
|
|
|
set_target_properties(gflags_nothreads-shared PROPERTIES IMPORTED_GLOBAL ON)
|
|
|
|
|
add_library(gflags ALIAS gflags_nothreads-shared)
|
2022-11-08 15:04:57 +04:00
|
|
|
elseif(TARGET ${GFLAGS_TARGET})
|
|
|
|
|
set_target_properties(${GFLAGS_TARGET} PROPERTIES IMPORTED_GLOBAL ON)
|
|
|
|
|
add_library(gflags ALIAS ${GFLAGS_TARGET})
|
|
|
|
|
else()
|
2022-12-01 23:57:23 +04:00
|
|
|
message(FATAL_ERROR "Internal error: failed to find imported target 'gflags' using '${gflag_component}' component")
|
2022-11-08 15:04:57 +04:00
|
|
|
endif()
|
2022-12-01 23:57:23 +04:00
|
|
|
|
|
|
|
|
message(STATUS "gflags (${gflags_VERSION}) is found at ${gflags_DIR} using '${gflag_component}' component")
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if(NOT TARGET gflags)
|
2022-11-08 15:04:57 +04:00
|
|
|
add_subdirectory(gflags EXCLUDE_FROM_ALL)
|
|
|
|
|
openvino_developer_export_targets(COMPONENT openvino_common TARGETS gflags)
|
2022-08-30 22:23:14 +04:00
|
|
|
endif()
|
2022-04-05 04:47:22 +03:00
|
|
|
endif()
|
2021-06-23 09:53:18 +03:00
|
|
|
|
2021-06-22 17:39:39 +03:00
|
|
|
#
|
|
|
|
|
# Google Tests framework
|
|
|
|
|
#
|
|
|
|
|
|
2022-09-20 10:56:46 +02:00
|
|
|
if(ENABLE_TESTS)
|
2022-10-12 12:16:13 +04:00
|
|
|
# TODO: migrate to official version of googltest
|
|
|
|
|
# find_package(GTest QUIET)
|
2021-06-22 17:39:39 +03:00
|
|
|
|
2022-10-12 12:16:13 +04:00
|
|
|
if(GTest_FOUND)
|
|
|
|
|
foreach(gtest_target gtest gtest_main gmock gmock_main)
|
|
|
|
|
set_target_properties(GTest::${gtest_target} PROPERTIES IMPORTED_GLOBAL ON)
|
|
|
|
|
add_library(${gtest_target} ALIAS GTest::${gtest_target})
|
|
|
|
|
endforeach()
|
|
|
|
|
else()
|
|
|
|
|
add_subdirectory(gtest EXCLUDE_FROM_ALL)
|
|
|
|
|
openvino_developer_export_targets(COMPONENT tests
|
|
|
|
|
TARGETS gmock gmock_main gtest gtest_main)
|
|
|
|
|
endif()
|
2021-06-22 17:39:39 +03:00
|
|
|
endif()
|
|
|
|
|
|
2021-07-16 18:55:05 +03:00
|
|
|
#
|
|
|
|
|
# Protobuf
|
|
|
|
|
#
|
|
|
|
|
|
2021-12-22 11:20:54 +03:00
|
|
|
if(ENABLE_OV_PADDLE_FRONTEND OR ENABLE_OV_ONNX_FRONTEND OR ENABLE_OV_TF_FRONTEND)
|
2021-12-08 08:17:31 +03:00
|
|
|
if(ENABLE_SYSTEM_PROTOBUF)
|
2021-07-20 18:13:22 +03:00
|
|
|
set(Protobuf_USE_STATIC_LIBS ON)
|
2022-10-15 01:15:03 +04:00
|
|
|
if(CMAKE_VERBOSE_MAKEFILE)
|
2021-07-20 18:13:22 +03:00
|
|
|
set(Protobuf_DEBUG ON)
|
|
|
|
|
endif()
|
2022-02-18 11:43:19 +03:00
|
|
|
find_package(Protobuf 3.18.2 REQUIRED)
|
2021-07-22 19:13:43 +03:00
|
|
|
set(Protobuf_LITE_LIBRARIES protobuf::libprotobuf-lite)
|
2021-11-28 21:36:24 +03:00
|
|
|
set(Protobuf_LIBRARIES protobuf::libprotobuf)
|
2022-09-03 10:50:01 +04:00
|
|
|
set(PROTOC_EXECUTABLE protobuf::protoc)
|
2021-07-20 18:13:22 +03:00
|
|
|
|
2022-09-03 10:50:01 +04:00
|
|
|
foreach(target ${PROTOC_EXECUTABLE} ${Protobuf_LIBRARIES} ${Protobuf_LITE_LIBRARIES})
|
2022-08-30 22:23:14 +04:00
|
|
|
set_property(TARGET ${target} PROPERTY IMPORTED_GLOBAL ON)
|
2021-07-20 18:13:22 +03:00
|
|
|
endforeach()
|
2021-07-16 18:55:05 +03:00
|
|
|
else()
|
2021-11-28 21:36:24 +03:00
|
|
|
add_subdirectory(protobuf EXCLUDE_FROM_ALL)
|
2021-07-16 18:55:05 +03:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
# forward variables used in the other places
|
2022-09-03 10:50:01 +04:00
|
|
|
set(PROTOC_DEPENDENCY ${PROTOC_DEPENDENCY} PARENT_SCOPE)
|
2021-07-20 18:13:22 +03:00
|
|
|
set(PROTOC_EXECUTABLE ${PROTOC_EXECUTABLE} PARENT_SCOPE)
|
2021-11-28 21:36:24 +03:00
|
|
|
set(Protobuf_LIBRARIES ${Protobuf_LIBRARIES} PARENT_SCOPE)
|
2021-07-22 19:13:43 +03:00
|
|
|
set(Protobuf_LITE_LIBRARIES ${Protobuf_LITE_LIBRARIES} PARENT_SCOPE)
|
2021-07-16 18:55:05 +03:00
|
|
|
set(Protobuf_INCLUDE_DIRS ${Protobuf_INCLUDE_DIRS} PARENT_SCOPE)
|
2022-01-14 10:02:26 +08:00
|
|
|
set(Protobuf_IN_FRONTEND ON PARENT_SCOPE)
|
2021-07-20 18:13:22 +03:00
|
|
|
|
|
|
|
|
# set public / interface compile options
|
2021-11-28 21:36:24 +03:00
|
|
|
foreach(target IN LISTS Protobuf_LITE_LIBRARIES Protobuf_LIBRARIES)
|
2021-07-20 18:13:22 +03:00
|
|
|
set(link_type PUBLIC)
|
2021-12-08 08:17:31 +03:00
|
|
|
if(ENABLE_SYSTEM_PROTOBUF)
|
2021-07-20 18:13:22 +03:00
|
|
|
set(link_type INTERFACE)
|
|
|
|
|
endif()
|
2021-07-21 13:56:55 +03:00
|
|
|
if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG)
|
2021-07-20 18:13:22 +03:00
|
|
|
target_compile_options(${target} ${link_type} -Wno-undef)
|
|
|
|
|
endif()
|
|
|
|
|
endforeach()
|
2021-07-16 18:55:05 +03:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# ONNX
|
|
|
|
|
#
|
|
|
|
|
|
2021-12-08 08:17:31 +03:00
|
|
|
if(ENABLE_OV_ONNX_FRONTEND)
|
2021-07-16 18:55:05 +03:00
|
|
|
add_subdirectory(onnx)
|
|
|
|
|
endif()
|
|
|
|
|
|
2021-12-02 10:41:36 +03:00
|
|
|
#
|
|
|
|
|
# nlohmann json
|
|
|
|
|
#
|
2021-12-09 15:38:44 +03:00
|
|
|
|
2022-11-23 10:07:17 +04:00
|
|
|
if(ENABLE_SAMPLES)
|
|
|
|
|
add_subdirectory(json)
|
2021-12-12 20:40:41 +03:00
|
|
|
|
2022-11-23 10:07:17 +04:00
|
|
|
# this is required only because of VPUX plugin reused this
|
|
|
|
|
openvino_developer_export_targets(COMPONENT openvino_common
|
|
|
|
|
TARGETS nlohmann_json)
|
2022-12-01 23:57:23 +04:00
|
|
|
|
|
|
|
|
# for nlohmann library version v3.0.0 and later
|
|
|
|
|
if(NOT TARGET nlohmann_json::nlohmann_json)
|
|
|
|
|
add_library(nlohmann_json::nlohmann_json INTERFACE IMPORTED GLOBAL)
|
|
|
|
|
set_target_properties(nlohmann_json::nlohmann_json PROPERTIES
|
|
|
|
|
INTERFACE_LINK_LIBRARIES nlohmann_json
|
|
|
|
|
INTERFACE_COMPILE_DEFINITIONS JSON_HEADER)
|
|
|
|
|
endif()
|
2022-11-23 10:07:17 +04:00
|
|
|
endif()
|
2021-12-02 10:41:36 +03:00
|
|
|
|
2021-06-22 17:39:39 +03:00
|
|
|
#
|
2021-06-23 09:53:18 +03:00
|
|
|
# Install
|
2021-06-22 17:39:39 +03:00
|
|
|
#
|
|
|
|
|
|
2022-10-12 12:16:13 +04:00
|
|
|
if(CPACK_GENERATOR MATCHES "^(DEB|RPM|CONDA-FORGE|BREW)$")
|
|
|
|
|
# These libraries are dependencies for openvino-samples package
|
2021-06-23 09:53:18 +03:00
|
|
|
|
2022-11-14 12:57:27 +04:00
|
|
|
if(ENABLE_SAMPLES OR ENABLE_COMPILE_TOOL OR ENABLE_TESTS)
|
|
|
|
|
if(NOT gflags_FOUND)
|
|
|
|
|
message(FATAL_ERROR "gflags must be used as a ${CPACK_GENERATOR} package. Install libgflags-dev / gflags-devel")
|
|
|
|
|
endif()
|
|
|
|
|
if(NOT zlib_FOUND)
|
|
|
|
|
message(FATAL_ERROR "zlib must be used as a ${CPACK_GENERATOR} package. Install zlib1g-dev / zlib-devel")
|
|
|
|
|
endif()
|
2022-04-05 04:47:22 +03:00
|
|
|
endif()
|
2022-12-01 23:57:23 +04:00
|
|
|
if(NOT ENABLE_SYSTEM_PUGIXML)
|
2022-11-01 18:02:07 +04:00
|
|
|
message(FATAL_ERROR "Pugixml must be used as a ${CPACK_GENERATOR} package. Install libpugixml-dev / pugixml-devel")
|
2022-09-10 02:10:24 +04:00
|
|
|
endif()
|
2022-12-02 22:10:02 +04:00
|
|
|
elseif(APPLE OR WIN32)
|
2022-04-05 04:47:22 +03:00
|
|
|
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/gflags
|
2022-07-19 10:07:26 +04:00
|
|
|
DESTINATION ${OV_CPACK_SAMPLESDIR}/cpp/thirdparty
|
2022-09-29 21:02:22 +04:00
|
|
|
COMPONENT ${OV_CPACK_COMP_CPP_SAMPLES}
|
|
|
|
|
PATTERN bazel EXCLUDE
|
|
|
|
|
PATTERN doc EXCLUDE
|
|
|
|
|
PATTERN .git EXCLUDE
|
|
|
|
|
PATTERN appveyor.yml EXCLUDE
|
|
|
|
|
PATTERN AUTHORS.txt EXCLUDE
|
|
|
|
|
PATTERN BUILD EXCLUDE
|
|
|
|
|
PATTERN ChangeLog.txt EXCLUDE
|
|
|
|
|
PATTERN .gitattributes EXCLUDE
|
|
|
|
|
PATTERN .gitignore EXCLUDE
|
|
|
|
|
PATTERN .gitmodules EXCLUDE
|
|
|
|
|
PATTERN test EXCLUDE
|
|
|
|
|
PATTERN INSTALL.md EXCLUDE
|
|
|
|
|
PATTERN README.md EXCLUDE
|
|
|
|
|
PATTERN .travis.yml EXCLUDE
|
|
|
|
|
PATTERN WORKSPACE EXCLUDE)
|
|
|
|
|
|
|
|
|
|
file(GLOB zlib_sources ${CMAKE_CURRENT_SOURCE_DIR}/zlib/zlib/*.c
|
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/zlib/zlib/*.h)
|
|
|
|
|
install(FILES ${zlib_sources}
|
|
|
|
|
DESTINATION ${OV_CPACK_SAMPLESDIR}/cpp/thirdparty/zlib/zlib
|
2022-07-27 14:04:22 +04:00
|
|
|
COMPONENT ${OV_CPACK_COMP_CPP_SAMPLES})
|
2022-09-29 21:02:22 +04:00
|
|
|
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/zlib/CMakeLists.txt
|
|
|
|
|
DESTINATION ${OV_CPACK_SAMPLESDIR}/cpp/thirdparty/zlib
|
2022-07-27 14:04:22 +04:00
|
|
|
COMPONENT ${OV_CPACK_COMP_CPP_SAMPLES})
|
2022-04-05 04:47:22 +03:00
|
|
|
|
2022-04-05 22:16:32 +03:00
|
|
|
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/json/nlohmann_json
|
2022-07-19 10:07:26 +04:00
|
|
|
DESTINATION ${OV_CPACK_SAMPLESDIR}/cpp/thirdparty
|
|
|
|
|
COMPONENT ${OV_CPACK_COMP_CPP_SAMPLES}
|
2022-09-29 21:02:22 +04:00
|
|
|
PATTERN ChangeLog.md EXCLUDE
|
|
|
|
|
PATTERN CITATION.cff EXCLUDE
|
|
|
|
|
PATTERN .clang-format EXCLUDE
|
|
|
|
|
PATTERN .clang-tidy EXCLUDE
|
2022-11-04 21:26:14 +04:00
|
|
|
PATTERN docs EXCLUDE
|
2022-09-29 21:02:22 +04:00
|
|
|
PATTERN .git EXCLUDE
|
|
|
|
|
PATTERN .github EXCLUDE
|
|
|
|
|
PATTERN .gitignore EXCLUDE
|
2022-11-04 21:26:14 +04:00
|
|
|
PATTERN .lgtm.yml EXCLUDE
|
2022-09-29 21:02:22 +04:00
|
|
|
PATTERN Makefile EXCLUDE
|
|
|
|
|
PATTERN meson.build EXCLUDE
|
|
|
|
|
PATTERN README.md EXCLUDE
|
2022-11-04 21:26:14 +04:00
|
|
|
PATTERN .reuse EXCLUDE
|
|
|
|
|
PATTERN tests EXCLUDE
|
|
|
|
|
PATTERN tools EXCLUDE
|
2022-09-29 21:02:22 +04:00
|
|
|
PATTERN wsjcpp.yml EXCLUDE)
|
2022-04-05 04:47:22 +03:00
|
|
|
endif()
|
2021-06-23 09:53:18 +03:00
|
|
|
|
|
|
|
|
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/cnpy
|
2022-07-19 10:07:26 +04:00
|
|
|
DESTINATION ${OV_CPACK_SAMPLESDIR}/cpp/thirdparty
|
2022-07-27 14:04:22 +04:00
|
|
|
COMPONENT ${OV_CPACK_COMP_CPP_SAMPLES})
|