[Qt-creator] Creating an "exotic" target for qt4 project
Tobias Hunger
tobias.hunger at nokia.com
Tue Mar 30 11:59:54 CEST 2010
On 30.03.2010 10:11, ext Ville M. Vainio wrote:
> (this discussion applies to qt-creator git master)
>
> I'm trying to contribute to qt creator by trying to implement a new
> "target" (in addition to "Desktop", "Maemo", "Symbian"). For the
> purposes of this excercise, let's call it "scratchbox" - it would not
> execute qmake directly, but a series of magical incantations to build
> the code in scratchbox (and in case of run settings, run it).
Sounds intersting, but ...
> [Yes, I know about madde, no need to point that out]
you know about MADDE, don't you? ;-)
> I added the target information to qt4projectmanagerconstants.h,
> qt4target.cpp and qtversionmanager.cpp.
You already did the tricky part then:-)
> So far so good; I can already see the target I created, but now I'm
> wondering how to make that target do something useful. What I'd need
> is:
>
> - Custom build / run settings pane in "projects" tab. By looking at
> the code, it would seem I would need to create a new project type
> instead of just a new target.
Build Settings/Generic is created by Qt4ProjectConfigWidget and is
project specific.
The Build/clean steps in the BuildSettings view are handled by the
buildstep's configuration widget (e.g. MakeStepConfigWidget).
The Run Settings are managed by the runconfiguration's widget (e.g.
Qt4RunConfigurationWidget)
> - Custom behavior. Am I mistaken in my idea that all I can do in Qt4
> project type is to control the qt version, which would basically
> amount to specifying qmake path? I'd like to execute completely custom
> code when this particular target ("scratchbox") is active.
You will need to implement custom buildsteps (see e.g. MakeStep in
Qt4ProjectManager). In addition you will probably need to provide a
custom runconfiguration (what is to be run?) as well as runcontrols (how
is this run?). Please be aware that the destinction between
RunConfiguration and RunControl is not as strict as we would like it to be.
I must tell you that I think that this change is a bit problematic: It
extends one of our plugins, so it is using internal interfaces which we
do change quite frequently. We are further concentrating our efforts on
MADDE, so chances are slim to get this merged. So please be prepared for
maintainance overhead! OTOH this definitely is a great project to get to
know the inner workings of the Qt4 plugin and the build infrastructure
of creator and I do not want to discourage you from doing it.
Best Regards,
Tobias
--
Tobias Hunger
Software Engineer
Nokia, Qt Development Frameworks
Nokia gate5 GmbH
Firmensitz: Invalidenstr. 117, 10115 Berlin, Germany
Registergericht: Amtsgericht Charlottenburg, Berlin: HRB 106443 B
Umsatzsteueridentifikationsnummer: DE 812 845 193
Geschäftsführer: Dr. Michael Halbherr, Karim Tähtivuori
More information about the Qt-creator-old
mailing list