Skip to content

Commit

Permalink
improve doxygen builds
Browse files Browse the repository at this point in the history
  • Loading branch information
goatshriek committed Jun 17, 2023
1 parent f3a1116 commit f3e3fdb
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,25 @@ set(LOCALE $ENV{LANG}

# documentation and doxygen setup
set(PROJECT_DOCS_DIR ${CMAKE_BINARY_DIR}/docs)
find_program(HAVE_DOXYGEN NAMES doxygen)
if(HAVE_DOXYGEN)
include(FindDoxygen QUIET)
if(DOXYGEN_FOUND)
configure_file(${PROJECT_SOURCE_DIR}/tools/doxygen/Doxyfile.in ${CMAKE_BINARY_DIR}/tools/doxygen/Doxyfile)

file(GLOB_RECURSE DOXYGEN_PUBLIC_HEADERS ${PROJECT_SOURCE_DIR}/include/stumpless/*.h)
set(EXAMPLE_SOURCES
${PROJECT_SOURCE_DIR}/docs/examples/basic/basic_example.c
)

add_custom_target(docs
COMMAND doxygen ${CMAKE_BINARY_DIR}/tools/doxygen/Doxyfile
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/tools/doxygen/Doxyfile
DEPENDS
${CMAKE_BINARY_DIR}/tools/doxygen/Doxyfile
${DOXYGEN_PUBLIC_HEADERS}
${EXAMPLE_SOURCES}
${PROJECT_SOURCE_DIR}/include/stumpless.h
${CMAKE_BINARY_DIR}/include/stumpless/config.h
BYPRODUCTS
${PROJECT_BINARY_DIR}/docs/man/man3/config.h.3
)

set(INCLUDE_MANPAGES_IN_INSTALL INSTALL_MANPAGES)
Expand Down

0 comments on commit f3e3fdb

Please sign in to comment.