forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
105 lines (82 loc) · 3.65 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
cmake_minimum_required(VERSION 3.13)
project(OpenVINO DESCRIPTION "OpenVINO toolkit")
set(IE_MAIN_SOURCE_DIR ${OpenVINO_SOURCE_DIR}/inference-engine)
find_package(IEDevScripts REQUIRED
PATHS "${OpenVINO_SOURCE_DIR}/cmake/developer_package"
NO_CMAKE_FIND_ROOT_PATH
NO_DEFAULT_PATH)
include(CTest)
include(cmake/features.cmake)
# These options are shared with 3rdparty plugins by means of developer package
include(cmake/dependencies.cmake)
if(ENABLE_COVERAGE)
include(cmake/coverage.cmake)
endif()
# resolving dependencies for the project
message (STATUS "PROJECT ............................... " ${PROJECT_NAME})
message (STATUS "CMAKE_BINARY_DIR ...................... " ${CMAKE_BINARY_DIR})
message (STATUS "OpenVINO_SOURCE_DIR ................... " ${OpenVINO_SOURCE_DIR})
message (STATUS "CMAKE_GENERATOR ....................... " ${CMAKE_GENERATOR})
message (STATUS "CMAKE_C_COMPILER_ID ................... " ${CMAKE_C_COMPILER_ID})
message (STATUS "CMAKE_BUILD_TYPE ...................... " ${CMAKE_BUILD_TYPE})
# remove file with exported developer targets to force its regeneration
file(REMOVE "${CMAKE_BINARY_DIR}/ngraph/ngraphTargets.cmake")
file(REMOVE "${CMAKE_BINARY_DIR}/InferenceEngineTargets.cmake")
file(REMOVE "${CMAKE_BINARY_DIR}/OpenVINOTargets.cmake")
foreach(component IN LISTS openvino_export_components)
file(REMOVE "${CMAKE_BINARY_DIR}/${component}_dev_targets.cmake")
unset(${component} CACHE)
endforeach()
#
# Build
#
function(openvino_developer_export_targets)
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}")
# to allow exporting of aliased targets with the original names
foreach(target_name IN LISTS ${EXPORT_COMPONENT})
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.")
list(REMOVE_ITEM ${EXPORT_COMPONENT} ${target_name})
list(APPEND ${EXPORT_COMPONENT} ${original_name})
endif()
endif()
endforeach()
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)
endfunction()
ie_cpack_add_component(ngraph REQUIRED)
ie_cpack_add_component(ngraph_dev REQUIRED DEPENDS ngraph)
# add target with processed tests model zoo
include(cmake/test_model_zoo.cmake)
add_subdirectory(thirdparty)
add_subdirectory(openvino)
add_subdirectory(ngraph)
add_subdirectory(runtime)
add_subdirectory(inference-engine)
# for Template plugin
openvino_developer_export_targets(COMPONENT ngraph TARGETS ngraph_backend interpreter_backend)
include(cmake/extra_modules.cmake)
add_subdirectory(samples)
add_subdirectory(model-optimizer)
add_subdirectory(docs)
add_subdirectory(tools)
add_subdirectory(scripts)
#
# CPack
#
ie_cpack(${IE_CPACK_COMPONENTS_ALL})