diff options
author | Adam Cozzette <acozzette@gmail.com> | 2017-07-24 08:11:38 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-24 08:11:38 -0700 |
commit | eef2edcb8432dea32fe9d62e3f8f5d82677d71fd (patch) | |
tree | 1232072e7c728e12f5c3f3d4be1cf7d87543ea7b | |
parent | e8a32d07ffc665695b7532b97f96970cdeff977e (diff) | |
parent | 74dcf447af2ce8550cd175ca18d98005980a9120 (diff) | |
download | protobuf-eef2edcb8432dea32fe9d62e3f8f5d82677d71fd.tar.gz protobuf-eef2edcb8432dea32fe9d62e3f8f5d82677d71fd.tar.bz2 protobuf-eef2edcb8432dea32fe9d62e3f8f5d82677d71fd.zip |
Merge pull request #3403 from ax3l/topic-cmake-pkgconfig
CMake: Install .pc Files
-rw-r--r-- | cmake/install.cmake | 7 | ||||
-rw-r--r-- | cmake/protobuf-lite.pc.cmake | 11 | ||||
-rw-r--r-- | cmake/protobuf.pc.cmake | 11 | ||||
-rwxr-xr-x | tests.sh | 1 |
4 files changed, 30 insertions, 0 deletions
diff --git a/cmake/install.cmake b/cmake/install.cmake index 28dc90dc..441bf553 100644 --- a/cmake/install.cmake +++ b/cmake/install.cmake @@ -1,5 +1,10 @@ include(GNUInstallDirs) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/protobuf.pc.cmake + ${CMAKE_CURRENT_BINARY_DIR}/protobuf.pc @ONLY) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/protobuf-lite.pc.cmake + ${CMAKE_CURRENT_BINARY_DIR}/protobuf-lite.pc @ONLY) + foreach(_library libprotobuf-lite libprotobuf @@ -17,6 +22,8 @@ endforeach() install(TARGETS protoc EXPORT protobuf-targets RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT protoc) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/protobuf.pc ${CMAKE_CURRENT_BINARY_DIR}/protobuf-lite.pc DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") + file(STRINGS extract_includes.bat.in _extract_strings REGEX "^copy") foreach(_extract_string ${_extract_strings}) diff --git a/cmake/protobuf-lite.pc.cmake b/cmake/protobuf-lite.pc.cmake new file mode 100644 index 00000000..cbe5426a --- /dev/null +++ b/cmake/protobuf-lite.pc.cmake @@ -0,0 +1,11 @@ +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} -lprotobuf-lite @CMAKE_THREAD_LIBS_INIT@ +Cflags: -I${includedir} @CMAKE_THREAD_LIBS_INIT@ +Conflicts: protobuf diff --git a/cmake/protobuf.pc.cmake b/cmake/protobuf.pc.cmake new file mode 100644 index 00000000..d33e98cc --- /dev/null +++ b/cmake/protobuf.pc.cmake @@ -0,0 +1,11 @@ +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} -lprotobuf @CMAKE_THREAD_LIBS_INIT@ +Cflags: -I${includedir} @CMAKE_THREAD_LIBS_INIT@ +Conflicts: protobuf-lite @@ -63,6 +63,7 @@ build_cpp_distcheck() { # List all files that should be included in the distribution package. git ls-files | grep "^\(java\|python\|objectivec\|csharp\|js\|ruby\|php\|cmake\|examples\)" |\ grep -v ".gitignore" | grep -v "java/compatibility_tests" |\ + grep -v "cmake/protobuf.*\.pc\.cmake" |\ grep -v "python/compatibility_tests" | grep -v "csharp/compatibility_tests" > dist.lst # Unzip the dist tar file. DIST=`ls *.tar.gz` |