From: Woody on
I am doing something similar, keeping track of builds. I have a pre-
build step which runs a pgm I have written to update a .h file.
This .h file is #include-d in a .cpp file which provides version
information. When all the other files are up-to-date, the pre-build
step doesn't run, and hence no rebuild.

Your post-build step must be touching some file which the project sees
as changed. Why not change to a pre-build step?
From: Mihajlo Cvetanović on
Simon wrote:
> I know it sound more like a hack or anything but I don't know how to
> tell VS2008 to ignore the 'modified' timestamps of a file, (or to ignore
> a file completely for that matter).

Try removing file from .vcproj, but leave it in projects folder.
From: Simon on
On 2010/02/01 11:32 AM, Mihajlo Cvetanović wrote:
> Simon wrote:
>> I know it sound more like a hack or anything but I don't know how to
>> tell VS2008 to ignore the 'modified' timestamps of a file, (or to
>> ignore a file completely for that matter).
>
> Try removing file from .vcproj, but leave it in projects folder.

It never was in the project as it is not used by it.

Simon
From: Simon on
On 2010/02/01 10:50 AM, Woody wrote:
> I am doing something similar, keeping track of builds. I have a pre-
> build step which runs a pgm I have written to update a .h file.
> This .h file is #include-d in a .cpp file which provides version
> information. When all the other files are up-to-date, the pre-build
> step doesn't run, and hence no rebuild.

I do pretty much the same thing.

But a pre-build/pre-link still seem to cause the built to re-start over
and over again.

>
> Your post-build step must be touching some file which the project sees
> as changed. Why not change to a pre-build step?

If I change it to a pre-build then it is the same problem.
As the file was changed it causes a build, who causes the file to be
change, and this carries on over and over.

Simon
From: Woody on
On Feb 1, 4:38 am, Simon <b...(a)example.com> wrote:
> I do pretty much the same thing.
>
> But a pre-build/pre-link still seem to cause the built to re-start over
> and over again

Just to be clear on what I do: I have a completely separate solution,
in which there is a pgm I wrote that creates a new or modifies an
existing .h file to contain a line like const int BuildNum=nnn.
This .h file is in the same directory as the source code of the
project I want to be build-numbered. To get access to the build
number, I just #include the .h file.

In VS2005, I am using the Build Events project setting, with a Pre-
build step consisting of two lines:

CHDIR <path of the .h file modifier>
<.h file modifier executable> "<directory as the source code of the
project>\MyBuildLog.h" (the arg is used by the executable)

I have found that after a build, a second build without changing any
sources doesn't execute the pre-build step.