LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CVI2012 svn revision retrieval inside source code (SubWCRev.exe called as a custom build action)

At every build, we want to retrieve the SVN revision number of the project and use it inside the software (which will save it to a database).

Meaning that before building the .exe target, we want to call an external .exe which will update a variable inside a .h file. Unfortunatelly, the .h file is updated every time, but the target .exe is built without taking into consideration the changes inside .h file. I suppose that CVI does not 'see' the change inside the .h file when it starts building the target. How can we solve this?

 

Example:

1.

Build->Build Steps->Custom Build Actions OR Pre-build Actions contains the line:

SubWCRev.exe "%CD%" "%CD%\Include\svn_version.ini" "%CD%\Include\svn_version.h"

 

this line means that the variable defined in svn_version.ini as: static char SVN_VERSION[] = "$WCREV$.$WCMODS?1:0$";

will become in svn_version.h something like: static char SVN_VERSION[] = "105.0";

after SubWCRev.exe is executed with the parameters mentioned above which will retrieve the SVN revision number (in this case 105).

 

2.

I execute Build->Batch Build->Rebuild Release and expect that .h file is created by SubWCRev.exe and only after that, CVI starts to link variables and build the target.

 

3.

Unfortunatelly, although the .h file is always updated at the end of a Rebuild, the SVN_VERSION variable inside the program sometimes contains the value from the .h file before the update, which makes me think that CVI starts building the target before SubWCRev.exe has finished execution and managed to update the .h file

0 Kudos
Message 1 of 1
(3,801 Views)