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})
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to