build: get the man cmake target to work in VS
This commit is contained in:
parent
b6da18fca8
commit
c1865363de
|
|
@ -1,20 +1,22 @@
|
|||
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)
|
||||
find_program (GROFF groff)
|
||||
|
||||
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
|
||||
OUTPUT ${MANPAGE}.html
|
||||
COMMAND ${GROFF} -Thtml -man ${CMAKE_SOURCE_DIR}/man/${MANPAGE}.1 > ${MANPAGE}.html
|
||||
)
|
||||
add_custom_target(man_${MANPAGE} ALL DEPENDS ${MANPAGE}.txt)
|
||||
install(FILES ${MANPAGE}.txt DESTINATION doc)
|
||||
add_custom_target(man_${MANPAGE} DEPENDS ${MANPAGE}.html)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE}.html DESTINATION doc)
|
||||
endforeach()
|
||||
#make each of the main targets depend on the manuals
|
||||
add_dependencies(qbsp man_qbsp)
|
||||
add_dependencies(vis man_vis)
|
||||
add_dependencies(light man_light)
|
||||
add_dependencies(bsputil man_bsputil)
|
||||
add_dependencies(bspinfo man_bspinfo)
|
||||
endif(GROFF)
|
||||
|
|
|
|||
Loading…
Reference in New Issue