From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Jan Alexander Steffens (heftig)" <heftig@archlinux.org>
Date: Thu, 9 May 2024 23:19:05 +0200
Subject: [PATCH] Use find_package for protobuf

Use the official protobuf cmake target instead of a custom one; fixes
build with protobuf 23.
---
 cpp/CMakeLists.txt | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index 96def5c8f943..304a1a2af484 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -170,13 +170,11 @@ if (USE_RE2)
 endif ()
 
 if (USE_PROTOBUF_LITE)
-  find_required_library (PROTOBUF google/protobuf/message_lite.h protobuf-lite
-                         "Google Protocol Buffers")
-  check_library_version (PC_PROTOBUF protobuf-lite>=2.4)
+  find_package (Protobuf CONFIG)
+  set (PROTOBUF_LIB protobuf::libprotobuf-lite)
 else ()
-  find_required_library (PROTOBUF google/protobuf/message_lite.h protobuf
-                         "Google Protocol Buffers")
-  check_library_version (PC_PROTOBUF protobuf>=2.4)
+  find_package (Protobuf CONFIG)
+  set (PROTOBUF_LIB protobuf::libprotobuf)
 endif ()
 
 find_required_library (ICU_UC unicode/uchar.h icuuc "ICU")
