@@ -23,80 +23,6 @@ endif()
23
23
24
24
# ======================
25
25
26
- macro (ocv_ie_find_extra_libraries find_prefix find_suffix)
27
- file (GLOB libraries "${INF_ENGINE_LIB_DIRS} /${find_prefix} inference_engine*${find_suffix} " )
28
- foreach (full_path IN LISTS libraries)
29
- get_filename_component (library "${full_path} " NAME_WE )
30
- string (REPLACE "${find_prefix} " "" library "${library} " )
31
- if (library STREQUAL "inference_engine" OR library STREQUAL "inference_engined" )
32
- # skip
33
- else ()
34
- add_library (${library} UNKNOWN IMPORTED )
35
- set_target_properties (${library} PROPERTIES
36
- IMPORTED_LOCATION "${full_path} " )
37
- list (APPEND custom_libraries ${library} )
38
- endif ()
39
- endforeach ()
40
- endmacro ()
41
-
42
- function (add_custom_ie_build _inc _lib _lib_rel _lib_dbg _msg)
43
- if (NOT _inc OR NOT (_lib OR _lib_rel OR _lib_dbg))
44
- return ()
45
- endif ()
46
- if (NOT _lib)
47
- if (_lib_rel)
48
- set (_lib "${_lib_rel} " )
49
- else ()
50
- set (_lib "${_lib_dbg} " )
51
- endif ()
52
- endif ()
53
- add_library (inference_engine UNKNOWN IMPORTED )
54
- set_target_properties (inference_engine PROPERTIES
55
- IMPORTED_LOCATION "${_lib} "
56
- IMPORTED_IMPLIB_RELEASE "${_lib_rel} "
57
- IMPORTED_IMPLIB_DEBUG "${_lib_dbg} "
58
- INTERFACE_INCLUDE_DIRECTORIES "${_inc} "
59
- )
60
-
61
- set (custom_libraries "" )
62
- set (__prefixes "${CMAKE_FIND_LIBRARY_PREFIXES} " )
63
- if (NOT __prefixes)
64
- set (__prefixes "_empty_" )
65
- endif ()
66
- foreach (find_prefix ${__prefixes} )
67
- if (find_prefix STREQUAL "_empty_" ) # foreach doesn't iterate over empty elements
68
- set (find_prefix "" )
69
- endif ()
70
- if (NOT DEFINED INFERENCE_ENGINE_FIND_LIBRARY_SUFFIXES) # allow custom override
71
- set (INFERENCE_ENGINE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} )
72
- if (APPLE )
73
- ocv_list_filterout(INFERENCE_ENGINE_FIND_LIBRARY_SUFFIXES "^.so$" ) # skip plugins (can't be linked)
74
- endif ()
75
- endif ()
76
- foreach (find_suffix ${INFERENCE_ENGINE_FIND_LIBRARY_SUFFIXES} )
77
- ocv_ie_find_extra_libraries("${find_prefix} " "${find_suffix} " )
78
- endforeach ()
79
- if (NOT CMAKE_FIND_LIBRARY_SUFFIXES )
80
- ocv_ie_find_extra_libraries("${find_prefix} " "" )
81
- endif ()
82
- endforeach ()
83
-
84
- if (NOT INF_ENGINE_RELEASE VERSION_GREATER "2018050000" )
85
- find_library (INF_ENGINE_OMP_LIBRARY iomp5 PATHS "${INF_ENGINE_OMP_DIR} " NO_DEFAULT_PATH)
86
- if (NOT INF_ENGINE_OMP_LIBRARY)
87
- message (WARNING "OpenMP for IE have not been found. Set INF_ENGINE_OMP_DIR variable if you experience build errors." )
88
- endif ()
89
- endif ()
90
- if (EXISTS "${INF_ENGINE_OMP_LIBRARY} " )
91
- set_target_properties (inference_engine PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES "${INF_ENGINE_OMP_LIBRARY} " )
92
- endif ()
93
- set (INF_ENGINE_VERSION "Unknown" CACHE STRING "" )
94
- set (INF_ENGINE_TARGET "inference_engine;${custom_libraries} " PARENT_SCOPE)
95
- message (STATUS "Detected InferenceEngine: ${_msg} " )
96
- endfunction ()
97
-
98
- # ======================
99
-
100
26
find_package (InferenceEngine QUIET )
101
27
if (InferenceEngine_FOUND)
102
28
set (INF_ENGINE_TARGET ${InferenceEngine_LIBRARIES} )
@@ -118,38 +44,6 @@ elseif(DEFINED INF_ENGINE_RELEASE)
118
44
endif ()
119
45
set (INF_ENGINE_RELEASE "${INF_ENGINE_RELEASE_INIT} " CACHE STRING "Force IE version, should be in form YYYYAABBCC (e.g. 2020.1.0.2 -> 2020010002)" )
120
46
121
- if (NOT INF_ENGINE_TARGET AND INF_ENGINE_LIB_DIRS AND INF_ENGINE_INCLUDE_DIRS)
122
- find_path (ie_custom_inc "inference_engine.hpp" PATHS "${INF_ENGINE_INCLUDE_DIRS} " NO_DEFAULT_PATH)
123
- if (CMAKE_BUILD_TYPE STREQUAL "Debug" )
124
- find_library (ie_custom_lib_dbg "inference_engined" PATHS "${INF_ENGINE_LIB_DIRS} " NO_DEFAULT_PATH) # Win32 and MacOSX
125
- endif ()
126
- find_library (ie_custom_lib "inference_engine" PATHS "${INF_ENGINE_LIB_DIRS} " NO_DEFAULT_PATH)
127
- find_library (ie_custom_lib_rel "inference_engine" PATHS "${INF_ENGINE_LIB_DIRS} /Release" NO_DEFAULT_PATH)
128
- find_library (ie_custom_lib_dbg "inference_engine" PATHS "${INF_ENGINE_LIB_DIRS} /Debug" NO_DEFAULT_PATH)
129
- add_custom_ie_build("${ie_custom_inc} " "${ie_custom_lib} " "${ie_custom_lib_rel} " "${ie_custom_lib_dbg} " "INF_ENGINE_{INCLUDE,LIB}_DIRS" )
130
- endif ()
131
-
132
- set (_loc "$ENV{INTEL_OPENVINO_DIR} " )
133
- if (NOT _loc AND DEFINED ENV{INTEL_CVSDK_DIR})
134
- set (_loc "$ENV{INTEL_CVSDK_DIR} " ) # OpenVINO 2018.x
135
- endif ()
136
- if (NOT INF_ENGINE_TARGET AND _loc)
137
- if (NOT INF_ENGINE_RELEASE VERSION_GREATER "2018050000" )
138
- set (INF_ENGINE_PLATFORM_DEFAULT "ubuntu_16.04" )
139
- else ()
140
- set (INF_ENGINE_PLATFORM_DEFAULT "" )
141
- endif ()
142
- set (INF_ENGINE_PLATFORM "${INF_ENGINE_PLATFORM_DEFAULT} " CACHE STRING "InferenceEngine platform (library dir)" )
143
- find_path (ie_custom_env_inc "inference_engine.hpp" PATHS "${_loc} /deployment_tools/inference_engine/include" NO_DEFAULT_PATH)
144
- if (CMAKE_BUILD_TYPE STREQUAL "Debug" )
145
- find_library (ie_custom_env_lib_dbg "inference_engined" PATHS "${_loc} /deployment_tools/inference_engine/lib/${INF_ENGINE_PLATFORM} /intel64" NO_DEFAULT_PATH)
146
- endif ()
147
- find_library (ie_custom_env_lib "inference_engine" PATHS "${_loc} /deployment_tools/inference_engine/lib/${INF_ENGINE_PLATFORM} /intel64" NO_DEFAULT_PATH)
148
- find_library (ie_custom_env_lib_rel "inference_engine" PATHS "${_loc} /deployment_tools/inference_engine/lib/intel64/Release" NO_DEFAULT_PATH)
149
- find_library (ie_custom_env_lib_dbg "inference_engine" PATHS "${_loc} /deployment_tools/inference_engine/lib/intel64/Debug" NO_DEFAULT_PATH)
150
- add_custom_ie_build("${ie_custom_env_inc} " "${ie_custom_env_lib} " "${ie_custom_env_lib_rel} " "${ie_custom_env_lib_dbg} " "OpenVINO (${_loc} )" )
151
- endif ()
152
-
153
47
set (tgts)
154
48
set (defs)
155
49
0 commit comments