0

I'm tryin to add a post build event to my project to copy headers and libraries in another folder but I don't know how to set custom variables to my script:

set DEST=$(MY_LIBRARY_PATH)
xcopy $(SolutionDir)source\include\.h $(DEST)

where MY_LIBRARY_PATH is an enviorment variable I've looked at this link but it doesn't solve the problem Visual Studio 2012 Post Build Events - Error Code 255

So how can I set a custom enviorment variable?

Community
  • 1
  • 1
Elvis Dukaj
  • 7,142
  • 12
  • 43
  • 85

1 Answers1

0

You could use a batch file "PostBuild.bat" and pass the paths to the batch file

PostBuild Event: Command line = call PostBuild.bat "$(SolutionDir)" "$(MY_LIBRARY_PATH)"

PostBuild.bat: xcopy %1source\include\.h %2

Edward Clements
  • 5,040
  • 2
  • 21
  • 27
  • @elvis.dukaj: we do more things in our PostBuild.bat (like DotFuscating the built exe, signing the Dotfuscated exe, copying the necessary files to our setup folders, etc) – Edward Clements May 23 '13 at 14:08