File tensorflow-lite-cmake-find-python.patch of Package tensorflow-lite

diff -ur tensorflow-2.9.1.o/tensorflow/lite/CMakeLists.txt tensorflow-2.9.1/tensorflow/lite/CMakeLists.txt
--- tensorflow-2.9.1.o/tensorflow/lite/CMakeLists.txt	2022-05-23 00:28:22.000000000 +0200
+++ tensorflow-2.9.1/tensorflow/lite/CMakeLists.txt	2022-05-28 00:24:30.302080481 +0200
@@ -538,6 +538,9 @@
 add_subdirectory(${TFLITE_SOURCE_DIR}/examples/label_image)
 
 # Python interpreter wrapper.
+find_package(Python3 COMPONENTS Interpreter Development NumPy REQUIRED)
+find_package(pybind11 REQUIRED)
+
 add_library(_pywrap_tensorflow_interpreter_wrapper SHARED EXCLUDE_FROM_ALL
   ${TFLITE_SOURCE_DIR}/python/interpreter_wrapper/interpreter_wrapper.cc
   ${TFLITE_SOURCE_DIR}/python/interpreter_wrapper/interpreter_wrapper_pybind11.cc
@@ -552,11 +555,14 @@
 target_include_directories(_pywrap_tensorflow_interpreter_wrapper
   PUBLIC
     ${TFLITE_INCLUDE_DIRS}
+    ${Python3_INCLUDE_DIRS}
+    ${Python3_NumPy_INCLUDE_DIRS}
 )
 
 target_link_libraries(_pywrap_tensorflow_interpreter_wrapper
   tensorflow-lite
   ${CMAKE_DL_LIBS}
+  ${Python3_LIBRARIES}
 )
 target_compile_options(_pywrap_tensorflow_interpreter_wrapper
   PUBLIC ${TFLITE_TARGET_PUBLIC_OPTIONS}
openSUSE Build Service is sponsored by