L
L
leanid2014-01-03 17:04:06
C++ / C#
leanid, 2014-01-03 17:04:06

How to automatically change define in MSVC?

I want in MSVC 2013 Express at build time, so that one of my definitions would be something like this:
HG_VERSION="%shell cd ../ && hg identify -n -i -t%" in the project properties.
Please tell me how to achieve this. Or how to achieve a similar result but perhaps in a different way.
Thank you in advance.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
leanid, 2014-01-04
@leanid

I did this: I added the generation of a minimal header file to the pre-build event, and included it in the source code.

T
Trrrrr, 2014-01-03
@Trrrrr

We ran a python script on the buildserver, which, according to certain laws, generated a header with the necessary version definitions for us. The older version was changed by hand, but the script took the iteration number from our website on the Internet.
The script is written literally in 5 minutes.
Perhaps there are simpler solutions for your case.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question