views:

1160

answers:

3

I am generating doxygen documentation for my (fairly small) project on each build. I did the following to accomplish this:

  1. Added the index.html, which doxygen generates, to the project
  2. Specified a Custom Build Step for this file (not the whole project)
    • Command line: doxygen ../doc/Doxyfile
    • Outputs: ..doc/html/index.html
    • Additional Dependencies: '../bin/foo.exe'

The problem with this is, that I need to build twice until VS stops telling me that my project is out of date.
How can I fix this?

+1  A: 

You've added a generated file as a source file. You need to do it the other way round.

Roger Lipscombe
A: 

Thanks for your answer Roger but I'm afraid I don't know what you mean.
I have now removed the index.html from the project, added the Doxyfile instead (which actually makes more sense!) and applied the Custom Build Step settings to that file instead. The result is that doxygen does not get called at all...

Update

I just noticed that when rebuilding the solution doxygen actually gets called. While this is not exactly what I wanted, it will probably do the trick.

mxp
+2  A: 

When working out whether to build anything, Visual Studio looks to see if the output file is older than the input file.

You added index.html as an input file, when it's actually an output file. Adding Doxyfile won't work either, because it won't change that often. This is why rebuilding the project works (because it ignores the age of the files and does the build anyway).

It's changes in the C++ files that you want to catch. If (as I suspect) doxygen does incremental builds anyway, you'd be better off simply adding the doxygen step as a Post-build event.

Roger Lipscombe