You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
impl: prefer Protobuf config vs. module in CMake (#11517)
CMake ships with a `FindProtobuf` module, when one types:
```
find_package(Protobuf)
```
CMake uses that module to find protobuf and add the necessary compile
and link-time flags. The next release of Protobuf adds dependencies that
the module does not know about. Fortunately the next release also
install the CMake support files, which can be used if one types:
```
find_package(Protobuf CONFIG)
```
Because we need to support older versions of Protobuf, we first try with
the `CONFIG` flag, and then fallback to the module instead.
We install our own CMake configuration files, which need to use
`find_dependency()` to find Protobuf. `find_dependency()` is a thin
wrapper around `find_package()`, and it needs to use the same strategy
that we know worked for building `google-cloud-cpp`.
In the generator's CMake file, we use `protobuf_generate_cpp()` which
does not always exist.
0 commit comments