I'm using cmake to compile and install protobuf 3.0.0-beta2 on MinGW64 / MSYS2. Everything compiles, tests and works fine. However, the protobuf.pc file for pkg-config is not installed in
This confuses grpc compile into not finding protobuf, since grpc assumes that pkg-config must have protobuf.pc (if pkg-config is available).
The cmake support works with visual studio and other cmake projects better. If you are using pkgconfig, could you use autotools to build/install protobuf instead (following the linux install instructions)?
I see you point. But the autotools build currently fails for me on MinGW / MSYS2 (see issue #1355). So I'm a bit dependent on cmake. I'm not interested in pkgconfig myself, gRPC is. It seems gRPC is not playing nicely together with the cmake-build (for the lack of pkgconfig)?
Long story short, if you say cmake and pkgconfig don't go together, that's fine with me, and we can close this issue. But then we should either reopen #1355 to make sure people can build with pkgconfig on MinGW, or gRPC needs to be fixed. Whats the "correct" thing to do?
I think we should fix both issues:
I don't have time to work on these fixes though. Could you help investigate why they don't work? A pull request to fix them will be much appreciated.
I think this sounds good. I won't have time to work on this in the next weeks, though. If somebody else experiences this issue, I've found an (admittedly ugly) workaround: run configure to generate protobuf.pc with the correct settings, afterwards run cmake to get a compile and install, finally copy protobuf.pc to the install directory. Its ugly but sufficient to work, for the time being.
Dear @pherl is the issue now fixed? I think protobuf cmake should install pkg-config files. Many packages do this, and its really not too hard.
Sorry, the issue is not fixed, but we don't have the time nor expertise to fix the issue.
@xfxyjwf Can we please re-open this issue so point 1
make cmake installation work with pkgconfig.
can be addressed? :)
This would be the easiest solution and allows building with CMake which does not brake down-stream builds with autotools, such as mosh.
Adding this functionality is really simple, here is an example for zlib: https://gitlab.kitware.com/third-party/zlib/commit/ca6e7a0d552e3b54c0833658409e34f9de3bead6
@ax3l Can you send us a pull request?
@xfxyjwf sure, PR is open now in #3403 (sorry for my cross-post!)