2

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?

Tanya
  • 109
  • 1
  • 13

2 Answers2

4

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)

enter image description here

Tibor Takács
  • 3,535
  • 1
  • 20
  • 23
2

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. properties

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

Community
  • 1
  • 1
Gábor Angyal
  • 2,225
  • 17
  • 27
  • There is no option for this for C++ projects. At least I did not find it. I used this for C# projects and wondered if there such a thing for c++. – Tanya Feb 04 '15 at 08:58