Skip to content

Commit

Permalink
doc: fix doxygen build
Browse files Browse the repository at this point in the history
HTML_TARGET is undefined.  Name the target "doc".

Ensure that we depend on Doxyfile in the binary directory, not the
source directory, as it is a generated file.

Use add_custom_command() to avoid needing to re-run doxygen each time.
We create a "doxygen.txt" file which is used as a dependency stub file.
The presence of this file prevents rebuilds.
  • Loading branch information
davvid committed Jul 17, 2015
1 parent a70ffff commit f925d4c
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,19 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

find_package(Doxygen)

IF(DOXYGEN_FOUND)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
FILE(GLOB (DOCUMENTED_FILES ../lib/*.h))
add_custom_target(doc ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile # ${DOCUMENTED_FILES}
COMMENT "Generating API documentation with Doxygen" VERBATIM)
FILE(GLOB (DOCUMENTED_FILES ${CMAKE_PROJECT_DIR}/src/lib/*.h))

add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/doxygen.txt
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile >doxygen.txt
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)

add_custom_target(doc ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/doxygen.txt)
add_dependencies(doc DOCUMENTED_FILES)

ADD_CUSTOM_TARGET(${HTML_TARGET} ALL ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile)

INSTALL( DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/ DESTINATION share/doc/partio )
ENDIF(DOXYGEN_FOUND)

0 comments on commit f925d4c

Please sign in to comment.