When included in a project using find_package, it goes and looks for
headers and cmake module at an incorrect path.

Make sure that we are able to locate the headers and cmake module file.

Signed-off-by: Anuj Mittal <[email protected]>
---
 ...gineConfig.cmake-set-the-right-paths.patch | 50 +++++++++++++++++++
 .../openvino-inference-engine_2021.3.bb       |  1 +
 2 files changed, 51 insertions(+)
 create mode 100644 
dynamic-layers/openembedded-layer/recipes-support/opencv/files/0001-InferenceEngineConfig.cmake-set-the-right-paths.patch

diff --git 
a/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0001-InferenceEngineConfig.cmake-set-the-right-paths.patch
 
b/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0001-InferenceEngineConfig.cmake-set-the-right-paths.patch
new file mode 100644
index 00000000..31a7f7ff
--- /dev/null
+++ 
b/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0001-InferenceEngineConfig.cmake-set-the-right-paths.patch
@@ -0,0 +1,50 @@
+From 13a9e6fbe3e62720d088e750de73483f2b74a855 Mon Sep 17 00:00:00 2001
+From: Anuj Mittal <[email protected]>
+Date: Wed, 14 Jul 2021 00:55:31 +0800
+Subject: [PATCH] InferenceEngineConfig.cmake: set the right paths
+
+Make sure that the projects using cmake to locate the libraries
+are able to do so.
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Anuj Mittal <[email protected]>
+---
+ .../cmake/templates/InferenceEngineConfig.cmake.in        | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/inference-engine/cmake/templates/InferenceEngineConfig.cmake.in 
b/inference-engine/cmake/templates/InferenceEngineConfig.cmake.in
+index 5ede817bbf..83d258834b 100644
+--- a/inference-engine/cmake/templates/InferenceEngineConfig.cmake.in
++++ b/inference-engine/cmake/templates/InferenceEngineConfig.cmake.in
+@@ -74,7 +74,7 @@ else()
+         ext_message(FATAL_ERROR "inference_engine root directory is not 
found")
+     endif()
+ 
+-    find_path(IE_INCLUDE_DIR inference_engine.hpp "${IE_ROOT_DIR}/include" 
NO_DEFAULT_PATH)
++    find_path(IE_INCLUDE_DIR inference_engine.hpp "${IE_ROOT_DIR}/include")
+ 
+     set(IE_LIB_DIR "${IE_ROOT_DIR}/lib/${_ARCH}")
+     set(IE_LIB_REL_DIR "${IE_LIB_DIR}/Release")
+@@ -89,8 +89,8 @@ else()
+         find_library(IE_RELEASE_LIBRARY 
inference_engine@IE_RELEASE_POSTFIX_MAC@ "${IE_LIB_DIR}" NO_DEFAULT_PATH)
+         find_library(IE_C_API_RELEASE_LIBRARY 
inference_engine_c_api@IE_RELEASE_POSTFIX_MAC@ "${IE_LIB_DIR}" NO_DEFAULT_PATH)
+     else()
+-        find_library(IE_RELEASE_LIBRARY 
inference_engine@IE_RELEASE_POSTFIX_LIN@ "${IE_LIB_DIR}" NO_DEFAULT_PATH)
+-        find_library(IE_C_API_RELEASE_LIBRARY 
inference_engine_c_api@IE_RELEASE_POSTFIX_LIN@ "${IE_LIB_DIR}" NO_DEFAULT_PATH)
++        find_library(IE_RELEASE_LIBRARY 
inference_engine@IE_RELEASE_POSTFIX_LIN@ "${IE_LIB_DIR}")
++        find_library(IE_C_API_RELEASE_LIBRARY 
inference_engine_c_api@IE_RELEASE_POSTFIX_LIN@ "${IE_LIB_DIR}")
+     endif()
+ 
+     find_package_handle_standard_args(  InferenceEngine
+@@ -163,6 +163,6 @@ else()
+                                       IE::inference_engine_c_api)
+ 
+         set(IE_EXTERNAL_DIR "${IE_ROOT_DIR}/external")
+-        include("${IE_ROOT_DIR}/share/ie_parallel.cmake")
++        
include("$ENV{PKG_CONFIG_SYSROOT_DIR}@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/cmake/InferenceEngine/ie_parallel.cmake")
+     endif()
+ endif()
+-- 
+2.32.0
+
diff --git 
a/dynamic-layers/openembedded-layer/recipes-support/opencv/openvino-inference-engine_2021.3.bb
 
b/dynamic-layers/openembedded-layer/recipes-support/opencv/openvino-inference-engine_2021.3.bb
index 2d8c7b59..19da3e1b 100644
--- 
a/dynamic-layers/openembedded-layer/recipes-support/opencv/openvino-inference-engine_2021.3.bb
+++ 
b/dynamic-layers/openembedded-layer/recipes-support/opencv/openvino-inference-engine_2021.3.bb
@@ -14,6 +14,7 @@ SRC_URI = 
"git://github.com/openvinotoolkit/openvino.git;protocol=git;branch=rel
            file://0003-inference-engine-installation-fixes.patch \
            file://0001-dont-install-licenses-and-version-file.patch \
            file://0001-plugin_api-fix-build-with-gcc-11.patch \
+           file://0001-InferenceEngineConfig.cmake-set-the-right-paths.patch \
            "
 
 SRCREV = "c5f7ad383e654dfb4a5ac0805323cf8d43426b3f"
-- 
2.31.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#7161): 
https://lists.yoctoproject.org/g/meta-intel/message/7161
Mute This Topic: https://lists.yoctoproject.org/mt/84336159/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-intel/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to