4

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?

foraidt
  • 5,519
  • 5
  • 52
  • 80
  • I've had the exact same problem having VS2008 call a Perl script that automatically generates C# code. My impression (possibly wrong) is that despite that step, it compiles the version of the code in memory instead of the version on the disk, and then notices the version in memory is out of date. – Sol Oct 20 '08 at 14:30
  • Hope someone knows how to fix it! – Sol Oct 20 '08 at 14:32
  • You've added a generated file as a source file. You need to do it the other way round. – Roger Lipscombe Oct 20 '08 at 15:47

1 Answers1

3

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
  • 89,048
  • 55
  • 235
  • 380
  • 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.
    – foraidt Oct 20 '08 at 16:49