Index: docs/CMakeLists.txt =================================================================== --- docs/CMakeLists.txt +++ docs/CMakeLists.txt @@ -1,3 +1,4 @@ +add_subdirectory(tools) if (DOXYGEN_FOUND) if (LLVM_ENABLE_DOXYGEN) Index: docs/tools/CMakeLists.txt =================================================================== --- /dev/null +++ docs/tools/CMakeLists.txt @@ -0,0 +1,58 @@ +llvm_find_program(POD2HTML NAMES pod2html) +if (HAVE_POD2HTML) + add_custom_command( + OUTPUT clang.html + DEPENDS clang.pod + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Rendering clang man page as HTML." VERBATIM + COMMAND + ${LLVM_PATH_POD2HTML} --css=${CMAKE_CURRENT_SOURCE_DIR}/manpage.css + --podpath=. + --htmlroot=. + --infile=${CMAKE_CURRENT_SOURCE_DIR}/clang.pod + --outfile=clang.html + --title=clang + ) + add_custom_target(clang-man-html ALL DEPENDS clang.html) + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/clang.html + DESTINATION share/man) + endif() +endif() + +llvm_find_program(POD2MAN NAMES pod2man) +if (HAVE_POD2MAN) + add_custom_command( + OUTPUT clang.1 + DEPENDS clang.pod + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Rendering clang man page." VERBATIM + COMMAND + ${LLVM_PATH_POD2MAN} "--release=clang ${CLANG_VERSION}" + "--center=Clang Tools Documentation" + ${CMAKE_CURRENT_SOURCE_DIR}/clang.pod > clang.1 + ) + add_custom_target(clang-man ALL DEPENDS clang.1) + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/clang.1 + DESTINATION share/man) + endif() + + llvm_find_program(GROFF NAMES groff) + if (HAVE_GROFF) + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/clang.ps + DEPENDS clang.1 + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Rendering clang man page as postscript." VERBATIM + COMMAND + ${LLVM_PATH_GROFF} -Tps -man clang.1 > clang.ps + ) + add_custom_target(clang-man-ps ALL DEPENDS clang.ps) + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/clang.ps + DESTINATION share/man) + endif() + endif() +endif() +