'How do I open a c++ project folder in visual studio?

I have a c++ project with lots of folders and compiles to lots of different executables, I want to open the entire thing in visual studio and have it keep the folder structure of my project.

Right now when try to create a new VS project and import my non-VS c++ project, it automatically puts all header files in one folder and source files in another completely ignoring my folder structure. How do I get visual studio to keep my folder structure when opening a C++ project that's not created with visual studio?



Solution 1:[1]

I suppose you can select the project and then select Show All Files from Solution Explorer tool bar. You can then Include and Exclude files/folders from the project directory.

Solution 2:[2]

Right click the folder you want them to be in in Solution Explorer, select Add->Existing Item...

This skips a lot of the nice updating/verifying performed when you create a new VS project from existing files but is one way to structure a lot of files.

I'd prefer to manage them within Solution Explorer but I feel this is so obvious you either dissapprove or have a prohibitively large number of files to hunt and sort them with the small Solution Explorer window pane.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ata
Solution 2 John