Browse Source

Provide pkg-config file

This allows to use the pkg-config mechanism on supported systems.
pull/2631/head
Corentin Noël 5 years ago
committed by Corentin Noël
parent
commit
aea4be130e
2 changed files with 19 additions and 0 deletions
  1. +9
    -0
      cpp/CMakeLists.txt
  2. +10
    -0
      cpp/libphonenumber.pc.in

+ 9
- 0
cpp/CMakeLists.txt View File

@ -712,6 +712,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
#----------------------------------------------------------------
if (BUILD_SHARED_LIBS AND UNIX)
configure_file(libphonenumber.pc.in libphonenumber.pc @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libphonenumber.pc"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
endif ()
#----------------------------------------------------------------
# Build an RPM
#----------------------------------------------------------------


+ 10
- 0
cpp/libphonenumber.pc.in View File

@ -0,0 +1,10 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
Name: libphonenumber
Description: Parse, format, store and validate international phone numbers
URL: https://github.com/google/libphonenumber
Version: @CMAKE_PROJECT_VERSION@
Libs: -L${libdir} -lphonenumber

Loading…
Cancel
Save