33

I have a directory in which all source and header files are saved. I would like to run Doxygen to generate documentation for these source code. However, I do not want to change anything in this directory (in particular I cannot add sub directories in which Doxygen documentation will be saved).

How can I achieve what I need?

I think I need to do the following: - I create and go to the 'documentation' directory. - In this directory I execute doxygen -g to create a template configuration file named "Doxyfile". - Then, I think, I need to modify the Doxyfile to indicate that the source code is not in the current directory.

By the way, will the output be automatically (by default) saved in the directory in which Doxygen is executed?

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
Roman
  • 124,451
  • 167
  • 349
  • 456

2 Answers2

48

I found the answer already. The procedure is as follows:

  1. Execute doxygen -g. Doxyfile will be generated.
  2. Open Doxyfile and find INPUT =
  3. After the 'INPUT =' put the name of the directory where the source code is located.
  4. Execute in the command line doxygen Doxyfile.
  5. The output will be put into the directory where doxygen was executed.
Roman
  • 124,451
  • 167
  • 349
  • 456
  • 1
    My folder has 100s of subfolders because of which it fails to generate documentation.It works if I give individual projects do i need to do so manually or it has something to add root folder. – sam Dec 06 '18 at 14:15
3

Besides the INPUT = <src folder> I'd also recommend changing the following in the config file:

RECURSIVE = YES

as discussed in this topic: Doxygen does not find files when specifying Source directory

This will find sources in subfolders of the specified input folder, which was the problem for me.

AnyGuy
  • 71
  • 1
  • 5