[opencv4] gen flatbuffers headers (#33191)

* [opencv4] gen flatbuffers headers

* bump ver

* v db
This commit is contained in:
Alexander Neumann 2023-08-16 23:54:28 +02:00 committed by GitHub
parent 97d07b26ae
commit 57fee154cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 41 additions and 1 deletions

View File

@ -0,0 +1,20 @@
diff --git a/cmake/OpenCVDetectFlatbuffers.cmake b/cmake/OpenCVDetectFlatbuffers.cmake
index 537b738..6dba0fb 100644
--- a/cmake/OpenCVDetectFlatbuffers.cmake
+++ b/cmake/OpenCVDetectFlatbuffers.cmake
@@ -1,9 +1,11 @@
if(WITH_FLATBUFFERS)
set(HAVE_FLATBUFFERS 1)
- set(flatbuffers_VERSION "23.5.9")
- ocv_install_3rdparty_licenses(flatbuffers "${OpenCV_SOURCE_DIR}/3rdparty/flatbuffers/LICENSE.txt")
- ocv_add_external_target(flatbuffers "${OpenCV_SOURCE_DIR}/3rdparty/flatbuffers/include" "" "HAVE_FLATBUFFERS=1")
- set(CUSTOM_STATUS_flatbuffers " Flatbuffers:" "builtin/3rdparty (${flatbuffers_VERSION})")
+ set(flatbuffers_VERSION "23.5.26")
+ #ocv_install_3rdparty_licenses(flatbuffers "${OpenCV_SOURCE_DIR}/3rdparty/flatbuffers/LICENSE.txt")
+ find_path(FLATBUFFERS_INCLUDE_DIR flatbuffers.h PATH_SUFFIXES flatbuffers)
+ get_filename_component(FLATBUFFERS_INCLUDE_DIR "${FLATBUFFERS_INCLUDE_DIR}" PATH)
+ ocv_add_external_target(flatbuffers "${FLATBUFFERS_INCLUDE_DIR}" "" "HAVE_FLATBUFFERS=1")
+ #set(CUSTOM_STATUS_flatbuffers " Flatbuffers:" "builtin/3rdparty (${flatbuffers_VERSION})")
endif()
if(WITH_FLATBUFFERS OR HAVE_FLATBUFFERS)

View File

@ -26,10 +26,12 @@ vcpkg_from_github(
0011-remove-python2.patch
0012-fix-zlib.patch
0015-fix-freetype.patch
0017-fix-flatbuffers.patch
"${ARM64_WINDOWS_FIX}"
)
# Disallow accidental build of vendored copies
file(REMOVE_RECURSE "${SOURCE_PATH}/3rdparty/openexr")
file(REMOVE_RECURSE "${SOURCE_PATH}/3rdparty/flatbuffers")
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
set(TARGET_IS_AARCH64 1)
@ -86,6 +88,12 @@ if("dnn" IN_LIST FEATURES)
else()
message(WARNING "The dnn module cannot be enabled on Android")
endif()
set(FLATC "${CURRENT_HOST_INSTALLED_DIR}/tools/flatbuffers/flatc${VCPKG_HOST_EXECUTABLE_SUFFIX}")
vcpkg_execute_required_process(
COMMAND "${FLATC}" --cpp -o "${SOURCE_PATH}/modules/dnn/misc/tflite" "${SOURCE_PATH}/modules/dnn/src/tflite/schema.fbs"
WORKING_DIRECTORY "${SOURCE_PATH}/modules/dnn/misc/tflite"
LOGNAME flatc-${TARGET_TRIPLET}
)
endif()
set(WITH_QT OFF)

View File

@ -1,6 +1,7 @@
{
"name": "opencv4",
"version": "4.8.0",
"port-version": 1,
"description": "computer vision library",
"homepage": "https://github.com/opencv/opencv",
"license": "Apache-2.0",
@ -102,6 +103,12 @@
"dnn": {
"description": "Enable dnn module",
"dependencies": [
"flatbuffers",
{
"name": "flatbuffers",
"host": true,
"default-features": false
},
"protobuf"
]
},

View File

@ -6014,7 +6014,7 @@
},
"opencv4": {
"baseline": "4.8.0",
"port-version": 0
"port-version": 1
},
"opendnp3": {
"baseline": "3.1.1",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "78f4556a682ebb41e2ff3f26090ef51cafe5a66c",
"version": "4.8.0",
"port-version": 1
},
{
"git-tree": "0bae188d52a71f441df28b25278e5506502dfd03",
"version": "4.8.0",