1

I have a (large, old) fortran project for fluid simulations. It can create two executables, for compressible and incompressible flow respectively. Consequently, there are many routines that are named exactly the same between the two. When Doxygen creates the source code browser, it will only link to one of these same-named subroutines. So there's a 50/50 chance that it will link to the wrong subroutine.

Simplified Example:

This is the directory structure of the project currently:

  |-Project
  |  |-common
  |  |  |-main.f
  |  |-compressible
  |  |  |-solver.f
  |  |-incompressible
  |  |  |-solver.f
  |-CMakeFiles

main.f:

program main
    call solve()
end

incompressible/solver.f/compressible/solver.f:

subroutine solve()
...
    call support_function()
... [call other subroutines exclusively in its directory or in '../common']
end

subroutine support_function()
...
end

CMake builds the software and will hide directories depending on what executable needs to be created. For example, if the incompressible executable needs to be created, CMake will ignore the compressible directory.

What Doxygen currently does:

If I'm looking at the source code for either solver.f and click on a link to go to support_function, it will go to incompressible/solver.f-->support_function, regardless of which directory it's in.

Similarly, f I'm looking at the source code for main.f and click on a link to go to solve(), it will go to incompressible/solver.f-->solve(). Ideally, it would give an option as to which one it wanted to go to.

Question/What I want to happen

Is there a way to make Doxygen link to the correct set of subroutines based on which directory the source code is in? Maybe something similar to what CMake does (ignoring specific directories when compiling a specific directory)?

Another thing that would be nice (but probably more difficult if not already implemented) would be when clicking a link to solve() while in main.f, have it go to a page that gives an option for whether it should go to incompressible/solver.f-->solve() or compressible/solver.f-->solve()

James Wright
  • 1,293
  • 2
  • 16
  • 32
  • 1
    I think you need a doxygen configuration file (e.g. `Doxyfile.in`) that is used in the cmake step to set the right `INPUT` and `OUTPUT_DIRECTORY` for either compressible / in-compressible, so you have separate documentation for the both versions. – albert Feb 01 '20 at 10:34
  • @albert So essentially having two separate doxygen systems systems? Or is there a way to combine them? Would running doxygen twice (once for incompressible, once for compressible) into the same output directory do this? – James Wright Feb 01 '20 at 15:52
  • No running into the same directory would lead to problems (e.g. in respect to index.html, treeview etc etc.). – albert Feb 01 '20 at 16:25
  • Maybe I can do something with tag files? Basically treat `incompressible` and `compressible` as two "external" libraries? Strictly speaking, the cmake creates a `libcompressible` and `libincompressible` and then links it with the `libcommon`. Referencing: http://www.doxygen.nl/manual/external.html – James Wright Feb 04 '20 at 19:58
  • Tag files are a possibility, though I think one should make a tag file from the libcommon and use this when making the documentation for the compressible / incompressible libraries / program. – albert Feb 05 '20 at 09:12

0 Answers0