usually the practice is not to include binaries in source control repositories, i am using mercurial, and would like to know if anyone has experience with embedding version (minor + major) in a C Binary, so that when its distributed if i use a command line argument like mybinaryApp –version, i will get a unique version, which i can control at build time.
usually the practice is not to include binaries in source control repositories, i am
Share
The way that I embed version numbers in the code is to
#define _VERSION_MAJORin a separate header file, include them in files that need the version number, and then use that macro where needed. Then, you are free to control the version number in a different source file, without having to continually modify the original file.This is the essence of what most advanced tools do.
Alternatively, if you wanted a build-specific tag, then you can use
__DATE__and__TIME__to insert build time.