build: add cmake rules for building manuals

This commit is contained in:
Eric Wasylishen 2016-04-09 15:39:29 -06:00
parent 5b2529ebd4
commit b6da18fca8
2 changed files with 21 additions and 0 deletions

View File

@ -63,6 +63,7 @@ add_subdirectory(bsputil)
add_subdirectory(light) add_subdirectory(light)
add_subdirectory(qbsp) add_subdirectory(qbsp)
add_subdirectory(vis) add_subdirectory(vis)
add_subdirectory(man)
#CPack configuration #CPack configuration

20
man/CMakeLists.txt Normal file
View File

@ -0,0 +1,20 @@
cmake_minimum_required (VERSION 2.6)
project (man)
find_program (GROFF NAMES groff)
if (GROFF-NOTFOUND)
message(FATAL_ERROR "Could not find groff")
endif(GROFF-NOTFOUND)
if(GROFF)
set(MANPAGES qbsp vis light bsputil bspinfo)
foreach(MANPAGE ${MANPAGES})
add_custom_command(
OUTPUT ${MANPAGE}.txt
COMMAND ${GROFF} -Tascii -man ${CMAKE_SOURCE_DIR}/man/${MANPAGE}.1 | col -bx > ${MANPAGE}.txt
)
add_custom_target(man_${MANPAGE} ALL DEPENDS ${MANPAGE}.txt)
install(FILES ${MANPAGE}.txt DESTINATION doc)
endforeach()
endif(GROFF)