2018-02-06 16:57:35 +08:00
|
|
|
# The script detects Intel(R) Inference Engine installation
|
|
|
|
#
|
|
|
|
# Parameters:
|
|
|
|
# INTEL_CVSDK_DIR - Path to Inference Engine root folder
|
|
|
|
# IE_PLUGINS_PATH - Path to folder with Inference Engine plugins
|
|
|
|
#
|
|
|
|
# On return this will define:
|
|
|
|
#
|
|
|
|
# HAVE_INF_ENGINE - True if Intel Inference Engine was found
|
|
|
|
# INF_ENGINE_INCLUDE_DIRS - Inference Engine include folder
|
|
|
|
# INF_ENGINE_LIBRARIES - Inference Engine libraries and it's dependencies
|
|
|
|
#
|
|
|
|
macro(ie_fail)
|
|
|
|
set(HAVE_INF_ENGINE FALSE)
|
|
|
|
return()
|
|
|
|
endmacro()
|
|
|
|
|
2018-04-19 20:04:57 +08:00
|
|
|
if(NOT HAVE_CXX11)
|
|
|
|
ie_fail()
|
|
|
|
endif()
|
|
|
|
|
2018-02-07 16:28:45 +08:00
|
|
|
if(NOT INF_ENGINE_ROOT_DIR OR NOT EXISTS "${INF_ENGINE_ROOT_DIR}/include/inference_engine.hpp")
|
2018-02-06 16:57:35 +08:00
|
|
|
set(ie_root_paths "${INF_ENGINE_ROOT_DIR}")
|
|
|
|
if(DEFINED ENV{INTEL_CVSDK_DIR})
|
|
|
|
list(APPEND ie_root_paths "$ENV{INTEL_CVSDK_DIR}")
|
2018-02-07 16:28:45 +08:00
|
|
|
list(APPEND ie_root_paths "$ENV{INTEL_CVSDK_DIR}/inference_engine")
|
2018-02-06 16:57:35 +08:00
|
|
|
endif()
|
2018-02-06 21:23:18 +08:00
|
|
|
if(DEFINED INTEL_CVSDK_DIR)
|
|
|
|
list(APPEND ie_root_paths "${INTEL_CVSDK_DIR}")
|
2018-02-07 16:28:45 +08:00
|
|
|
list(APPEND ie_root_paths "${INTEL_CVSDK_DIR}/inference_engine")
|
2018-02-06 21:23:18 +08:00
|
|
|
endif()
|
2018-02-06 16:57:35 +08:00
|
|
|
|
|
|
|
if(WITH_INF_ENGINE AND NOT ie_root_paths)
|
2018-02-07 16:28:45 +08:00
|
|
|
list(APPEND ie_root_paths "/opt/intel/deeplearning_deploymenttoolkit/deployment_tools/inference_engine")
|
2018-02-06 16:57:35 +08:00
|
|
|
endif()
|
|
|
|
|
2018-02-07 16:28:45 +08:00
|
|
|
find_path(INF_ENGINE_ROOT_DIR include/inference_engine.hpp PATHS ${ie_root_paths})
|
2018-02-06 16:57:35 +08:00
|
|
|
endif()
|
|
|
|
|
2018-02-07 16:28:45 +08:00
|
|
|
set(INF_ENGINE_INCLUDE_DIRS "${INF_ENGINE_ROOT_DIR}/include" CACHE PATH "Path to Inference Engine include directory")
|
2018-02-06 16:57:35 +08:00
|
|
|
|
|
|
|
if(NOT INF_ENGINE_ROOT_DIR
|
|
|
|
OR NOT EXISTS "${INF_ENGINE_ROOT_DIR}"
|
|
|
|
OR NOT EXISTS "${INF_ENGINE_INCLUDE_DIRS}"
|
|
|
|
OR NOT EXISTS "${INF_ENGINE_INCLUDE_DIRS}/inference_engine.hpp"
|
|
|
|
)
|
|
|
|
ie_fail()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(INF_ENGINE_LIBRARIES "")
|
2018-02-07 16:28:45 +08:00
|
|
|
|
|
|
|
set(ie_lib_list inference_engine)
|
2018-03-28 21:34:37 +08:00
|
|
|
|
|
|
|
link_directories(
|
|
|
|
${INTEL_CVSDK_DIR}/external/mklml_lnx/lib
|
|
|
|
${INTEL_CVSDK_DIR}/inference_engine/external/mklml_lnx/lib
|
2018-04-09 21:22:19 +08:00
|
|
|
${INTEL_CVSDK_DIR}/inference_engine/external/mkltiny_lnx/lib
|
2018-03-28 21:34:37 +08:00
|
|
|
${INTEL_CVSDK_DIR}/external/cldnn/lib
|
|
|
|
${INTEL_CVSDK_DIR}/inference_engine/external/cldnn/lib
|
|
|
|
)
|
2018-02-07 16:28:45 +08:00
|
|
|
|
|
|
|
foreach(lib ${ie_lib_list})
|
2018-02-06 16:57:35 +08:00
|
|
|
find_library(${lib}
|
|
|
|
NAMES ${lib}
|
2018-02-07 16:28:45 +08:00
|
|
|
# For inference_engine
|
2018-02-06 16:57:35 +08:00
|
|
|
HINTS ${IE_PLUGINS_PATH}
|
|
|
|
HINTS "$ENV{IE_PLUGINS_PATH}"
|
|
|
|
)
|
|
|
|
if(NOT ${lib})
|
|
|
|
ie_fail()
|
|
|
|
endif()
|
|
|
|
list(APPEND INF_ENGINE_LIBRARIES ${${lib}})
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
set(HAVE_INF_ENGINE TRUE)
|