diff options
author | Matt Ranostay <matt.ranostay@konsulko.com> | 2019-08-14 17:28:51 -0700 |
---|---|---|
committer | Matt Ranostay <matt.ranostay@konsulko.com> | 2019-08-15 19:30:28 -0700 |
commit | 73aaa91ceac51a96973965827ebc2fbb23d6c234 (patch) | |
tree | a5cc545beb9268df7cacc50a087b6c7277cbaa84 /docs/CMakeLists.txt | |
parent | 4617d8b63620de9729a07c5d17e8b3113fbb58a3 (diff) |
docs: add docs target for generating doxygen output
Bug-AGL: SPEC-2737
Change-Id: I96d1f68aab63b29889d44b72dc45596ff104a96a
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'docs/CMakeLists.txt')
-rw-r--r-- | docs/CMakeLists.txt | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt new file mode 100644 index 0000000..2346aff --- /dev/null +++ b/docs/CMakeLists.txt @@ -0,0 +1,22 @@ +# add a target to generate API documentation with Doxygen +find_package(Doxygen) +option(BUILD_DOCUMENTATION "Create and install the HTML based API documentation (requires Doxygen)" ${DOXYGEN_FOUND}) + +if(BUILD_DOCUMENTATION) + if(NOT DOXYGEN_FOUND) + message(FATAL_ERROR "Doxygen is needed to build the documentation.") + endif() + + set(doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in) + set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) + + configure_file(${doxyfile_in} ${doxyfile} @ONLY) + + add_custom_target(docs + COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Generating API documentation with Doxygen" + VERBATIM) + + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION share/doc) +endif() |