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
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}
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}