# configure Doxyfiles; define targets doxy and doxy${section}

find_package(Doxygen REQUIRED dot)
set(AUTO_DOX_DIR ${CMAKE_BINARY_DIR}/doxygen)
file(MAKE_DIRECTORY ${AUTO_DOX_DIR})
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/html)
add_custom_target(doxy) # this target builds _all_ documentation sections
foreach(section core gui all)
    configure_file(${section}/Doxyfile.in
        ${AUTO_DOX_DIR}/Doxyfile.${section} @ONLY)
    add_custom_target(doxy${section}
        COMMAND Doxygen::doxygen ${AUTO_DOX_DIR}/Doxyfile.${section} )
    add_dependencies(doxy doxy${section})
endforeach()
