|
| 1 | +Cross referencing OpenCV from other Doxygen projects {#tutorial_cross_referencing} |
| 2 | +==================================================== |
| 3 | + |
| 4 | +Cross referencing OpenCV |
| 5 | +------------------------ |
| 6 | + |
| 7 | +[Doxygen](https://www.stack.nl/~dimitri/doxygen/) is a tool to generate |
| 8 | +documentations like the OpenCV documentation you are reading right now. |
| 9 | +It is used by a variety of software projects and if you happen to use it |
| 10 | +to generate your own documentation, and you are using OpenCV inside your |
| 11 | +project, this short tutorial is for you. |
| 12 | + |
| 13 | +Imagine this warning inside your documentation code: |
| 14 | + |
| 15 | +@code |
| 16 | +/** |
| 17 | + * @warning This functions returns a cv::Mat. |
| 18 | + */ |
| 19 | +@endcode |
| 20 | + |
| 21 | +Inside your generated documentation this warning will look roughly like this: |
| 22 | + |
| 23 | +@warning This functions returns a %cv::Mat. |
| 24 | + |
| 25 | +While inside the OpenCV documentation the `%cv::Mat` is rendered as a link: |
| 26 | + |
| 27 | +@warning This functions returns a cv::Mat. |
| 28 | + |
| 29 | +To generate links to the OpenCV documentation inside your project, you only |
| 30 | +have to perform two small steps. First download the file |
| 31 | +[opencv.tag](opencv.tag) (right-click and choose "save as...") and place it |
| 32 | +somewhere in your project directory, for example as |
| 33 | +`docs/doxygen-tags/opencv.tag`. |
| 34 | + |
| 35 | +Open your Doxyfile using your favorite text editor and search for the key |
| 36 | +`TAGFILES`. Change it as follows: |
| 37 | + |
| 38 | +@code |
| 39 | +TAGFILES = ./docs/doxygen-tags/opencv.tag=http://docs.opencv.org/3.3.0 |
| 40 | +@endcode |
| 41 | + |
| 42 | +If you had other definitions already, you can append the line using a `\`: |
| 43 | + |
| 44 | +@code |
| 45 | +TAGFILES = ./docs/doxygen-tags/libstdc++.tag=https://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen \ |
| 46 | + ./docs/doxygen-tags/opencv.tag=http://docs.opencv.org/3.3.0 |
| 47 | +@endcode |
| 48 | + |
| 49 | +Doxygen can now use the information from the tag file to link to the OpenCV |
| 50 | +documentation. Rebuild your documentation right now! |
| 51 | + |
| 52 | +@note To allow others to also use a *.tag file to link to your documentation, |
| 53 | +set `GENERATE_TAGFILE = html/your_project.tag`. Your documentation will now |
| 54 | +contain a `your_project.tag` file in its root directory. |
| 55 | + |
| 56 | + |
| 57 | +References |
| 58 | +---------- |
| 59 | + |
| 60 | +- [Doxygen: Linking to external documentation](https://www.stack.nl/~dimitri/doxygen/manual/external.html) |
| 61 | +- [opencv.tag](opencv.tag) |
0 commit comments