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:
[[Category:HowTo]]<br />[[Category:Tutorial]]
[[Category:HowTo]]
[[Category:Tutorial]]


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


= Doxygen for Qt Creator =
= Doxygen for Qt Creator =
Line 14: Line 15:


# Install Qt SDK 5.0.2 from http://qt.io/download to the directory C:5.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 &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 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: &quot;C:-creator-2.7.0-src&amp;quot;
# 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.
# 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
Line 21: Line 22:
# 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):
# 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>
<code>
</code>@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
<code>


== Compile QtCreator ==
== Compile QtCreator ==
Line 27: Line 35:
# 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:-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 &quot;qmake -r&amp;quot; to generate the make files
# call "qmake -r" to generate the make files
# 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)
# 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 :(
# This can take a while depending on your PC speed, mine is slow and took over 4 hours :(


Line 35: Line 43:
# 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:.r57)
# cd to the doxygen source code folder (e.g. C:.r57)
# call &quot;qmake -r&amp;quot; to generate the make files
# call "qmake -r" to generate the make files
# 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)
# 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 ==
== 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):<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).
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:<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??)
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
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

Revision as of 08:53, 25 February 2015


[toc align_right="yes" depth="2"]

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" 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/

Special Thanks