Reputation: 119
I have a C++ project in Visual Studio. I want to add a readme file to it and that it will be copied to the build folder with exe. Is there any built-in feature in Visual Studio 2010 and 2013?
Upvotes: 2
Views: 2343
Reputation: 2255
The easyest way to do this, is right-clicking the file in the solution explorer, choose properties, and there set the "Copy to output directory" option.
Update
As Tanya pointed out this option is only visible in C# projects, but not in C++. The option exists though, only not exposed to the UI. See the answers to this question:
Automatic copy files to output during application building
Upvotes: 2
Reputation: 4828
At project properties (Project menu --> [Project name] properties... menu or ALT+F7) you can find the Post-Build Event tab (Configuration properties --> Build events --> Post-Build Event). Here you can write your macro which copies the readme file to the build folder. You can use the build-in macros to use special folder (i.e. build folder):
https://msdn.microsoft.com/en-us/library/c02as0cs.aspx
A possible solution: copy $(ProjectDir)\ReadMe.txt $(TargetDir)
Upvotes: 4