[CMake] Manual page generation

Laszlo Papp djszapi at archlinux.us
Fri Sep 24 10:00:57 EDT 2010


Hi,

I could sort out the issue, thank you. See the working version, below.

Best Regards,
Laszlo Papp

set(ASCIIDOC_MANS
akabei.3
akabei.conf.5
akabei-create-db.8
hacky.8
)

find_program(A2X_EXECUTABLE NAMES a2x a2x.py)
find_program(GZIP_EXECUTABLE NAMES gzip)

set(XSLTPROC_OPTS "-param man.endnotes.list.enabled 0 -param
man.endnotes.are.numbered 0")
set(ASCIIDOC_OPTS "-a akabei_version=${AKABEI_VERSION_STRING}")
set(A2X_OPTS --format=manpage
              --xsltproc-opts=${XSLTPROC_OPTS}
              -D${CMAKE_CURRENT_BINARY_DIR}
              --doctype=manpage
              --no-xmllint
)

foreach(manpage ${ASCIIDOC_MANS})
	execute_process(COMMAND ${A2X_EXECUTABLE} ${A2X_OPTS}
${CMAKE_CURRENT_SOURCE_DIR}/${manpage}.txt)
	execute_procesS(COMMAND ${GZIP_EXECUTABLE}
${CMAKE_CURRENT_BINARY_DIR}/${manpage})
endforeach()

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/akabei.3.gz DESTINATION
${MAN_INSTALL_DIR}/man3/)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/akabei.conf.5.gz DESTINATION
${MAN_INSTALL_DIR}/man5/)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/akabei-create-db.8.gz
DESTINATION ${MAN_INSTALL_DIR}/man8/)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/hacky.8.gz DESTINATION
${MAN_INSTALL_DIR}/man8/)


More information about the CMake mailing list