0

Basically what I need in my project is a number of some sort that iterates itself every time I build my project, and that I can output by my program.

So for example, when generating audio, I need to add metadata that states that this audio file was generated by build #1551. After I build again, that number should go to #1552.

What is the proper way to do this in Qt?

1
  • 3
    Unless you have a way to track build numbers back to the version of the source code used for the build this is rather useless, no? Instead of a build number you'd better use e.g. the git commit SHA. Anyway Qt doesn't have much to do with this, you need to setup your build system to, for example, create a header file containing the unique number before compilation starts. Commented Dec 1, 2016 at 8:53

1 Answer 1

4

Proper way is:

  • Have (any possible) Version Control in your project (and forever for all projects)
  • Instead of rather useless autoincremented counter use any id, provided by VCS of choice
  • Get this id and output it (Mercurial sample, another SCMs just use another commands in $$system call)as any other variable

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.