I have a vanilla Visual Studio 2005 Solution with a single C++ Project which contains some non-code files that I would like to include in my build process.
For example, I have an .xml file with ‘Content’ set to ‘True’ in a path relative to my project directory. From my understanding this should be copied to the output directory in the same relative path from the project.
alt text http://img27.imageshack.us/img27/9876/deployablecontent.gif
However, nothing ever gets copied. What gives?
The directory structure is like this:
./ <- This is the project directory. ./content <- This is where my 'deployable' content is. ./include ./src ./build <- This is the temp directory used when compiling. ./dist <- This is the output directory.
After executing a debug build, I would expect my output to be like this:
./ ./content ./include ./src ./build ./dist ./dist/debug <- Compiled code is now here. ./dist/debug/content <- My 'deployable' files should be here.
In fact, setting ‘Content’ to ‘True’ (like in the provided screenshot) doesn’t seem to be doing anything. Am I just misunderstanding how this works?
I usually copy additional files to output using Post-Build event, but your excellent question made me question my ways. I found that if you right-click on item and choose properties, a different dialog shows up, which allows you to specify what operation to perform during the build. However, I was not able to create a behaviour similar to what you want using standard windows commands. So you likely would need to write your own program to copy files to output.