Doxygen Plugin for QtCreator: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 1: Line 1:
=Doxygen for Qt Creator=
[[Category:HowTo]]<br />[[Category:Tutorial]]
 
[toc align_right=&quot;yes&amp;quot; depth=&quot;2&amp;quot;]
 
= 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).
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 <span class="caps">SDK</span> 5.0.2. The example is done for '''Windows''' so adjust paths/names for linux/Mac OS X.
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:
Lets start from the very begining:


==Pre-requsisits==
== Pre-requsisits ==


# Install Qt <span class="caps">SDK</span> 5.0.2 from http://qt.io/download to the directory C:\Qt\Qt5.0.2 (an example path)
# 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:\Qt\doxygen\trunk.rNN” (NN is the version).
# Get the source code for the QtCreator doxygen plugin from http://svn.kofee.org/listing.php?repname=QtCreator-Doxygen (click the &quot;Download&amp;quot; option to the right side of the trunk directory). Store it in the following path: &quot;C:.rNN&amp;quot; (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 <span class="caps">SDK</span> 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:\Qt\qt-creator-2.7.0-src”
# 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: &quot;C:-creator-2.7.0-src&amp;quot;
# Note: if you use different paths then you may need to modify the doxygen .pro file.
# 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 perl from http://www.activestate.com/activeperl/downloads
# Install doxygen from: http://www.stack.nl/~dimitri/doxygen/
# 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 <span class="caps">README</span> file in the qt creator source code folder):
# 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):
 
<code><br /></code></code>echo off<br />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<br />echo PATH<br />set QMAKESPEC=win32-g++<br />cd C:-creator-2.7.0-src<br />cmd<br /><code>


==Compile QtCreator==
== 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.
# 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:\Qt\qt-creator-2.7.0-src).
# 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 &quot;qmake -r&amp;quot; to generate the make files
# call “jom” to run the compile. (jom comes with <span class="caps">SDK</span> 5.0.2 is similar to nmake or mingw-make which you may also be able to use)
# call &quot;jom&amp;quot; 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 <span class="smiley">:(</span>
# This can take a while depending on your PC speed, mine is slow and took over 4 hours :(


==Compile Doxygen Plugin==
== Compile Doxygen Plugin ==


# Basically this is the same process as for Qt Creator, use the same batch file to get your build environment.
# 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:\Qt\doxygen\trunk.r57)
# cd to the doxygen source code folder (e.g. C:.r57)
# call “qmake -r” to generate the make files
# call &quot;qmake -r&amp;quot; to generate the make files
# call “jom” to run the compile. (jom comes with <span class="caps">SDK</span> 5.0.2 is similar to nmake or mingw-make which you may also be able to use)
# call &quot;jom&amp;quot; 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 <span class="caps">SDK</span> 5.0.2 QtCreator v2.7.0 with my compiled version):


# Rename your <span class="caps">SDK</span> version of QtCteator (e.g. C:\Qt\Qt5.0.2\Tools\QtCreator —&gt; C:\Qt\Qt5.0.2\Tools\QtCreator_orig)
== Putting It All Together ==
# Copy your compiled QtCreator folders “bin”, “lib” and “share” into that location (i.e. C:\Qt\qt-creator-2.7.0-src\&lt;bin,lib,share&gt; —&gt; C:\Qt\Qt5.0.2\Tools\QtCreator\&lt;bin,lib,share&gt;)
# 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:\Qt\qtcreator-doxygen\lib\qtcreator\plugins\Kofee\ —&gt; C:\Qt\Qt5.0.2\Tools\QtCreator\lib\qtcreator\plugins\Kofee\)
# Finally open the file C:\Qt\Qt5.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:\Qt\Qt5.0.2\Tools\QtCreator\bin) as normal. If you have path issues make sure that you have these paths in your <span class="caps">PATH</span> variable:
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):<br /># Rename your SDK version of QtCteator (e.g. C:5.0.2\Tools\QtCreator —&amp;gt; C:5.0.2\Tools\QtCreator_orig)<br /># Copy your compiled QtCreator folders &quot;bin&amp;quot;, &quot;lib&amp;quot; and &quot;share&amp;quot; into that location (i.e. C:-creator-2.7.0-srclt;bin,lib,share&amp;gt; —&amp;gt; C:5.0.2\Tools\QtCreatorlt;bin,lib,share&amp;gt;)<br /># Now copy your doxygen plugin (which exsist in a new folder above the doxygen source folder see the example copy path…) into the this &quot;lib&amp;quot; folder (i.e. C:-doxygen\lib\qtcreator\plugins\Kofee—&amp;gt; C:5.0.2\Tools\QtCreator\lib\qtcreator\plugins\Kofee<br /># 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).


* C:\Qt\Qt5.0.2\Tools\MinGW\bin
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:<br />* C:5.0.2\Tools\MinGW\bin<br />* C:5.0.2\Tools\QtCreator\creator\bin<br />* C:5.0.2\5.0.2\Src\qtbase (not sure you need this one??)
* C:\Qt\Qt5.0.2\Tools\QtCreator\creator\bin
* C:\Qt\Qt5.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
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
Line 51: Line 48:
For some other issues / historical details see my post on getting this to work: http://forum.qt.io/viewthread/28923/
For some other issues / historical details see my post on getting this to work: http://forum.qt.io/viewthread/28923/


==Special Thanks==
== Special Thanks ==
 
Special thanks to [http://qt.io/member/9378 koahnig] ''[qt.io]'' for providing me with all the support to get this working.
 
===Categories:===
 
* [[:Category:HowTo|HowTo]]
* [[:Category:Tutorial|Tutorial]]

Revision as of 14:29, 23 February 2015


[toc align_right="yes&quot; depth="2&quot;]

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

  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&quot; option to the right side of the trunk directory). Store it in the following path: "C:.rNN&quot; (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&quot;
  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):
<br />

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&quot; to generate the make files
  4. call "jom&quot; 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&quot; to generate the make files
  4. call "jom&quot; 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 —&gt; C:5.0.2\Tools\QtCreator_orig)
# Copy your compiled QtCreator folders "bin&quot;, "lib&quot; and "share&quot; into that location (i.e. C:-creator-2.7.0-srclt;bin,lib,share&gt; —&gt; C:5.0.2\Tools\QtCreatorlt;bin,lib,share&gt;)
# 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&quot; folder (i.e. C:-doxygen\lib\qtcreator\plugins\Kofee—&gt; 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/

Special Thanks