Search code examples
c++configurationvisual-studio-project

Visual Studio C++ project management. How do I handle non-code files in a project?


I have a project in a c++ solution. For that project, I have some config files that I would like to manage from within the project and when I build the project, have those config files added to the executable build path in the proper directory structure.

Example:

test.exe references config/myconfig.txt

Is there a way to setup myconfig.txt and my project so when I build test.exe, I get

/

as well as

//config/config.txt

so when I run test, all paths stay in the proper order without me having to go in and manually create those directories.

I'm not sure I'm making sense here, but maybe one of you will understand where I'm going.


Solution

  • You could use pre-build events to create the directories and copy the files.