Skip to content

Commit

Permalink
Merge pull request #181 from eirrgang/docs
Browse files Browse the repository at this point in the history
Update documentation build targets
  • Loading branch information
eirrgang committed Nov 12, 2018
2 parents e7826d8 + a0e5b9a commit f1fd61d
Show file tree
Hide file tree
Showing 13 changed files with 2,540 additions and 34 deletions.
48 changes: 35 additions & 13 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,45 @@
configure_file(Doxyfile.in Doxyfile)


##############################
# Python package documentation
##############################

# Dummy output which is never actually produced. Anything that depends on
# this will always be rebuilt. Ref: https://stackoverflow.com/a/32062884/5351807
add_custom_command(
OUTPUT always_rebuild
COMMAND cmake -E echo
OUTPUT always_rebuild
COMMAND cmake -E echo
)

add_custom_command(
OUTPUT
objects.inv
DEPENDS
always_rebuild
COMMAND
${PYTHON_EXECUTABLE} -m sphinx -b html ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
COMMENT
"Generating documentation with Sphinx"
VERBATIM
OUTPUT
objects.inv
DEPENDS
always_rebuild
COMMAND
${PYTHON_EXECUTABLE} -m sphinx -b html ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
COMMENT
"Generating documentation with Sphinx"
VERBATIM
)

add_custom_target(
docs
DEPENDS objects.inv
docs
DEPENDS objects.inv
)

################################
# C++ internal API documentation
################################
find_package(Doxygen)
if (DOXYGEN_FOUND)
add_custom_target(cppdocs
COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating developer documentation"
VERBATIM )
else (DOXYGEN_FOUND)
message("Doxygen need to be installed to generate the C++ documentation")
endif (DOXYGEN_FOUND)
################################

0 comments on commit f1fd61d

Please sign in to comment.