Best way to set up version information?
-
I'm writing an editor program that is going to be able to write files. When I save my file, I would like to include a bit of information indicating the current version of my editor, as well as the build timestamp. While I could put this information in a #define in a header file, it seems to me this would be easy to overlook. Is there some other way to do this? Perhaps have the build process generate a header or resource file that contained my version and build info?
-
@kitfox said in Best way to set up version information?:
I'm writing an editor program that is going to be able to write files. When I save my file, I would like to include a bit of information indicating the current version of my editor, as well as the build timestamp. While I could put this information in a #define in a header file, it seems to me this would be easy to overlook. Is there some other way to do this? Perhaps have the build process generate a header or resource file that contained my version and build info?
DATE and TIME?
-
__DATE__
and__TIME__
will produce different binaries when compiling the same code, so it's best to avoid them. Also, I'd like amajor.minor.commit_number
version format, or something similar. It would be best if the build process could somehow generate the files I need before the compile starts. -
Hi,
You can use the
QMAKE_SUBSTITUTES
variable and pass it a list of template files (for example version.h.in) and in this file you can use all the variables you define in your .pro file. The output file will be generated in your build folder.