diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 51177a0..927a916 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -101,7 +101,7 @@ jobs: run: | sudo apt-get update sudo apt-get install -y --no-install-recommends \ - libprotobuf-dev libprotoc-dev protobuf-compiler + libprotobuf-dev libprotoc-dev protobuf-compiler=3.15.0 - name: Configure CMake uses: ./.github/actions/configure-cmake diff --git a/cmake/dependencies.cmake b/cmake/dependencies.cmake index 589ae55..73ea69b 100644 --- a/cmake/dependencies.cmake +++ b/cmake/dependencies.cmake @@ -1,6 +1,16 @@ include(FetchContent) -find_package(Protobuf REQUIRED) +set(protobuf_MODULE_COMPATIBLE TRUE) +find_package(Protobuf CONFIG REQUIRED) +message(STATUS "Using protobuf ${Protobuf_VERSION}") + +set(_PROTOBUF_LIBPROTOBUF protobuf::libprotobuf) +set(_REFLECTION gRPC::grpc++_reflection) +if(CMAKE_CROSSCOMPILING) + find_program(_PROTOBUF_PROTOC protoc) +else() + set(_PROTOBUF_PROTOC $) +endif() FetchContent_Declare(googleapis URL https://github.com/googleapis/googleapis/archive/0e3b813b0d0da539eacbe86b8716feeed00943c5.tar.gz