Doxygen Plugin for QtCreator
This article may require cleanup to meet the Qt Wiki's quality standards. Reason: Auto-imported from ExpressionEngine. Please improve this article if you can. Remove the {{cleanup}} tag and add this page to Updated pages list after it's clean. |
Doxygen for Qt Creator
To get doxygen working with Qt Creator you will need to compile Qt Creator and then compile the Qt Creator 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 begining:
Pre-requsisits
- Install Qt SDK 5.0.2 from http://qt.io/download to the directory C:5.0.2 (an example path)
- 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).
- 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"
- Note: if you use different paths then you may need to modify the doxygen .pro file.
- Install perl from http://www.activestate.com/activeperl/downloads
- Install doxygen from: http://www.stack.nl/~dimitri/doxygen/
- 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
- 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.
- cd to the Qt Creator source folder that you created earlier (e.g. C:-creator-2.7.0-src).
- call "qmake -r" to generate the make files
- 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)
- This can take a while depending on your PC speed, mine is slow and took over 4 hours :(
Compile Doxygen Plugin
- Basically this is the same process as for Qt Creator, use the same batch file to get your build environment.
- cd to the doxygen source code folder (e.g. C:.r57)
- call "qmake -r" to generate the make files
- 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):
- Rename your SDK version of QtCteator (e.g. C:5.0.2\Tools\QtCreator —> C:5.0.2\Tools\QtCreator_orig)
- 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>)
- 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
- 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/