Use find_package Protobuf CONFIG

This commit is contained in:
Jonas Kvinge
2023-05-14 21:52:55 +02:00
parent 58278ab1e4
commit b52ffd09b2
2 changed files with 17 additions and 11 deletions

View File

@@ -117,9 +117,14 @@ else()
find_package(Iconv)
endif()
find_package(GnuTLS REQUIRED)
find_package(Protobuf REQUIRED)
if(NOT Protobuf_PROTOC_EXECUTABLE)
message(FATAL_ERROR "Missing protobuf compiler.")
if(NOT APPLE)
find_package(Protobuf CONFIG)
endif()
if(NOT Protobuf_FOUND)
find_package(Protobuf REQUIRED)
endif()
if(NOT TARGET protobuf::protoc)
message(FATAL_ERROR "Missing Protobuf compiler.")
endif()
if(LINUX)
find_package(ALSA REQUIRED)