rnd_nr_gen
rnd_nr_gen

Reputation: 2281

How to cross-reference already existing doxygen docs?

I have two C++ projects A and B; The dependency is only B to A.

B  --> A

I would like to separately run Doxygen on A and B respectively but still let me possible cross reference on A from B doc. (That is, when I browse B doc, I can directly link to the A doc if there is any Class from A used in B).

--

[Replied the answer from 0x4b:] if I set "CREATE_SUBDIRS" with YES and use relative path for tag files, Doxygen will somehow make wrong linking reference.

I did follow the example.

 <root>
    +- proj
    |   +- html               HTML output directory for proj   
    |       +- d1
    |       |   +- d2
    |       |       .... (*.html)
    |       | 
    |         ...(*.html)
    |   +- src                sources for proj
    +- ext1
    |   +- html               HTML output directory for ext1
    |   |- ext1.tag           tag file for ext1
    |- proj.cfg               doxygen configuration file for proj
    |- ext1.cfg               doxygen configuration file for ext1

proj.cfg:
OUTPUT_DIRECTORY  = proj
INPUT             = proj/src
TAGFILES          = ext1/ext1.tag=../../ext1/html

ext1.cfg:
OUTPUT_DIRECTORY  = ext1
GENERATE_TAGFILE  = ext1/ext1.tag 

The documents under both html/ and html/d1/d2 would like to try linking external doc located in ../../ext1/html. Apparently one of them will fail.

Upvotes: 4

Views: 3705

Answers (1)

Kirk Kelsey
Kirk Kelsey

Reputation: 4544

You probably want to use the tagfile feature. When you generate the documentation for A, make sure the GENERATE_TAGFILE option is set. When you generate the documentation for B, set the value of TAGFILES to include the result from A.

[Update to address relative paths]

Doxygen is fairly fragile when it comes to [relative] paths. You clearly understand that using an absolute path will solve the problem. You could try taking a value from the environment, e.g. using

TAGFILES          = ext1/ext1.tag=$(PWD)/../ext1/html

to create an absolute path. It's not ideal, but a lot of the values in the Doxyfile depend on where doxygen is run, and not where the configuration file lives.

Upvotes: 5

Related Questions