opencv-4.8.1-use-system-flatbuffers.patch 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. From: Paul Zander <negril.nx+gentoo@gmail.com>
  2. Find the system flatbuffers and allow for newer revisions.
  3. diff --git a/cmake/OpenCVDetectFlatbuffers.cmake b/cmake/OpenCVDetectFlatbuffers.cmake
  4. index 537b738..dbfa532 100644
  5. --- a/cmake/OpenCVDetectFlatbuffers.cmake
  6. +++ b/cmake/OpenCVDetectFlatbuffers.cmake
  7. @@ -1,12 +1,6 @@
  8. if(WITH_FLATBUFFERS)
  9. - set(HAVE_FLATBUFFERS 1)
  10. - set(flatbuffers_VERSION "23.5.9")
  11. - ocv_install_3rdparty_licenses(flatbuffers "${OpenCV_SOURCE_DIR}/3rdparty/flatbuffers/LICENSE.txt")
  12. - ocv_add_external_target(flatbuffers "${OpenCV_SOURCE_DIR}/3rdparty/flatbuffers/include" "" "HAVE_FLATBUFFERS=1")
  13. - set(CUSTOM_STATUS_flatbuffers " Flatbuffers:" "builtin/3rdparty (${flatbuffers_VERSION})")
  14. -endif()
  15. -
  16. -if(WITH_FLATBUFFERS OR HAVE_FLATBUFFERS)
  17. + find_package(flatbuffers REQUIRED)
  18. + set(HAVE_FLATBUFFERS "${flatbuffers_FOUND}")
  19. list(APPEND CUSTOM_STATUS flatbuffers)
  20. if(HAVE_FLATBUFFERS)
  21. diff --git a/modules/dnn/misc/tflite/schema_generated.h b/modules/dnn/misc/tflite/schema_generated.h
  22. index 44162ee..1c3c35a 100644
  23. --- a/modules/dnn/misc/tflite/schema_generated.h
  24. +++ b/modules/dnn/misc/tflite/schema_generated.h
  25. @@ -10,7 +10,7 @@
  26. // generated, otherwise it may not be compatible.
  27. static_assert(FLATBUFFERS_VERSION_MAJOR == 23 &&
  28. FLATBUFFERS_VERSION_MINOR == 5 &&
  29. - FLATBUFFERS_VERSION_REVISION == 9,
  30. + FLATBUFFERS_VERSION_REVISION >= 9,
  31. "Non-compatible flatbuffers version included");
  32. namespace opencv_tflite {