broken protobuf*.pc file with cmake 3.16.0
I'm building google Protobuf 3.6.1 from sources on various x86_64-linux VMs. WEhen I use CMake 3.6.x, 3.12.x,3.14.x, 3.15.x, its generate correct ROOT/lib64/pkg-config/protobuf.pc file:
prefix=/opt/host-providence-tools exec_prefix=/opt/host-providence-tools libdir=/opt/host-providence-tools/lib64 includedir=/opt/host-providence-tools/include
Name: Protocol Buffers Description: Google's Data Interchange Format Version: 3.6.1 Libs: -L${libdir} -lprotobuf -lpthread Cflags: -I${includedir} -lpthread Conflicts: protobuf-lite
When I'm building same Protobuf version on same VM with latest 3.16.0, I get broken protobuf.pc file (see "pthread"):
prefix=/opt/host-providence-tools exec_prefix=/opt/host-providence-tools libdir=/opt/host-providence-tools/lib64 includedir=/opt/host-providence-tools/include
Name: Protocol Buffers Description: Google's Data Interchange Format Version: 3.6.1 Libs: -L${libdir} -lprotobuf pthread Cflags: -I${includedir} pthread Conflicts: protobuf-lite
Difference "-lpthread" -> "pthread" breaks building dependent packages, in my case it is google GRPC 1.16.1. I guess there is a bug or incompatible change in cmake "threads" package detection ... To my understanding, "-pthread" should be added to both compile and link flags. Alternatively, "-lpthread" maybe added to link flags.