From dc5c1499c02517e86e9cafc76967c2f591a012a8 Mon Sep 17 00:00:00 2001 From: Dark Dragon Date: Wed, 26 Apr 2023 22:14:01 +0200 Subject: [PATCH] Add pkgconfig --- cpp/CMakeLists.txt | 9 +++++++++ cpp/cmake/libphonenumber.pc.cmake | 11 +++++++++++ 2 files changed, 20 insertions(+) create mode 100644 cpp/cmake/libphonenumber.pc.cmake diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index cdd7a0813..b3a088169 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -718,6 +718,15 @@ configure_package_config_file("cmake/config.cmake.in" "${project_config}" INSTAL install(FILES "${project_config}" "${version_config}" DESTINATION "${config_install_dir}") install(EXPORT "${targets_export_name}" NAMESPACE ${PROJECT_NAME}:: DESTINATION "${config_install_dir}") +#---------------------------------------------------------------- +# Build and install pkg config file +#---------------------------------------------------------------- + +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/${PROJECT_NAME}.pc.cmake + ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc @ONLY) + +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") + #---------------------------------------------------------------- # Build an RPM #---------------------------------------------------------------- diff --git a/cpp/cmake/libphonenumber.pc.cmake b/cpp/cmake/libphonenumber.pc.cmake new file mode 100644 index 000000000..8f092dff0 --- /dev/null +++ b/cpp/cmake/libphonenumber.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: Libphonenumber +Description: Google's Phonenumber library +Version: @CMAKE_PROJECT_VERSION@ +Requires: @PROTOBUF_LIB@ +Libs: -L${libdir} -lphonenumber +Cflags: -I${includedir}