[Qt-creator] How call a build script when building QTCreator project?

Ed Sutton ESutton at fescorp.com
Tue Mar 31 20:27:22 CEST 2009


Hi Daniel,

Thank you very much for taking the time to answer my question and explain the exact solution in detail.

> > I have a build script that increments a build number in my version
> > header file.  I want to call the script every time I build a project in
> > QTCreator.  My concern, possibly unfounded, was that QTCreator may
> > automatically regenerate any changes I may make to the Makefile.  Where
> > is the best place to put the call to the build script?
> 
> Add a custom step in Projects -> Build Settings -> Build steps. If you
> put it inbetween the "QMake" and the "Make" step, it inserts your number
> _after_ the Makefile gets regenerated by qmake, but _before_ make gets
> executed. You should never rely on the Makefile in a qmake project. It
> will be regenerated. 

That works perfectly.

>Does your project check for changes in the Makefile
> to judge wether the build number should be incremented? I don't see the
> relevance of Makefile recreation without a bit more background
> information :-).

No. I was only concerned that putting the script call in the Makefile was going to be my only option and was afraid it would be overwritten (which you confirmed it would have).  The solution you provide is perfect for me.

> If your project is not qmake-based (and you do not not plan to change
> that), have a look at the current git version of Creator which supports
> generic (== Makefile-based) projects.

That might be nice for taking advantage of the nice IDE that QTCreator provides.  So far I have found it the best IDE for developing under Linux.  The source code debugger seems to work better than any other gdb front-end I have tried so far.

Thank you for your help!

-Ed

> 
> HTH,
>    Daniel
> 
> 
> --
> Daniel Molkentin, Software Engineer,
> Nokia Qt Software, www.qtsoftware.com
> Rudower Chaussee 13, DE-12489 Berlin
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-creator




More information about the Qt-creator-old mailing list