diff options
author | Eugene Kliuchnikov <eustas@google.com> | 2016-12-22 08:57:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-22 08:57:44 +0100 |
commit | fe9f9a9182e292664a8db315e3155d5e33970478 (patch) | |
tree | fa70358be361902ac6132e732bb9b4ee6f815722 | |
parent | 6ab0a5cee7a36b30012066caf6bca9a48fcae958 (diff) | |
download | brotli-fe9f9a9182e292664a8db315e3155d5e33970478.zip brotli-fe9f9a9182e292664a8db315e3155d5e33970478.tar.gz brotli-fe9f9a9182e292664a8db315e3155d5e33970478.tar.bz2 |
Split brotli common/dec/enc .pc files (#490)
Add URL, and use DEPENS_PRIVATE generator params
-rw-r--r-- | CMakeLists.txt | 47 |
1 files changed, 40 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 856d0be..423c644 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -313,8 +313,8 @@ endfunction(generate_pkg_config_path) function(generate_pkg_config output_file) set (options) - set (oneValueArgs NAME DESCRIPTION PREFIX LIBDIR INCLUDEDIR VERSION) - set (multiValueArgs DEPENDS CFLAGS LIBRARIES) + set (oneValueArgs NAME DESCRIPTION URL VERSION PREFIX LIBDIR INCLUDEDIR) + set (multiValueArgs DEPENDS_PRIVATE CFLAGS LIBRARIES) cmake_parse_arguments(GEN_PKG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) unset (options) unset (oneValueArgs) @@ -351,10 +351,22 @@ function(generate_pkg_config output_file) file(APPEND "${output_file}" "Description: ${GEN_PKG_DESCRIPTION}\n") endif() + if(GEN_PKG_URL) + file(APPEND "${output_file}" "URL: ${GEN_PKG_URL}\n") + endif() + if(GEN_PKG_VERSION) file(APPEND "${output_file}" "Version: ${GEN_PKG_VERSION}\n") endif() + if(GEN_PKG_DEPENDS_PRIVATE) + file(APPEND "${output_file}" "Requires.private:") + foreach(lib ${GEN_PKG_DEPENDS_PRIVATE}) + file(APPEND "${output_file}" " ${lib}") + endforeach() + file(APPEND "${output_file}" "\n") + endif() + if(GEN_PKG_LIBRARIES) set(libs) @@ -374,14 +386,35 @@ function(generate_pkg_config output_file) file(APPEND "${output_file}" "\n") endfunction(generate_pkg_config) -generate_pkg_config ("${CMAKE_CURRENT_BINARY_DIR}/brotli.pc" - NAME Brotli - DESCRIPTION "Brotli compression library" +generate_pkg_config ("${CMAKE_CURRENT_BINARY_DIR}/libbrotlicommon.pc" + NAME libbrotlicommon + DESCRIPTION "Shared data used by libbrotlienc and libbrotlidec libraries" + URL "https://github.com/google/brotli" VERSION "${BROTLI_VERSION_MAJOR}.${BROTLI_VERSION_MINOR}.${BROTLI_VERSION_REVISION}" - LIBRARIES brotlicommon brotlidec brotlienc) + LIBRARIES brotlicommon) + +generate_pkg_config ("${CMAKE_CURRENT_BINARY_DIR}/libbrotlidec.pc" + NAME libbrotlidec + DESCRIPTION "Brotli decoder library" + VERSION "${BROTLI_VERSION_MAJOR}.${BROTLI_VERSION_MINOR}.${BROTLI_VERSION_REVISION}" + URL "https://github.com/google/brotli" + DEPENDS_PRIVATE libbrotlicommon + LIBRARIES brotlidec) + +generate_pkg_config ("${CMAKE_CURRENT_BINARY_DIR}/libbrotlienc.pc" + NAME libbrotlienc + DESCRIPTION "Brotli encoder library" + VERSION "${BROTLI_VERSION_MAJOR}.${BROTLI_VERSION_MINOR}.${BROTLI_VERSION_REVISION}" + URL "https://github.com/google/brotli" + DEPENDS_PRIVATE brotlicommon + LIBRARIES brotlienc) if(NOT BROTLI_BUNDLED_MODE) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/brotli.pc" + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libbrotlicommon.pc" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libbrotlidec.pc" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libbrotlienc.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") endif() |