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