Search code examples
pathconfigdoxygenrelative-path

How can i use relative path names in Doxygen configuration


I have my doxygen in my /utils directory, and my source is in another directory in the root(/code_with_doxygen), how could i make a relative path name for that since it's in a repository that will be on different places on other computers. I can't document the whole root because i don't want the directory /code_without_doxygen build too.

the project tree looks like this:

root
    utils
    code
        code_with_doxygen
        code_without_doxygen
    documentation

right now i have the settings, but that doesn't seem to work:

FULL_PATH_NAMES        = YES
STRIP_FROM_PATH        = ../

i can't seem to figure it out with: Relative files paths in doxygen-generated documentation


Solution

  • The relative paths depend on the directory from which directory you are executing Doxygen. For example, if you have the following project tree:

    + project_root
         + documentation
             + config
                 - doxyfile
             + pictures
             + output
             - run_doxygen.bat
         + code
             + code_with_doxygen
             + code_without_doxygen
    

    In this case, all relative paths have the root in the folder "documentation" because you are running the script "run_doxygen.bat" from this folder. So you would set the INPUT tag in the "doxyfile" to

    INPUT = ./../code
    

    and the OUTPUT_DIRECTORY tag in the doxyfile to

    OUTPUT_DIRECTORY = ./output
    

    The misleading thing is that even if the doxyfile is in the subfolder "config" the paths are NOT relative to the location of the doxyfile because the paths are relative to the location from where Doxygen is called. In this case it is the folder "documentation" because this is the location of the script which is calling Doxygen.