1

I have a git repository for my project, and I'd like to add a Doxyfile in the repo so that anyone working on the project can create a directory on their computer and simply run doxygen /path/to/the/repo/Doxyfile from there to fill it with the project's documentation.

I've been looking at https://www.doxygen.nl/manual/config.html for a while, but I just can't find how to fill the INPUT field to tell doxygen where the files are.

  • I can't use absolute paths since I don't know where people will clone the repo on their machine
  • I can't use relative paths since they are relative to where the command is run and I don't know where people want to put their documentation

How do I express paths relative to the Doxyfile (or maybe to the repo's location since that's the next best thing)?

Eternal
  • 2,648
  • 2
  • 15
  • 21
  • Which version of doxygen? – albert Nov 26 '20 at 18:02
  • @albert I'm using version 1.8.17, but if the answer requires upgrading to a newer version, getting my team to install it would not be an issue – Eternal Nov 26 '20 at 18:07
  • It is just top get a complete picture, upgrading is not necessary for this problem though upgrading to the current version (1.8.20) is in a lot of cases beneficial. – albert Nov 26 '20 at 18:10

2 Answers2

1

Doxygen has the possibility to use environment variables in the configuration file, you could use these in a.o. the INPUT possibility. This environment variable can be set by means of en environment variable or when using e.g. CMake you can set this in the generation phase. Another way is, for CMake, to use placeholders like @...@ in your default configuration file and during the CMake generation phase substitute these by the path for CMake generation.

albert
  • 8,285
  • 3
  • 19
  • 32
1

If there is no built-in solution for my problem, so far I've come up with this.

In the Doxyfile:

INPUT = $(DOXYFILE_DIR)/relative/path

In a generate_doxygen.sh file beside it:

#!/bin/bash
DOXYFILE_DIR=`dirname $0`
export DOXYFILE_DIR
doxygen $DOXYFILE_DIR/Doxyfile

(But I assume there's a built-in way to do it without an extra file and I've just missed it, since it's such a basic feature while it's the first time I'm creating a Doxyfile...)

Eternal
  • 2,648
  • 2
  • 15
  • 21