doxygen_add_docs() should get defines and include paths from transitive target dependencies
In order to follow the new approach to writing better CMake, the documentation functions should get their initial set of #defines and include paths from the transitive target dependencies. This prevents duplication of defines and paths and captures "as-built" documentation.
add_library(bar INTERFACE)
target_include_directories(bar INTERFACE ...)
target_compile_defines(bar INTERFACE ...)
add_executable(foo <sources>)
target_compile_defines(foo ...)
target_include_directories(foo ...)
target_link_libraries(foo bar)
doxygen_add_docs(foo_docs ... TARGET foo ...) # foo & bar's values for defines and paths should come too!