Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
2a9a2fff
O
Opencv
项目概览
Greenplum
/
Opencv
大约 1 年 前同步成功
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Opencv
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2a9a2fff
编写于
3月 25, 2020
作者:
A
Alexander Alekhin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cmake: fix find process for InferenceEngine extra libraries
上级
a28a520c
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
46 addition
and
10 deletion
+46
-10
cmake/OpenCVDetectInferenceEngine.cmake
cmake/OpenCVDetectInferenceEngine.cmake
+46
-10
未找到文件。
cmake/OpenCVDetectInferenceEngine.cmake
浏览文件 @
2a9a2fff
...
...
@@ -24,10 +24,33 @@ endif()
# =======================
macro
(
ocv_ie_find_extra_libraries find_prefix find_suffix
)
file
(
GLOB libraries
"
${
INF_ENGINE_LIB_DIRS
}
/
${
find_prefix
}
inference_engine*
${
find_suffix
}
"
)
foreach
(
full_path IN LISTS libraries
)
get_filename_component
(
library
"
${
full_path
}
"
NAME_WE
)
string
(
REPLACE
"
${
find_prefix
}
"
""
library
"
${
library
}
"
)
if
(
library STREQUAL
"inference_engine"
OR library STREQUAL
"inference_engined"
)
# skip
else
()
add_library
(
${
library
}
UNKNOWN IMPORTED
)
set_target_properties
(
${
library
}
PROPERTIES
IMPORTED_LOCATION
"
${
full_path
}
"
)
list
(
APPEND custom_libraries
${
library
}
)
endif
()
endforeach
()
endmacro
()
function
(
add_custom_ie_build _inc _lib _lib_rel _lib_dbg _msg
)
if
(
NOT _inc OR
NOT
(
_lib OR _lib_rel OR _lib_dbg
))
return
()
endif
()
if
(
NOT _lib
)
if
(
_lib_rel
)
set
(
_lib
"
${
_lib_rel
}
"
)
else
()
set
(
_lib
"
${
_lib_dbg
}
"
)
endif
()
endif
()
add_library
(
inference_engine UNKNOWN IMPORTED
)
set_target_properties
(
inference_engine PROPERTIES
IMPORTED_LOCATION
"
${
_lib
}
"
...
...
@@ -37,24 +60,31 @@ function(add_custom_ie_build _inc _lib _lib_rel _lib_dbg _msg)
)
set
(
custom_libraries
""
)
file
(
GLOB libraries
"
${
INF_ENGINE_LIB_DIRS
}
/
${
CMAKE_SHARED_LIBRARY_PREFIX
}
inference_engine_*
${
CMAKE_SHARED_LIBRARY_SUFFIX
}
"
)
foreach
(
full_path IN LISTS libraries
)
get_filename_component
(
library
"
${
full_path
}
"
NAME_WE
)
string
(
REPLACE
"
${
CMAKE_SHARED_LIBRARY_PREFIX
}
"
""
library
"
${
library
}
"
)
add_library
(
${
library
}
UNKNOWN IMPORTED
)
set_target_properties
(
${
library
}
PROPERTIES
IMPORTED_LOCATION
"
${
full_path
}
"
)
list
(
APPEND custom_libraries
${
library
}
)
set
(
__prefixes
"
${
CMAKE_FIND_LIBRARY_PREFIXES
}
"
)
if
(
NOT __prefixes
)
set
(
__prefixes
"_empty_"
)
endif
()
foreach
(
find_prefix
${
__prefixes
}
)
if
(
find_prefix STREQUAL
"_empty_"
)
# foreach doesn't iterate over empty elements
set
(
find_prefix
""
)
endif
()
foreach
(
find_suffix
${
CMAKE_FIND_LIBRARY_SUFFIXES
}
)
ocv_ie_find_extra_libraries
(
"
${
find_prefix
}
"
"
${
find_suffix
}
"
)
endforeach
()
if
(
NOT CMAKE_FIND_LIBRARY_SUFFIXES
)
ocv_ie_find_extra_libraries
(
"
${
find_prefix
}
"
""
)
endif
()
endforeach
()
if
(
NOT INF_ENGINE_RELEASE VERSION_GREATER
"2018050000"
)
find_library
(
INF_ENGINE_OMP_LIBRARY iomp5 PATHS
"
${
INF_ENGINE_OMP_DIR
}
"
NO_DEFAULT_PATH
)
if
(
NOT INF_ENGINE_OMP_LIBRARY
)
message
(
WARNING
"OpenMP for IE have not been found. Set INF_ENGINE_OMP_DIR variable if you experience build errors."
)
else
()
set_target_properties
(
inference_engine PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES
"
${
INF_ENGINE_OMP_LIBRARY
}
"
)
endif
()
endif
()
if
(
EXISTS
"
${
INF_ENGINE_OMP_LIBRARY
}
"
)
set_target_properties
(
inference_engine PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES
"
${
INF_ENGINE_OMP_LIBRARY
}
"
)
endif
()
set
(
INF_ENGINE_VERSION
"Unknown"
CACHE STRING
""
)
set
(
INF_ENGINE_TARGET
"inference_engine;
${
custom_libraries
}
"
PARENT_SCOPE
)
message
(
STATUS
"Detected InferenceEngine:
${
_msg
}
"
)
...
...
@@ -71,6 +101,9 @@ endif()
if
(
NOT INF_ENGINE_TARGET AND INF_ENGINE_LIB_DIRS AND INF_ENGINE_INCLUDE_DIRS
)
find_path
(
ie_custom_inc
"inference_engine.hpp"
PATHS
"
${
INF_ENGINE_INCLUDE_DIRS
}
"
NO_DEFAULT_PATH
)
if
(
CMAKE_BUILD_TYPE STREQUAL
"Debug"
)
find_library
(
ie_custom_lib_dbg
"inference_engined"
PATHS
"
${
INF_ENGINE_LIB_DIRS
}
"
NO_DEFAULT_PATH
)
# Win32 and MacOSX
endif
()
find_library
(
ie_custom_lib
"inference_engine"
PATHS
"
${
INF_ENGINE_LIB_DIRS
}
"
NO_DEFAULT_PATH
)
find_library
(
ie_custom_lib_rel
"inference_engine"
PATHS
"
${
INF_ENGINE_LIB_DIRS
}
/Release"
NO_DEFAULT_PATH
)
find_library
(
ie_custom_lib_dbg
"inference_engine"
PATHS
"
${
INF_ENGINE_LIB_DIRS
}
/Debug"
NO_DEFAULT_PATH
)
...
...
@@ -89,6 +122,9 @@ if(NOT INF_ENGINE_TARGET AND _loc)
endif
()
set
(
INF_ENGINE_PLATFORM
"
${
INF_ENGINE_PLATFORM_DEFAULT
}
"
CACHE STRING
"InferenceEngine platform (library dir)"
)
find_path
(
ie_custom_env_inc
"inference_engine.hpp"
PATHS
"
${
_loc
}
/deployment_tools/inference_engine/include"
NO_DEFAULT_PATH
)
if
(
CMAKE_BUILD_TYPE STREQUAL
"Debug"
)
find_library
(
ie_custom_env_lib_dbg
"inference_engined"
PATHS
"
${
_loc
}
/deployment_tools/inference_engine/lib/
${
INF_ENGINE_PLATFORM
}
/intel64"
NO_DEFAULT_PATH
)
endif
()
find_library
(
ie_custom_env_lib
"inference_engine"
PATHS
"
${
_loc
}
/deployment_tools/inference_engine/lib/
${
INF_ENGINE_PLATFORM
}
/intel64"
NO_DEFAULT_PATH
)
find_library
(
ie_custom_env_lib_rel
"inference_engine"
PATHS
"
${
_loc
}
/deployment_tools/inference_engine/lib/intel64/Release"
NO_DEFAULT_PATH
)
find_library
(
ie_custom_env_lib_dbg
"inference_engine"
PATHS
"
${
_loc
}
/deployment_tools/inference_engine/lib/intel64/Debug"
NO_DEFAULT_PATH
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录