Fix bug so that doxygen is not always rebuilt and has better dependencies.