set( SRCDIR ${CMAKE_CURRENT_SOURCE_DIR} ) macro( page to srcdir opts ) set( sources "" ) set( out "${CMAKE_CURRENT_BINARY_DIR}/${to}" ) list( APPEND pages ${out} ) foreach( source ${ARGN} ) list( APPEND sources "${srcdir}/${source}" ) endforeach() add_custom_command( OUTPUT ${out} DEPENDS ${sources} template.html ${SRCDIR}/../md2html.pl WORKING_DIRECTORY ${SRCDIR} COMMAND perl ${SRCDIR}/../md2html.pl version=${DIVINE_VERSION} opts=${opts} ${sources} | sed -e "s,:DIVINE:,DIVINE,g" > ${out} VERBATIM ) endmacro() macro( pages sourcedir ) foreach( source ${ARGN} ) string( REPLACE ".md" ".html" target "${source}" ) page( ${target} ${sourcedir} "" ${source} ) endforeach() endmacro() macro( resources ) foreach( source ${ARGN} ) string( REPLACE "../" "" target "${source}" ) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${target} DEPENDS ${SRCDIR}/${source} COMMAND cmake -E copy ${SRCDIR}/${source} . ) list( APPEND resources ${target} ) endforeach() endmacro() add_custom_command( OUTPUT papers.html DEPENDS ${SRCDIR}/../bib2md.pl template.html ${SRCDIR}/../papers.bib COMMAND perl ${SRCDIR}/../bib2md.pl ${SRCDIR}/../papers.bib | pandoc -s --smart --template ${SRCDIR}/template.html > papers.html ) page( whatsnew.html .. "--toc" NEWS ) page( roadmap.html .. "" ROADMAP ) page( manual.html ../manual "--toc -N" ${MANUAL_SRC} ) pages( . download.md index.md status.md ) resources( style.css um-400.ttf um-700.ttf lato-400.ttf lato-700.ttf ../papers.bib ) add_custom_target( website ALL DEPENDS ${pages} ${resources} papers.html )