file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html) file(GLOB_RECURSE allDocFiles ${CMAKE_SOURCE_DIR}/*.cpp *.h *.dox) string(REGEX REPLACE "${CMAKE_BINARY_DIR}[^;]+;?" "" allDocFiles "${allDocFiles}") set(PROJECT_LOGO ${CMAKE_CURRENT_SOURCE_DIR}/logo.png) set(OUTPUT_DOC_DIR ${CMAKE_CURRENT_BINARY_DIR}/) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.cmake ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY) set(targetName "doc_${PROGRAM_NAME}") add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/doc.txt OUTPUT ${targetName} COMMENT "doxygen documentation generation for project ${PROGRAM_NAME}" COMMAND doxygen ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile DEPENDS ${allDocFiles} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) add_custom_target(${targetName} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/doc.txt) if(NOT TARGET doc) add_custom_target(doc) endif() add_dependencies(doc ${targetName}) install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION share/${PROGRAM_NAME}/doc)