The Problem
I've grown tired of having my Visual Studio configuration getting jacked up between projects. I like my settings the way they get set and I rarely ever want them changed. I might not have the greatest workflow. In fact, I'd wager that mine really sucks compared to professional programming shops. However, some semblance of structure must hold between projects.I know that the there are project settings files and user profiles and other mystical bits of data on my drive that store the needed information. It's just that I find my time more valuable at coding than managing those haphazardly thrown files.
So this is just a blog so that I have some place to refer when I (once again) need to unscrew my configuration settings. Enjoy.
The Solution
I start out by launching Visual Studio 2017 Community Edition. That's easy.
Once it's finished opening up, it sits patiently for me to do something.
First up is to create a fresh new empty project. File...New...Project or CTRL-SHIFT-N
Next is to name that project and create the solution. I select Empty Project, fill in the project and solution names, provide the directory location, ensure that the "Create directory for solution" box is checked, and click on OK. I locate all by projects in a directory that is easy to find and short enough to not get stupid.
After I click OK then VS presents me the shiny new solution explorer. The "folders" here are not actually folders but, rather, filters. They act like folders but don't physically reside on the hard drive as a folder does. Source and header files will properly get sorted by these filters, but I want to ensure my code is properly kept on disk in a way that makes sense.
And for that, I use the "Show All Files". If I right click on the project name (SFMLdemo in this case), I get a context menu where I click Add...New Folder.
And then I create "src" and "include" folders. Inside those I create the appropriate source files. Neat. Tidy. Switching between folder and filter views allows me to navigate easily around where my code resides.
So, then what?
Now that the files are sorted out and my Solution Explorer looks tidy what is there to do?
I find that the default settings in Visual Studio are lackluster. I'm not a pro, but I know what I like. When you build a project in Visual Studio, the defaults plonk files into weird locations. I like to put the intermediates and executables into more sensible locations.
I open up the project properties and make some changes.
First to change are the Output Directory and Intermediate Directory for all configurations and platforms.
Output Directory is set to:
$(SolutionDir)bin\$(Platform)\$(Configuration)\
Intermediate Directory is set to:
$(SolutionDir)bin\intermediates\$(Platform)\$(Configuration)\
This keeps things cleanly divided for platform (x86, x64) and configuration (Debug or Release).
Would you like to know more?
Yan "TheCherno" Chernikov on YouTube has a fantastic video on how he sets up his Visual Studio experience. It's what I followed. So if you would like to hear this from someone with a bit more personality and experience than I, then I urge you to check out his video. Check out his channel! It's amazingly well produced by a pro game developer who teaches C++ and OpenGL.
No comments:
Post a Comment