The structure of the project looks like this:
|- src (contains CMakeLists.txt)
First you need to set the language version in Tools -> Options -> C/C++:
Then you have to create a new project: File -> New Project... -> C/C++ Project with Existing Sources. Then select CLang in Tool Collection in the Select Mode step. Select Custom for Select Configuration Mode so that you can specify the build directory:
In the step Pre-Build Action select the debug folder for Run in Folder:
The Project Name should be the same as project dir.
Configure a debug and release configuration in the next step. Open the project properties: File -> Propject Properties -> Build and select Manage Configurations.... Rename the current configuration to Debug and select Duplicate. Rename the duplicated configuration to Release and select the release directory as Working Directory. Also change Pre-Build -> Command Line from
Now you can change between release and debug builds. Don't forget to execute the pre-build step before building the project for the first time.