Add pkgconfig file for libupb

PiperOrigin-RevId: 651912682
diff --git a/cmake/install.cmake b/cmake/install.cmake
index 65765ca..bf56509 100644
--- a/cmake/install.cmake
+++ b/cmake/install.cmake
@@ -24,6 +24,10 @@
                ${CMAKE_CURRENT_BINARY_DIR}/protobuf.pc @ONLY)
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/protobuf-lite.pc.cmake
                ${CMAKE_CURRENT_BINARY_DIR}/protobuf-lite.pc @ONLY)
+if (protobuf_BUILD_LIBUPB)
+  configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/upb.pc.cmake
+                ${CMAKE_CURRENT_BINARY_DIR}/upb.pc @ONLY)
+endif ()
 
 set(_protobuf_libraries libprotobuf-lite libprotobuf)
 if (protobuf_BUILD_LIBPROTOC)
@@ -72,6 +76,9 @@
 endif (protobuf_BUILD_PROTOC_BINARIES)
 
 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/protobuf.pc ${CMAKE_CURRENT_BINARY_DIR}/protobuf-lite.pc DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
+if (protobuf_BUILD_LIBUPB)
+  install(FILES ${CMAKE_CURRENT_BINARY_DIR}/upb.pc DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
+endif ()
 
 include(${protobuf_SOURCE_DIR}/src/file_lists.cmake)
 set(protobuf_HEADERS
diff --git a/cmake/upb.pc.cmake b/cmake/upb.pc.cmake
new file mode 100644
index 0000000..b1d9900
--- /dev/null
+++ b/cmake/upb.pc.cmake
@@ -0,0 +1,10 @@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=@CMAKE_INSTALL_PREFIX@
+libdir=@CMAKE_INSTALL_FULL_LIBDIR@
+includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
+
+Name: Protocol Buffers
+Description: Google's Data Interchange Format
+Version: @protobuf_VERSION@
+Libs: -L${libdir} -lupb @CMAKE_THREAD_LIBS_INIT@
+Cflags: -I${includedir}