find_package(Doxygen)
if(DOXYGEN_FOUND)
  message("Generating doxygen configuration")
  configure_file(Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)

  # note the option ALL which allows to build the docs together with the application
  add_custom_target(docs
    COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile
    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
endif()
