[Qt-creator] How to put custom build steps into Git?

Tobias Hunger tobias.hunger at gmail.com
Fri Jul 6 07:39:07 CEST 2018

Hi Sean,

On Thu, Jul 5, 2018, 20:47 Murphy, Sean <smurphy at walbro.com> wrote:

> For our project, we've got two build customizations that we do, that we'd
> like to be able to put into source control, so that all developers
> automatically get them. But it appears that adding those steps via Qt
> Creator causes that information to get stored locally in the .pro.user
> file, which appears to have user-specific file paths in it, thereby making
> it a file that I don't think should ever get checked into source control?

Yes, that is correct.

My idea still is to make creator look in the source directory for a
"project setup wizard" and run that when a project is first opened. That
would be the most powerful solution to your problem I can think of and
would allow fully automatic setup as well as a UI to get I put from the

Alas that has been on my agenda for a long time now.

So what's the right way to handle this sort of stuff?

Ideally everything extra should be part of the build system itself so that
the "normal" sequence of commands is enough.

That makes things simple for the IDE but also for developers that chose not
to use Creator.

PS - my question is really more intended in the general sense but the two
> specific things we're trying to put in there are:
>  - under the Build Settings->Build Steps->Make->Make arguments we want to
> add the "-j" flag to speed up compilation

I make sure MAKEFLAGS is set to "-j8" in the project environment.

I do that via the global system environment that is set before creator is
started, but you could also set this up as part of the kits you use inside

 - I've written a custom application that runs as a pre-build step. This
> application updates a header file with the current Git hash information so
> that that info get compiled into the application in the About dialog. This
> way, when users report an issue, I know which commit to start from. This
> application is located in a path that has a fixed RELATIVE path to the .pro
> file for the main project, but we need it automatically included as part of
> the build process when a user clones into this repository and opens the
> .pro file that the pre-build step is known and executed.

That is something that should be done by the build system IMHO. Have that
take a app_version.h.in and use your program to generate app_version.h from
that. Now add a bit hook or something that touches the .in file on git

I have not tested that, but that is how I would try to address that problem.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20180706/b957ec3d/attachment.html>

More information about the Qt-creator mailing list