سؤال

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?

هل كانت مفيدة؟

المحلول

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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top