Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

QtHelper plugin

(1/4) > >>

critic:
I created a little plugin that helps me to build Qt projects as clean C++ projects in CodeBlocks IDE. Natively CodeBlocks doesn't support Qt projects - user must generate makefile with qmake manually and list of files and settings can't be automaticaly extracted from IDE.
This became possible because C::B:

* allows read all available data of project, it's targets, it's compiler and etc
* allows save data to xml-like C::B project file
* allows using custom makefile
* allows change "make" command line
* allows add settings pane to environment settings dialog
* allows add settings pane to project settings dialog
* allows create scripted wizards to start project with appropriate configuration
Now I only want to discuss my ideas with community about how to make it better and share sources using this forum
In future if some people support me this plugin can become popular

Plugin's sources for today are attached to this message (qthelper.zip).
It better to use it with scripted wizard, that also attached (scripted_wizard.zip).

For newer versions see other messages of the topic.

To add these project types:

* copy these folders to directory <C::B folser>/share/CodeBlocks/templates/wizard/
* add 2 lines to function RegisterWizards() in file <C::B folser>/share/CodeBlocks/templates/wizard/config.script

* RegisterWizard(wizProject,     _T("qt4"),          _T("QT4 static project"),           _T("GUI"));
* RegisterWizard(wizProject,     _T("qt4dll"),       _T("QT4 dll project"),    _T("GUI"));
This plugin works great when you don't need specific features of QT project file, because it extracts the following data from C::B project file:

* headers
* paths to them - include paths
* sources
* libs
* paths to them
* compiler options - flags
* linker options - flags
* output directory
* object files directory
* output file name
* and etc
It works like QtWorkbench, but not at all.
It saves additional data (some config that can't be extracted from C::B project file) to C::B project file for further use.
And qmake's pro-file is only intermediate file as well as moc's, uic's and rcc's files.
Qt's intermediate files are stored in objects directory (in subfolders of the same name)

Now project is moved to http://code.google.com/p/qthelper/, i.e. all latest sources and binaries can be found there.

[attachment deleted by admin]

critic:
Additional information: this plugin allows to build debug target of project using release versions of libraries (Qt libs, for example).

But in latest nightlies C::B developers closed access to project build settings for projects that use custom makefile.
That's why usage of plugin became complex.
I need some ideas about how to improve functionality of plugin.

cb_gotcha:
tried to compile qthelper and installed CB source and wxwidget source. I a final error that reads "ld.exe    cannot find -lcodeblocks". Should there be a static library codeblocks? all I can find is codeblocks.dll in the main dir but I can't find how to link that properly. Also I see only that a dll is build, so how is a cbplugin generated?
thanks

critic:
I build plugin on Windows XP using the following:

* wxWidgets 2.8.7
* mingw 3.4.5
* Codeblocks sources (from SVN. note! get only revisions that goes as nightly build releases (nightly builds forum))
To build wxWidgets library on Windows I used batch-file. It's contents:

set PATH=%PATH%;d:\bin\dev\compile\mingw3\bin;d:\bin\dev\compile\mingw3\include;d:\bin\dev\compile\mingw3\lib
cd build\msw
mingw32-make.exe -f makefile.gcc UNICODE=1 BUILD=release SHARED=1 MONOLITHIC=1 VENDOR=cb
pause

It must be placed in root directory of wxWidgets and paths to mingw must be yours.

After building wxWidgets open QtHelper project in CodeBlocks IDE (you must create global variable 'wx' in C::B (Settings -> Global Variables):

* bin: <your wxWidgets root directory>
* include: $(#wx)/include
* lib: $(#wx)/devel) and build plugin

Note! To create .cbplugin file you need zip.exe in your PATH environment variable (in system or in C::B). For more information see post-build steps in plugin project

That's all.

I will attach soon new sources of plugin that are make it possible configure includes, lib paths, libs and other in Qt project without movements described in first post

critic:
Sorry!  :oops:
In global variable 'wx' lib section must be '$(#wx)/lib'.

In addition you must create 'cb' global variable:

* base: <your C::B sources root directory (where located 'include' dir)>
* include: $(#CB)/include
* lib: $(#CB)/devel
About building of C::B library:
if build is successful in output directory must be at least 2 files:

* codeblocks.dll
* libcodeblocks.dll.a
Good luck!  :)

Navigation

[0] Message Index

[#] Next page

Go to full version