Macros in comments are usually not expanded (see, for example, this answer ). This is not unique to doxygen, and I cannot think of a way to do this using the PREDEFINED configuration.
As you state in the question, you can use sed , see the third paragraph in this answer . For example, using the following
INPUT_FILTER = "sed -e 's/VERSION/1.0/'"
replaces all VERSION instances with 1.0 in all of your source files (you can specify which files to process with INPUT_FILTER , rather than process all source files). You may not want VERSION expand everywhere, so it might be better to use something like $(VERSION) and sed this token. In addition, you will need a way to get your version number from your makefile and into the doxygen configuration file. This can be done using another sed .
To access your last marker point, doxygen has a FILE_VERSION_FILTER configuration FILE_VERSION_FILTER to determine the version number of each file. Using this, you will print some version information (regardless of what is printed standardly from the command specified in FILE_VERSION_FILTER ) at the top of each page of the file. The documentation provides examples of obtaining a version number using a number of different version control systems. Also here is a page describing the use of git and doxygen to extract version information.
The only drawback of this configuration option is that I do not know how to specify where the version information of the file should be displayed in the final documentation. I suppose you can use a layout file: I suppose you can change the layout of the pages , but I never did, and I don't know how easy it would be to use this to include version information on the main page.
Chris
source share