Make C++ documentation generation an xtask

Tear it out of the CMakeLists.txt and instead run it via

    cargo xtask cppdocs

This allows the build_and_test step in the CI to only run cmake for the
library/header related bits and the docs_and_demos step to only generate
docs and not require a full host build of the library (as cargo xtask
cmake would otherwise do).
This commit is contained in:
Simon Hausmann 2020-09-01 16:40:48 +02:00 committed by Simon Hausmann
parent 704644c752
commit 65ff715fbc
6 changed files with 152 additions and 46 deletions

View file

@ -81,21 +81,3 @@ install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/SixtyFPS/SixtyFPSConfigVersion.cmake"
DESTINATION lib/cmake/SixtyFPS
)
find_package(Doxygen)
find_program(PipEnv pipenv)
if (DOXYGEN_FOUND)
if (PipEnv)
configure_file(../docs/conf.py.in docs/conf.py)
file(CREATE_LINK ${CMAKE_CURRENT_SOURCE_DIR}/../docs/index.rst ${CMAKE_CURRENT_BINARY_DIR}/docs/index.rst SYMBOLIC)
file(CREATE_LINK ${CMAKE_CURRENT_SOURCE_DIR}/../README.md ${CMAKE_CURRENT_BINARY_DIR}/docs/README.md SYMBOLIC)
get_filename_component(markdown_docs_source ../../../docs ABSOLUTE)
file(CREATE_LINK ${markdown_docs_source} ${CMAKE_CURRENT_BINARY_DIR}/docs/markdown SYMBOLIC)
execute_process(COMMAND ${CMAKE_COMMAND} -E env PIPENV_PIPFILE=${CMAKE_CURRENT_SOURCE_DIR}/../docs/Pipfile ${PipEnv} install)
add_custom_target(docs ALL COMMAND ${CMAKE_COMMAND} -E env PIPENV_PIPFILE=${CMAKE_CURRENT_SOURCE_DIR}/../docs/Pipfile ${PipEnv} run sphinx-build ./docs ./docs/html)
else()
message("Pipenv not found, not building documentation")
endif()
else()
message("Doxygen not found, not building documentation")
endif()