Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Copy to output directory" in VC++

When doing C# with VS2008, there is a file property "Copy to output directory". This property seems to be missing in VC++. What is the simplest way to approximate the same effect?

I've been told that it should be done with custom build rules. Is this really the simplest way, and if it is, how should the custom build rule be implemented?

like image 946
hrnt Avatar asked Oct 14 '09 19:10

hrnt


1 Answers

In the project property pages one of the Configuration Properties is a node called Build Events.

Under that node is Pre-Build, Pre-Link, and Post-Build Event nodes.

In each one you can put a simple command in the Command Line property

For example:

copy $(InputDir)\files\my_special_file.txt $(OutDir)

Basically the Command Line is just a cmd.exe command.

like image 170
John Weldon Avatar answered Oct 05 '22 12:10

John Weldon