Qt wiki will be updated on October 12th 2023 starting at 11:30 AM (EEST) and the maintenance will last around 2-3 hours. During the maintenance the site will be unavailable.

Doxygen Plugin for QtCreator

From Qt Wiki
Jump to navigation Jump to search

En Ar Bg De El Es Fa Fi Fr Hi Hu It Ja Kn Ko Ms Nl Pl Pt Ru Sq Th Tr Uk Zh

To get doxygen working with QtCreator you will need to compile QtCreator and then compile the QtCreator doxygen plugin (it requires the compiled QtCreator + sources).

This wiki is aimed to give all the instructions you need to do this process successfully with an example of getting the doxygen plugin to work with Qt SDK 5.0.2. The example is done for Windows so adjust paths/names for Linux/Mac OS X.

Lets start from the very beginning:

Pre-requisites

  1. Install Qt SDK 5.0.2 from http://qt.io/download to the directory C:5.0.2 (an example path)
  2. Get the source code for the QtCreator doxygen plugin from http://svn.kofee.org/listing.php?repname=QtCreator-Doxygen (click the "Download" option to the right side of the trunk directory). Store it in the following path: "C:.rNN" (NN is the version).
  3. Get the source code for Qt Creator that you want to add the plugin to from here http://download.qt.io/official_releases/qtcreator/. Note I used SDK 5.0.2 so that uses Qt Creator 2.7.0 (http://download.qt.io/official_releases/qtcreator/2.7/2.7.0/). Unzip it to the following path: "C:-creator-2.7.0-src"
  4. Note: if you use different paths then you may need to modify the doxygen .pro file.
  5. Install perl from http://www.activestate.com/activeperl/downloads
  6. Install doxygen from: http://www.stack.nl/~dimitri/doxygen/
  7. Create a command prompt that gives you the correct environment to build QtCreator and doxygen. I did this by making a batch file as follows (note most of this info can be found in the README file in the qt creator source code folder):


@echo off
set PATH=C:32;C:;C:32\Wbem;C:.0\bin;C:;C:;C:5.0.2\5.0.2\mingw47_32\bin;C:5.0.2\Tools\MinGW\bin;C:5.0.2\Tools
\QtCreator\creator\bin;C:5.0.2\5.0.2\Src\qtbase;PATH
echo PATH
set QMAKESPEC=win32-g++
cd C:-creator-2.7.0-src
cmd

Compile QtCreator

  1. Run the batch (or sh) file to create your build environment. This should give you enough paths to run everything, but if you get errors saying a command cannot be found then adjust the paths to reflect that.
  2. cd to the Qt Creator source folder that you created earlier (e.g. C:-creator-2.7.0-src).
  3. call "qmake -r" to generate the make files
  4. call "jom" to run the compile. (jom comes with SDK 5.0.2 is similar to nmake or mingw-make which you may also be able to use)
  5. This can take a while depending on your PC speed, mine is slow and took over 4 hours :(

Compile Doxygen Plugin

  1. Basically this is the same process as for Qt Creator, use the same batch file to get your build environment.
  2. cd to the doxygen source code folder (e.g. C:.r57)
  3. call "qmake -r" to generate the make files
  4. call "jom" to run the compile. (jom comes with SDK 5.0.2 is similar to nmake or mingw-make which you may also be able to use)

Putting It All Together

Now you have a doxgen plugin that works with your compiled version of Qt Creator so we need to put them all together. Here are some steps to achieve that (though you can do it how you want, I replaced my SDK 5.0.2 QtCreator v2.7.0 with my compiled version):

  1. Rename your SDK version of QtCteator (e.g. C:5.0.2\Tools\QtCreator —> C:5.0.2\Tools\QtCreator_orig)
  2. Copy your compiled QtCreator folders "bin", "lib" and "share" into that location (i.e. C:-creator-2.7.0-srclt;bin,lib,share> —> C:5.0.2\Tools\QtCreatorlt;bin,lib,share>)
  3. Now copy your doxygen plugin (which exsist in a new folder above the doxygen source folder see the example copy path…) into the this "lib" folder (i.e. C:-doxygen\lib\qtcreator\plugins\Kofee—> C:5.0.2\Tools\QtCreator\lib\qtcreator\plugins\Kofee
  4. Finally open the file C:5.0.2\Tools\QtCreator\lib\qtcreator\plugins\Kofee\Doxygen.pluginspec and check the versions all match your compiled version of QtCreator, they should).

Now run QtCreator (under C:5.0.2\Tools\QtCreator\bin) as normal. If you have path issues make sure that you have these paths in your PATH variable:

  • C:5.0.2\Tools\MinGW\bin
  • C:5.0.2\Tools\QtCreator\creator\bin
  • C:5.0.2\5.0.2\Src\qtbase (not sure you need this one??)

To use the doxygen plug see instructions from this site (also has pre-compiled versions of doxygen plugin for QtCreator v2.4.0): http://dev.kofee.org/projects/qtcreator-doxygen/wiki

For some other issues / historical details see my post on getting this to work: http://forum.qt.io/viewthread/28923/