Skip to content

Commit

Permalink
Initial CMake scripts to build manual.html
Browse files Browse the repository at this point in the history
Add a custom target/command which uses asciidoctor to build the manual.html
from manual.adoc, just as the Automake script did.
  • Loading branch information
Matthew Mott committed Jan 1, 2021
1 parent 9359596 commit 6503a36
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
10 changes: 9 additions & 1 deletion CMakeLists.txt
Expand Up @@ -118,9 +118,17 @@ if (${GTEST_FOUND} AND ${GTEST_MAIN_FOUND})
add_subdirectory(test)
endif()

# Documentation
find_program(ASCIIDOCTOR asciidoctor)
if (ASCIIDOCTOR)
add_subdirectory(doc)
else()
message(WARNING "asciidoctor not found; documentation will not be generated")
endif()

# Install main targets
install(TARGETS darkradiant math xmlutil scenegraph wxutil
RUNTIME DESTINATION bin
RUNTIME DESTINATION bin
LIBRARY DESTINATION ${PKGLIBDIR})
install(TARGETS radiantcore script sound
LIBRARY DESTINATION ${PKGLIBDIR}/modules)
Expand Down
6 changes: 6 additions & 0 deletions doc/CMakeLists.txt
@@ -0,0 +1,6 @@
add_custom_command(OUTPUT manual.html
COMMAND ${ASCIIDOCTOR} ARGS -a stylesheet=manual.css manual.adoc
DEPENDS manual.adoc)
add_custom_target(doc ALL DEPENDS manual.html)
install(FILES manual.html
DESTINATION ${CMAKE_INSTALL_DOCDIR})

0 comments on commit 6503a36

Please sign in to comment.