[CMake] Manual page generation
Laszlo Papp
djszapi at archlinux.us
Fri Sep 24 08:51:45 EDT 2010
This does not generate files. I have got a separate build directory
and doc directory in my project root. The main CMakeLists.txt contains
the doc subdirectory entry.
set(ASCIIDOC_MANS
hacky.8
akabei-create-db.8
akabei.conf.5
akabei.3
)
find_program(A2X_EXECUTABLE NAMES a2x a2x.py)
set(A2X_OPTS
-D ${CMAKE_BINARY_DIR}
-no-xmllint
-d manpage
-f manpage
--xsltproc-opts='-param man.endnotes.list.enabled 0 -param
man.endnotes.are.numbered 0'
)
set(MAN_NAMES ${ASCIIDOC_MANS})
set(MAN_FILES)
foreach(m IN LISTS MAN_NAMES)
message(STATUS ${CMAKE_BINARY_DIR}/${m})
set(mf ${CMAKE_BINARY_DIR}/${m})
set(ms ${CMAKE_SOURCE_DIR}/${m}.txt)
add_custom_command(OUTPUT ${mf}
COMMAND ${A2X_EXECUTABLE} ${A2X_OPTS} ${ms}
DEPENDS ${ms}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMENT "Building manpage ${mf}"
VERBATIM)
list(APPEND MAN_FILES ${mf})
endforeach()
add_custom_target(man ALL DEPENDS ${MAN_FILES})
More information about the CMake
mailing list