From dd2c0276aac7a8f22e1896189cacdbd67b819339 Mon Sep 17 00:00:00 2001 From: Tao He Date: Thu, 15 Jun 2023 13:47:39 +0800 Subject: [PATCH] Find protobuf in CONFIG mode to fixes the absl dependencies. (#225) See also: https://github.com/protocolbuffers/protobuf/issues/12292. Signed-off-by: Tao He --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 32eb232..0490731 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -106,7 +106,10 @@ if(APPLE) endif() find_package(OpenSSL REQUIRED) -find_package(Protobuf REQUIRED) +find_package(Protobuf CONFIG QUIET) +if (NOT Protobuf_FOUND) + find_package(Protobuf REQUIRED) +endif() if(Protobuf_PROTOC_EXECUTABLE) if(NOT TARGET protobuf::protoc) add_executable(protobuf::protoc IMPORTED)