Skip to content

Commit 09a8d61

Browse files
Merge pull request #12542 from protocolbuffers/pkgconfig-22
Fix declared dependencies for pkg-config
2 parents 2496b98 + 2c55945 commit 09a8d61

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

cmake/install.cmake

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
include(GNUInstallDirs)
22

3+
foreach(_target IN LISTS protobuf_ABSL_USED_TARGETS)
4+
string(REPLACE :: _ _modified_target ${_target})
5+
list(APPEND _pc_targets ${_modified_target})
6+
endforeach()
7+
list(APPEND _pc_targets "utf8_range")
8+
9+
string(JOIN " " _pc_target_list ${_pc_targets})
10+
set(_protobuf_PC_REQUIRES ${_pc_target_list})
11+
312
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/protobuf.pc.cmake
413
${CMAKE_CURRENT_BINARY_DIR}/protobuf.pc @ONLY)
514
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/protobuf-lite.pc.cmake

cmake/protobuf-lite.pc.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
66
Name: Protocol Buffers
77
Description: Google's Data Interchange Format
88
Version: @protobuf_VERSION@
9+
Requires: @_protobuf_PC_REQUIRES@
10+
Requires.private: @_protobuf_PC_REQUIRES_PRIVATE@
911
Libs: -L${libdir} -lprotobuf-lite @CMAKE_THREAD_LIBS_INIT@
1012
Cflags: -I${includedir}
1113
Conflicts: protobuf

cmake/protobuf.pc.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
66
Name: Protocol Buffers
77
Description: Google's Data Interchange Format
88
Version: @protobuf_VERSION@
9+
Requires: @_protobuf_PC_REQUIRES@
10+
Requires.private: @_protobuf_PC_REQUIRES_PRIVATE@
911
Libs: -L${libdir} -lprotobuf @CMAKE_THREAD_LIBS_INIT@
1012
Cflags: -I${includedir}
1113
Conflicts: protobuf-lite

0 commit comments

Comments
 (0)