I am using a Custom Build Step to copy the built DLL (i.e. $(TargetPath)) of a C++ project to a different location on disk.
I've set the Output
of the Custom Build Step to the destination DLL path, and Additional Dependencies
to $(TargetPath)
- the file I'm copying, in the hope that VS will then only run the step if the source DLL is newer than the target DLL.
However, each time I build the project, VS runs the custom build step - so it appears to be unable to tell that there's no need to perform the copy, (the source DLL $(TargetPath) hasn't changed). I must have the step configured incorrectly.
What settings will give me the behaviour that I want (i.e. - VS regards the project as up-to-date if it built and the custom build step was successful)?
In the VS Output Window I see this line which seems to imply that visual studio is taking the vcxproj as the file that triggers the build step. I want it to use $(TargetPath):
Input file "MyProject.vcxproj" is newer than output file "c:\custom\build\step\copies\the\dll\here.dll".
(PS: I should add, I was initially using a Post Build Step, but if this fails, VS regards the project as successfully built, and doesnt run it again when you Build a second time)