Auto build increment with C++?
-
In the past I've worked on large teams and the build system we had in place would auto-increment the build number. At the moment I'm working on my own shareware project (written in C++, using VS2005) and I'd like to have Visual Studio auto-increment the build number for me (bonus points if it only increments the release version). I started to do some digging and I've read that Visual Studio has this feature with .NET projects, but I haven't read anywhere about this being available in C++ projects, so my questions are: * Does this exist for C++ project? * If so, what are the steps needed? * If not, are there any suggested tools or add-ins? What do some of the developers here use? Thanks, Jeff
-
In the past I've worked on large teams and the build system we had in place would auto-increment the build number. At the moment I'm working on my own shareware project (written in C++, using VS2005) and I'd like to have Visual Studio auto-increment the build number for me (bonus points if it only increments the release version). I started to do some digging and I've read that Visual Studio has this feature with .NET projects, but I haven't read anywhere about this being available in C++ projects, so my questions are: * Does this exist for C++ project? * If so, what are the steps needed? * If not, are there any suggested tools or add-ins? What do some of the developers here use? Thanks, Jeff
If you don't insist on an "index" of builds you could use the __DATE__ and __TIME__ macros which give you the build date-time combined with some pre or maybe post build step that deletes the OBJ file or maybe updates the file time to make sure the file you put the creation of a build number into will get built every time (you can make the post or pre build step only in your release target if that suits you).
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <
-
In the past I've worked on large teams and the build system we had in place would auto-increment the build number. At the moment I'm working on my own shareware project (written in C++, using VS2005) and I'd like to have Visual Studio auto-increment the build number for me (bonus points if it only increments the release version). I started to do some digging and I've read that Visual Studio has this feature with .NET projects, but I haven't read anywhere about this being available in C++ projects, so my questions are: * Does this exist for C++ project? * If so, what are the steps needed? * If not, are there any suggested tools or add-ins? What do some of the developers here use? Thanks, Jeff
-
Codeproject has implemented a search feature which is useful in most situations. Have a look: http://www.codeproject.com/info/search.aspx?artkw=build+increment[^] Best Wishes, -David Delaune
Yes, I already had searched but when I found lots of articles where a macro was written, I noticed that each article had lots comments about bugs, and instead of weeding through the umpteen articles I decided to post my question here to this forum. So, back to original question, what do people here use? (if you use one of the macros from one of the articles then please recommend it) And does Visual Studio have an auto-increment feature available to C++ like managed projects do? Thanks, Jeff
-
If you don't insist on an "index" of builds you could use the __DATE__ and __TIME__ macros which give you the build date-time combined with some pre or maybe post build step that deletes the OBJ file or maybe updates the file time to make sure the file you put the creation of a build number into will get built every time (you can make the post or pre build step only in your release target if that suits you).
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <
-
Yes, I already had searched but when I found lots of articles where a macro was written, I noticed that each article had lots comments about bugs, and instead of weeding through the umpteen articles I decided to post my question here to this forum. So, back to original question, what do people here use? (if you use one of the macros from one of the articles then please recommend it) And does Visual Studio have an auto-increment feature available to C++ like managed projects do? Thanks, Jeff
jeffb42 wrote:
(if you use one of the macros from one of the articles then please recommend it)
Nah, I am old fashion and I manually change my build numbers.
jeffb42 wrote:
And does Visual Studio have an auto-increment feature available to C++ like managed projects do?
No, unfortunately Visual Studio C++ users do not get those überlegen modern features. This Microsoft Help and Support article has a sample build increment, I have never tried it. How to increment version information after each build in Visual C++[^] Good Luck, -David Delaune
-
In the past I've worked on large teams and the build system we had in place would auto-increment the build number. At the moment I'm working on my own shareware project (written in C++, using VS2005) and I'd like to have Visual Studio auto-increment the build number for me (bonus points if it only increments the release version). I started to do some digging and I've read that Visual Studio has this feature with .NET projects, but I haven't read anywhere about this being available in C++ projects, so my questions are: * Does this exist for C++ project? * If so, what are the steps needed? * If not, are there any suggested tools or add-ins? What do some of the developers here use? Thanks, Jeff
jeffb42 wrote:
* If not, are there any suggested tools or add-ins?
See here.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons