function(doxygen_addTarget)
    find_package(Doxygen)
    if (DOXYGEN_FOUND)
        set(DOXYGEN_OUTPUT_DIRECTORY            ${CMAKE_BINARY_DIR}/docs)
        set(DOXYGEN_GENERATE_LATEX              NO)
        set(DOXYGEN_EXTRACT_PRIVATE             YES)
        set(DOXYGEN_EXTRACT_PACKAGE             YES)
        set(DOXYGEN_EXTRACT_STATIC              YES)
        set(DOXYGEN_WARN_NO_PARAMDOC            YES)
        set(DOXYGEN_HTML_OUTPUT                 .)
        set(DOXYGEN_USE_MDFILE_AS_MAINPAGE      README.md)
        set(DOXYGEN_FILE_PATTERNS               *.c *.cc *.cxx *.cpp *.c++ *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp *.h++ *.inc README.md)
        set(DOXYGEN_WARN_LOGFILE                ${DOXYGEN_OUTPUT_DIRECTORY}/doxygen.warn)

        doxygen_add_docs(doxygen ${ARGN} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
    endif ()
endfunction()
