set(outdir ${CMAKE_CURRENT_BINARY_DIR})
set(PY ${PYTHON_EXECUTABLE})
+set(mandir ${CMAKE_INSTALL_FULL_MANDIR})
+set(docdir ${CMAKE_INSTALL_FULL_DOCDIR})
+
+set(bins ${CMAKE_SOURCE_DIR}/bins)
+set(SDLs ${CMAKE_SOURCE_DIR}/SDL)
+
# targets ########################################################
set(doc_FILES README.MSVC6 README.SDL COPYING.MPL COPYING.LIB COPYING.ZLIB
zziplib.html zzipmmapped.html zzipfseeko.html)
configs.htm sfx-make.htm developer.htm download.htm
history.htm referentials.htm faq.htm copying.htm notes.htm
functions.htm zip-php.htm)
+set(bins_FILES ${bins}/zzdir.c ${bins}/zzcat.c ${bins}/zzobfuscated.c ${bins}/zziptest.c ${bins}/zzxordir.c ${bins}/zzxorcat.c ${bins}/zzxorcopy.c )
+set(SDLs_FILES ${SDLs}/SDL_rwops_zzcat.c ${SDLs}/SDL_rwops_zzip.c ${SDLs}/SDL_rwops_zzip.h )
set(zzipdoc_FILES makedocs.py zzipdoc/__init__.py
zzipdoc/commentmarkup.py zzipdoc/match.py
zzipdoc/dbk2htm.py zzipdoc/htm2dbk.py
COMMAND ${PY} ${srcdir}/makedocs.py ${topdir}/zzip/*.c ${docinfo} --onlymainheader=zzip/fseeko.h --output=zzipfseeko
COMMAND ${MV} zzipfseeko.docbook zzipfseeko.xml
DEPENDS libzzipfseeko
- BYPRODUCTS zzipfsseko.html)
+ BYPRODUCTS zzipfseeko.html)
add_custom_command(OUTPUT manpages.tar
COMMAND ${BASH} -c "test -d man3 && rm -rf man3; mkdir man3"
COMMAND ${PY} ${srcdir}/dbk2man.py -o man3 man zziplib.xml
COMMAND ${BASH} -c "test -d man3/man3 && mv man3 man3_; test -d man3_/man3 && mv man3_/man3 .; rm -rf man3_"
COMMAND ${BASH} -c "chmod 664 man3/*.3"
COMMAND ${BASH} -c "tar cf manpages.tar man3"
+ COMMAND ${BASH} -c "ls -l `pwd`/manpages.tar `pwd`/htmpages.tar >&2 || true"
DEPENDS zziplib.xml zzipmmapped.xml zzipfseeko.xml
VERBATIM)
add_custom_command(OUTPUT htmpages.tar
COMMAND ${PY} ${srcdir}/dbk2man.py -o html html zzipfseeko.xml
COMMAND ${PY} ${srcdir}/dir2index.py -o html html
COMMAND ${BASH} -c "tar cf htmpages.tar html/*.*"
+ COMMAND ${BASH} -c "ls -l `pwd`/htmpages.tar `pwd`/manpages.tar >&2 || true"
DEPENDS zziplib.xml zzipmmapped.xml zzipfseeko.xml
VERBATIM)
+add_custom_target(mans DEPENDS manpages)
add_custom_target(man DEPENDS manpages)
add_custom_target(htm DEPENDS htmpages)
add_custom_target(manpages DEPENDS manpages.tar)
add_custom_target(htmpages DEPENDS htmpages.tar)
-add_custom_target(doc ALL DEPENDS manpages)
+add_custom_target(doc DEPENDS zziplib.xml zzipmmapped.xml zzipfseeko.xml site.html)
+add_custom_target(docs DEPENDS doc manpages htmpages)
+
+
+string(REPLACE ";" " " all_bins_FILES "${bins_FILES}")
+string(REPLACE ";" " " all_SDLs_FILES "${SDLs_FILES}")
+add_custom_target(install-site
+ COMMAND ${BASH} -c "ls -l ${CMAKE_CURRENT_BINARY_DIR}/site.html"
+ COMMAND ${BASH} -c "mkdir -vp $(DESTDIR)${docdir} >&2 || ls -ld $(DESTDIR)${docdir} >&2"
+ COMMAND ${BASH} -c "cd ${outdir} && cp zziplib.html zzipmmapped.html zzipfseeko.html $(DESTDIR)${docdir}/"
+ COMMAND ${BASH} -c "cd ${srcdir} && cp README.* COPYING.* $(DESTDIR)${docdir}/"
+ COMMAND ${BASH} -c "cd ${topdir} && cp ChangeLog $(DESTDIR)${docdir}/"
+ COMMAND ${BASH} -c "cd ${topdir} && cp ${all_bins_FILES} $(DESTDIR)${docdir}/"
+ COMMAND ${BASH} -c "cd ${topdir} && cp ${all_SDLs_FILES} $(DESTDIR)${docdir}/"
+ COMMAND ${BASH} -c "cd $(DESTDIR)${docdir} && cp ${outdir}/*.html ."
+ COMMAND ${BASH} -c "cd $(DESTDIR)${docdir} && ln -s zzip-index.html index.html"
+ DEPENDS site.html zziplib.html zzipmmapped.html zzipfseeko.html
+ VERBATIM)
+add_custom_target(install-htmpages
+ COMMAND ${BASH} -c "ls -l ${CMAKE_CURRENT_BINARY_DIR}/*pages.tar"
+ COMMAND ${BASH} -c "mkdir -vp $(DESTDIR)${docdir} >&2 || ls -ld $(DESTDIR)${docdir} >&2"
+ COMMAND ${BASH} -c "cd $(DESTDIR)${docdir} && tar x -f ${outdir}/htmpages.tar"
+ COMMAND ${BASH} -c "cd $(DESTDIR)${docdir} && mv html man"
+ DEPENDS htmpages.tar
+ VERBATIM)
+add_custom_target(install-manpages
+ COMMAND ${BASH} -c "ls -l ${CMAKE_CURRENT_BINARY_DIR}/*pages.tar"
+ COMMAND ${BASH} -c "mkdir -vp $(DESTDIR)${mandir} >&2 || ls -ld $(DESTDIR)${mandir} >&2"
+ COMMAND ${BASH} -c "cd $(DESTDIR)${mandir} && tar xf ${outdir}/manpages.tar"
+ DEPENDS manpages.tar
+ VERBATIM)
+add_custom_target(install-docs DEPENDS install-manpages install-htmpages install-site)
+add_custom_target(install-mans DEPENDS install-manpages)
+add_custom_target(install-man DEPENDS install-manpages)
# install ########################################################
set(mandir ${CMAKE_INSTALL_FULL_MANDIR})