opencv-4.10.0-dnn-explicitly-include-abseil-cpp.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. From 980dd32e52da10901094a7f8a5dbe5287a62a602 Mon Sep 17 00:00:00 2001
  2. From: Paul Zander <negril.nx+gentoo@gmail.com>
  3. Date: Thu, 5 Sep 2024 15:53:36 +0200
  4. Subject: [PATCH] dnn: explicitly include abseil-cpp
  5. Linking against abseil-cpp depended on protobuf exporting all abseil-cpp
  6. libraries via protobuf::libprotobuf public libraries.
  7. Explcitly finding abseil ourselves removes the need for that.
  8. Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com>
  9. diff --git a/cmake/OpenCVFindProtobuf.cmake b/cmake/OpenCVFindProtobuf.cmake
  10. index 9228b04..7d9f315 100644
  11. --- a/cmake/OpenCVFindProtobuf.cmake
  12. +++ b/cmake/OpenCVFindProtobuf.cmake
  13. @@ -32,6 +32,7 @@ else()
  14. # we still need this for command PROTOBUF_GENERATE_CPP.
  15. set(protobuf_MODULE_COMPATIBLE ON)
  16. + find_package(absl CONFIG REQUIRED)
  17. unset(Protobuf_VERSION CACHE)
  18. find_package(Protobuf QUIET CONFIG)
  19. if(NOT Protobuf_FOUND)
  20. diff --git a/modules/dnn/CMakeLists.txt b/modules/dnn/CMakeLists.txt
  21. index 562b144..052c4f8 100644
  22. --- a/modules/dnn/CMakeLists.txt
  23. +++ b/modules/dnn/CMakeLists.txt
  24. @@ -144,6 +144,7 @@ list(APPEND libs ${Protobuf_LIBRARIES})
  25. if(NOT BUILD_PROTOBUF)
  26. list(APPEND include_dirs ${Protobuf_INCLUDE_DIRS})
  27. endif()
  28. +list(APPEND libs absl::check)
  29. set(sources_options "")
  30. --
  31. 2.46.0