2021-02-03 13:13:56 +03:00
|
|
|
# Copyright (C) 2018-2021 Intel Corporation
|
2020-02-11 22:48:49 +03:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
#
|
|
|
|
|
|
2021-11-20 02:27:43 +03:00
|
|
|
if(DEFINED BUILD_SHARED_LIBS AND NOT BUILD_SHARED_LIBS)
|
|
|
|
|
# 'target_link_libraries' does not work correctly when called from
|
|
|
|
|
# different directly where 'add_library' is called: CMake generates
|
|
|
|
|
# incorrect OpenVINOConfig.cmake in this case
|
|
|
|
|
cmake_minimum_required(VERSION 3.17)
|
|
|
|
|
else()
|
|
|
|
|
cmake_minimum_required(VERSION 3.13)
|
|
|
|
|
endif()
|
2020-02-11 22:48:49 +03:00
|
|
|
|
2021-07-02 11:36:31 +03:00
|
|
|
project(OpenVINO DESCRIPTION "OpenVINO toolkit")
|
2020-02-11 22:48:49 +03:00
|
|
|
|
2021-07-02 11:36:31 +03:00
|
|
|
set(IE_MAIN_SOURCE_DIR ${OpenVINO_SOURCE_DIR}/inference-engine)
|
2020-02-11 22:48:49 +03:00
|
|
|
|
2020-12-22 18:44:59 +03:00
|
|
|
find_package(IEDevScripts REQUIRED
|
2021-07-02 11:36:31 +03:00
|
|
|
PATHS "${OpenVINO_SOURCE_DIR}/cmake/developer_package"
|
2020-12-22 18:44:59 +03:00
|
|
|
NO_CMAKE_FIND_ROOT_PATH
|
|
|
|
|
NO_DEFAULT_PATH)
|
2020-02-11 22:48:49 +03:00
|
|
|
|
2020-12-22 18:44:59 +03:00
|
|
|
include(CTest)
|
|
|
|
|
include(cmake/features.cmake)
|
2020-02-11 22:48:49 +03:00
|
|
|
|
2020-10-05 23:37:50 +03:00
|
|
|
# These options are shared with 3rdparty plugins by means of developer package
|
2020-12-22 18:44:59 +03:00
|
|
|
include(cmake/dependencies.cmake)
|
2020-02-11 22:48:49 +03:00
|
|
|
|
2021-06-24 13:14:04 +03:00
|
|
|
if(ENABLE_COVERAGE)
|
|
|
|
|
include(cmake/coverage.cmake)
|
|
|
|
|
endif()
|
|
|
|
|
|
2020-02-11 22:48:49 +03:00
|
|
|
# resolving dependencies for the project
|
|
|
|
|
message (STATUS "PROJECT ............................... " ${PROJECT_NAME})
|
2021-11-28 21:36:24 +03:00
|
|
|
message (STATUS "CMAKE_VERSION ......................... " ${CMAKE_VERSION})
|
2020-02-11 22:48:49 +03:00
|
|
|
message (STATUS "CMAKE_BINARY_DIR ...................... " ${CMAKE_BINARY_DIR})
|
2021-09-02 10:03:04 +03:00
|
|
|
message (STATUS "OpenVINO_SOURCE_DIR ................... " ${OpenVINO_SOURCE_DIR})
|
2020-02-11 22:48:49 +03:00
|
|
|
message (STATUS "CMAKE_GENERATOR ....................... " ${CMAKE_GENERATOR})
|
|
|
|
|
message (STATUS "CMAKE_C_COMPILER_ID ................... " ${CMAKE_C_COMPILER_ID})
|
2021-11-27 14:58:24 +03:00
|
|
|
message (STATUS "CMAKE_CXX_COMPILER_ID ................. " ${CMAKE_CXX_COMPILER_ID})
|
2020-02-11 22:48:49 +03:00
|
|
|
message (STATUS "CMAKE_BUILD_TYPE ...................... " ${CMAKE_BUILD_TYPE})
|
2021-11-24 15:04:38 +03:00
|
|
|
message (STATUS "CMAKE_TOOLCHAIN_FILE .................. " ${CMAKE_TOOLCHAIN_FILE})
|
2020-02-11 22:48:49 +03:00
|
|
|
|
|
|
|
|
# remove file with exported developer targets to force its regeneration
|
2021-09-13 07:12:07 +03:00
|
|
|
file(REMOVE "${CMAKE_BINARY_DIR}/ngraph/ngraphTargets.cmake")
|
2021-05-07 11:57:51 +03:00
|
|
|
file(REMOVE "${CMAKE_BINARY_DIR}/InferenceEngineTargets.cmake")
|
2021-09-10 15:31:27 +03:00
|
|
|
file(REMOVE "${CMAKE_BINARY_DIR}/OpenVINOTargets.cmake")
|
2020-12-22 18:44:59 +03:00
|
|
|
foreach(component IN LISTS openvino_export_components)
|
|
|
|
|
file(REMOVE "${CMAKE_BINARY_DIR}/${component}_dev_targets.cmake")
|
|
|
|
|
unset(${component} CACHE)
|
|
|
|
|
endforeach()
|
2021-12-09 15:38:44 +03:00
|
|
|
unset(openvino_export_components CACHE)
|
2020-02-11 22:48:49 +03:00
|
|
|
|
2020-10-05 23:37:50 +03:00
|
|
|
#
|
|
|
|
|
# Build
|
|
|
|
|
#
|
|
|
|
|
|
2020-08-17 19:43:11 +03:00
|
|
|
function(openvino_developer_export_targets)
|
2020-12-22 18:44:59 +03:00
|
|
|
cmake_parse_arguments(EXPORT "" "COMPONENT" "TARGETS" ${ARGN})
|
|
|
|
|
|
|
|
|
|
if(EXPORT_UNPARSED_ARGUMENTS)
|
|
|
|
|
message(FATAL_ERROR "openvino_developer_export_targets has unparsed arguments: ${EXPORT_UNPARSED_ARGUMENTS}")
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
set(${EXPORT_COMPONENT} "${${EXPORT_COMPONENT}};${EXPORT_TARGETS}")
|
2020-08-17 19:43:11 +03:00
|
|
|
|
|
|
|
|
# to allow exporting of aliased targets with the original names
|
2020-12-22 18:44:59 +03:00
|
|
|
foreach(target_name IN LISTS ${EXPORT_COMPONENT})
|
2020-08-17 19:43:11 +03:00
|
|
|
if(TARGET "${target_name}")
|
|
|
|
|
get_target_property(original_name ${target_name} ALIASED_TARGET)
|
|
|
|
|
if(TARGET "${original_name}")
|
|
|
|
|
message(STATUS "The name ${target_name} is an ALIAS for ${original_name}. "
|
|
|
|
|
"It will be exported to the InferenceEngineDeveloperPackage with the original name.")
|
2020-12-22 18:44:59 +03:00
|
|
|
list(REMOVE_ITEM ${EXPORT_COMPONENT} ${target_name})
|
|
|
|
|
list(APPEND ${EXPORT_COMPONENT} ${original_name})
|
2020-08-17 19:43:11 +03:00
|
|
|
endif()
|
|
|
|
|
endif()
|
|
|
|
|
endforeach()
|
|
|
|
|
|
2020-12-22 18:44:59 +03:00
|
|
|
list(REMOVE_DUPLICATES ${EXPORT_COMPONENT})
|
|
|
|
|
set(${EXPORT_COMPONENT} "${${EXPORT_COMPONENT}}" CACHE INTERNAL
|
|
|
|
|
"A list of OpenVINO ${EXPORT_COMPONENT} exported targets" FORCE)
|
|
|
|
|
|
|
|
|
|
list(APPEND openvino_export_components ${EXPORT_COMPONENT})
|
|
|
|
|
list(REMOVE_DUPLICATES openvino_export_components)
|
|
|
|
|
set(openvino_export_components "${openvino_export_components}" CACHE INTERNAL
|
|
|
|
|
"A list of OpenVINO exported components" FORCE)
|
2020-08-17 19:43:11 +03:00
|
|
|
endfunction()
|
|
|
|
|
|
2021-07-31 17:21:35 +03:00
|
|
|
# add target with processed tests model zoo
|
|
|
|
|
include(cmake/test_model_zoo.cmake)
|
|
|
|
|
|
2021-02-03 13:13:56 +03:00
|
|
|
add_subdirectory(thirdparty)
|
2021-11-27 18:53:12 +03:00
|
|
|
add_subdirectory(inference-engine/thirdparty)
|
|
|
|
|
add_subdirectory(inference-engine/src)
|
2021-11-27 11:28:25 +03:00
|
|
|
add_subdirectory(src)
|
2021-11-18 10:08:20 +03:00
|
|
|
add_subdirectory(samples)
|
2021-11-27 18:53:12 +03:00
|
|
|
add_subdirectory(inference-engine)
|
2021-06-30 18:15:41 +03:00
|
|
|
include(cmake/extra_modules.cmake)
|
2020-05-22 22:34:00 +03:00
|
|
|
add_subdirectory(docs)
|
2021-04-26 18:06:39 +03:00
|
|
|
add_subdirectory(tools)
|
2021-06-30 18:15:41 +03:00
|
|
|
add_subdirectory(scripts)
|
2021-12-01 11:42:52 +03:00
|
|
|
add_subdirectory(licensing)
|
2020-05-22 22:34:00 +03:00
|
|
|
|
2020-10-05 23:37:50 +03:00
|
|
|
#
|
2021-06-30 18:15:41 +03:00
|
|
|
# CPack
|
2020-10-05 23:37:50 +03:00
|
|
|
#
|
2020-04-28 22:20:54 +03:00
|
|
|
|
2020-02-11 22:48:49 +03:00
|
|
|
ie_cpack(${IE_CPACK_COMPONENTS_ALL})
|