From: Guido Draheim Date: Sun, 16 Sep 2018 12:18:39 +0000 (+0200) Subject: generated and install pkgconfig files X-Git-Tag: v0.13.72~91 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=584a2b664144f698ca2fa8a79d3572693f2fba64;p=zziplib generated and install pkgconfig files --- diff --git a/Makefile b/Makefile index 645833d..672db9f 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ libzzip libzzipmmapped libzzipfseeko libzzipwrap zzipwrap: cd build && $(MAKE) $@ VERBOSE=1 zzip unzzip unzzip-mix unzzip-mem unzzip-big zzdir zzcat zzcatsdl zzxorcat zzxordir zzxorcopy zzobfuscated: cd build && $(MAKE) $@ VERBOSE=1 -sfx zzipself zzipsetstub doc htm man htmpages manpages site dbk pdf: +sfx zzipself zzipsetstub doc htm man htmpages manpages site dbk pdf pkgconfig: cd build && $(MAKE) $@ VERBOSE=1 tests checks check: cd build && $(MAKE) $@ VERBOSE=1 diff --git a/zzip/CMakeLists.txt b/zzip/CMakeLists.txt index 8f4d41a..71af7dc 100644 --- a/zzip/CMakeLists.txt +++ b/zzip/CMakeLists.txt @@ -211,7 +211,33 @@ add_custom_command(OUTPUT compat/zzip.h add_custom_target(compat ALL DEPENDS compat/zzip.h) endif() +if(UNIX) +add_custom_command(OUTPUT zziplib.pc + COMMAND ${BASH} -c "echo 'prefix=${CMAKE_INSTALL_PREFIX}' > zziplib.pc" + COMMAND ${BASH} -c "echo 'libdir=\${prefix}/${CMAKE_INSTALL_LIBDIR}' >> zziplib.pc" + COMMAND ${BASH} -c "echo 'includedir=\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}' >> zziplib.pc" + COMMAND ${BASH} -c "echo '' >> zziplib.pc" + COMMAND ${BASH} -c "echo 'Name: ${CMAKE_PROJECT_NAME}' >> zziplib.pc" + COMMAND ${BASH} -c "echo 'Description: ZZipLib - libZ-based ZIP-access Library with an Easy-to-Use API' >> zziplib.c" + COMMAND ${BASH} -c "echo 'Version: ${VERSION}' >> zziplib.pc" + COMMAND ${BASH} -c "echo 'Requires: zlib' >> zziplib.pc" + COMMAND ${BASH} -c "echo 'Libs: -L\${libdir} -lzzip' >> zziplib.pc" + COMMAND ${BASH} -c "echo 'Cflags: -I\${includedir}' >> zziplib.pc" + COMMAND ${BASH} -c "sed -e 's/-lzzip/-lzzipmmapped/' -e 's/zziplib/zzipmmapped/' zziplib.pc > zzipmmapped.pc" + COMMAND ${BASH} -c "sed -e 's/-lzzip/-lzzipfseeko/' -e 's/zziplib/zzipfseeko/' zziplib.pc > zzipfseeko.pc" + BYPRODUCTS zzipmmapped.pc zzipfseeko.pc + VERBATIM) +add_custom_target(pkgconfig ALL DEPENDS zziplib.pc) +endif() + # install ######################################################## +set(outdir ${CMAKE_CURRENT_BINARY_DIR}) + +if(UNIX) +install(FILES ${outdir}/zziplib.pc ${outdir}/zzipmmapped.pc ${outdir}/zzipfseeko.pc + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig" ) +endif() + install(FILES ${libzzip_HDRS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/zzip ) install(TARGETS libzzip LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} diff --git a/zzipwrap/CMakeLists.txt b/zzipwrap/CMakeLists.txt index f706e34..3fac24a 100644 --- a/zzipwrap/CMakeLists.txt +++ b/zzipwrap/CMakeLists.txt @@ -48,7 +48,30 @@ SET_TARGET_PROPERTIES(libzzipwrap PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSI add_executable(zzipwrap ${zzipwrap_SRCS} ) target_link_libraries(zzipwrap libzzipwrap ) +if(UNIX) +add_custom_command(OUTPUT zzipwrap.pc + COMMAND ${BASH} -c "echo 'prefix=${CMAKE_INSTALL_PREFIX}' > zzipwrap.pc" + COMMAND ${BASH} -c "echo 'libdir=\${prefix}/${CMAKE_INSTALL_LIBDIR}' >> zzipwrap.pc" + COMMAND ${BASH} -c "echo 'includedir=\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}' >> zzipwrap.pc" + COMMAND ${BASH} -c "echo '' >> zzipwrap.pc" + COMMAND ${BASH} -c "echo 'Name: ${PROJECT_NAME}' >> zzipwrap.pc" + COMMAND ${BASH} -c "echo 'Description: Callback Wrappers for ZZipLib' >> zzipwrap.c" + COMMAND ${BASH} -c "echo 'Version: ${VERSION}' >> zzipwrap.pc" + COMMAND ${BASH} -c "echo 'Requires: zziplib' >> zzipwrap.pc" + COMMAND ${BASH} -c "echo 'Libs: -L\${libdir} -lzzipwrap' >> zzipwrap.pc" + COMMAND ${BASH} -c "echo 'Cflags: -I\${includedir}' >> zzipwrap.pc" + VERBATIM) +add_custom_target(pkgconfigs ALL DEPENDS zzipwrap.pc) +endif() + # install ######################################################## +set(outdir ${CMAKE_CURRENT_BINARY_DIR}) + +if(UNIX) +install(FILES ${outdir}/zzipwrap.pc + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig" ) +endif() + install(FILES ${libzzipwrap_HDRS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/zzip ) install(TARGETS libzzipwrap LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}