如何交叉引用已有的 doxygen 文档?
我有两个C++项目A和B;依赖关系只是 B 到 A。
B --> A
我想分别在 A 和 B 上运行 Doxygen,但仍然让我可以从 B 文档对 A 进行交叉引用。 (也就是说,当我浏览B文档时,如果B中使用了A中的任何类,我可以直接链接到A文档)。
--
[回复0x4b的答案:] 如果我将“CREATE_SUBDIRS”设置为 YES 并使用标记文件的相对路径,Doxygen 会以某种方式做出错误的链接引用。
我确实遵循了这个例子。
<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
html/
和 html/d1/d2
下的文档希望尝试链接位于 ../../ext1/html
中的外部文档>。显然其中之一会失败。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能想使用标记文件功能。当您生成 A 的文档时,请确保设置了 GENERATE_TAGFILE 选项。当您生成 B 的文档时,设置 TAGFILES 的值以包含 A 的结果。
[更新以解决相对路径]
Doxygen 在涉及 [相对] 路径时相当脆弱。你清楚地知道使用绝对路径就能解决问题。您可以尝试从环境中获取值,例如使用
创建绝对路径。这并不理想,但 Doxyfile 中的许多值取决于 doxygen 的运行位置,而不是配置文件所在的位置。
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
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.