@@ -13,55 +13,28 @@ include(cmake/features.cmake)
13
13
# resolving dependencies for the project
14
14
include (cmake/dependencies.cmake)
15
15
16
- function (ie_developer_export_targets)
17
- openvino_developer_export_targets(COMPONENT inference_engine TARGETS ${ARGN} )
18
- endfunction ()
19
-
20
- function (ie_developer_export)
21
- set (all_dev_targets gflags ie_libraries)
22
- foreach (component IN LISTS openvino_export_components)
23
- export (TARGETS ${${component} } NAMESPACE IE::
24
- APPEND FILE "${CMAKE_BINARY_DIR} /${component} _dev_targets.cmake" )
25
- list (APPEND all_dev_targets ${${component} })
26
- endforeach ()
27
-
28
- add_custom_target (ie_dev_targets ALL DEPENDS ${all_dev_targets} )
29
- endfunction ()
30
-
31
16
add_subdirectory (thirdparty)
32
-
33
17
add_subdirectory (src)
34
-
35
18
add_subdirectory (ie_bridges/c)
36
19
37
- if (ENABLE_TESTS)
38
- add_subdirectory (tests_deprecated)
39
- add_subdirectory (tests)
20
+ if (ENABLE_PYTHON)
21
+ add_subdirectory (ie_bridges/python)
40
22
endif ()
41
23
42
24
add_subdirectory (tools)
25
+ add_subdirectory (samples)
43
26
44
- function (ie_build_samples)
45
- # samples should be build with the same flags as from OpenVINO package,
46
- # so unset all flags
47
- foreach (var CMAKE_CXX_FLAGS CMAKE_C_FLAGS CMAKE_CXX_STANDARD
48
- CMAKE_EXE_LINKER_FLAGS CMAKE_POLICY_DEFAULT_CMP0063
49
- CMAKE_CXX_VISIBILITY_PRESET CMAKE_C_VISIBILITY_PRESET
50
- CMAKE_VISIBILITY_INLINES_HIDDEN CMAKE_POSITION_INDEPENDENT_CODE
51
- THREADS_PREFER_PTHREAD_FLAG X86_64 X86 ARM AARCH64 LINUX
52
- MINGW64 CMAKE_BUILD_TYPE CMAKE_MACOSX_RPATH)
53
- unset (${var} )
54
- endforeach ()
55
- include ("${IEDevScripts_DIR} /compile_flags/sanitizer.cmake" )
56
- add_subdirectory (samples)
57
- endfunction ()
27
+ if (ENABLE_TESTS)
28
+ add_subdirectory (tests_deprecated)
29
+ add_subdirectory (tests)
30
+ endif ()
58
31
59
- # gflags and format_reader targets are kept inside of samples directory and
60
- # they must be built even if samples build is disabled (required for tests and tools).
61
- ie_build_samples()
32
+ #
33
+ # Coverage
34
+ #
62
35
63
- if (ENABLE_PYTHON )
64
- add_subdirectory (ie_bridges/python )
36
+ if (ENABLE_COVERAGE )
37
+ include (cmake/coverage.cmake )
65
38
endif ()
66
39
67
40
#
@@ -70,19 +43,7 @@ endif()
70
43
71
44
# install C++ samples
72
45
73
- ie_cpack_add_component(cpp_samples DEPENDS core)
74
-
75
- install (DIRECTORY ../thirdparty/zlib
76
- DESTINATION ${IE_CPACK_IE_DIR} /samples/cpp/thirdparty
77
- COMPONENT cpp_samples
78
- USE_SOURCE_PERMISSIONS
79
- PATTERN .clang-format EXCLUDE )
80
-
81
- install (DIRECTORY ../thirdparty/cnpy
82
- DESTINATION ${IE_CPACK_IE_DIR} /samples/cpp/thirdparty
83
- COMPONENT cpp_samples
84
- USE_SOURCE_PERMISSIONS
85
- PATTERN .clang-format EXCLUDE )
46
+ ie_cpack_add_component(cpp_samples DEPENDS cpp_samples_deps core)
86
47
87
48
if (UNIX )
88
49
install (DIRECTORY samples/
@@ -142,7 +103,7 @@ endif()
142
103
# Developer package
143
104
#
144
105
145
- openvino_developer_export_targets(COMPONENT openvino_common TARGETS format_reader gflags ie_samples_utils)
106
+ openvino_developer_export_targets(COMPONENT openvino_common TARGETS format_reader ie_samples_utils)
146
107
147
108
# for Template plugin
148
109
if (NGRAPH_INTERPRETER_ENABLE)
@@ -153,36 +114,34 @@ function(ie_generate_dev_package_config)
153
114
# dummy check that OpenCV is here
154
115
find_package (OpenCV QUIET )
155
116
156
- ie_developer_export()
117
+ set (all_dev_targets gflags ie_libraries)
118
+ foreach (component IN LISTS openvino_export_components)
119
+ export (TARGETS ${${component} } NAMESPACE IE::
120
+ APPEND FILE "${CMAKE_BINARY_DIR} /${component} _dev_targets.cmake" )
121
+ list (APPEND all_dev_targets ${${component} })
122
+ endforeach ()
123
+ add_custom_target (ie_dev_targets ALL DEPENDS ${all_dev_targets} )
157
124
158
125
configure_package_config_file("${InferenceEngine_SOURCE_DIR} /cmake/templates/InferenceEngineDeveloperPackageConfig.cmake.in"
159
- "${CMAKE_BINARY_DIR} /InferenceEngineDeveloperPackageConfig.cmake"
160
- INSTALL_DESTINATION share # not used
161
- PATH_VARS "OpenVINO_MAIN_SOURCE_DIR;IE_MAIN_SOURCE_DIR;gflags_BINARY_DIR "
162
- NO_CHECK_REQUIRED_COMPONENTS_MACRO)
126
+ "${CMAKE_BINARY_DIR} /InferenceEngineDeveloperPackageConfig.cmake"
127
+ INSTALL_DESTINATION share # not used
128
+ PATH_VARS "OpenVINO_MAIN_SOURCE_DIR;IE_MAIN_SOURCE_DIR"
129
+ NO_CHECK_REQUIRED_COMPONENTS_MACRO)
163
130
164
131
configure_file ("${IE_MAIN_SOURCE_DIR} /cmake/templates/InferenceEngineConfig-version.cmake.in"
165
- "${CMAKE_BINARY_DIR} /InferenceEngineDeveloperPackageConfig-version.cmake"
166
- @ONLY)
132
+ "${CMAKE_BINARY_DIR} /InferenceEngineDeveloperPackageConfig-version.cmake"
133
+ @ONLY)
167
134
endfunction ()
168
135
169
136
ie_generate_dev_package_config()
170
137
171
- #
172
- # Coverage
173
- #
174
-
175
- if (ENABLE_COVERAGE)
176
- include (cmake/coverage.cmake)
177
- endif ()
178
-
179
138
#
180
139
# Add extra modules
181
140
#
182
141
183
142
function (register_extra_modules)
184
143
# post export
185
- ie_developer_export_targets( inference_engine)
144
+ openvino_developer_export_targets( COMPONENT inference_engine TARGETS inference_engine)
186
145
openvino_developer_export_targets(COMPONENT ngraph TARGETS ${NGRAPH_LIBRARIES} )
187
146
188
147
set (InferenceEngineDeveloperPackage_DIR "${CMAKE_CURRENT_BINARY_DIR} /build-modules" )
0 commit comments