How VS has incorporated support for CMake is described here. If you want to build RSC yourself, you need to install the components that VS uses to support CMake.
To use CMake in VS, you no longer open a solution. Instead, just launch VS as an application. Then, under its Get started menu on the right, select Open a local folder. In the File Explorer browser that pops up, navigate to RSC's src directory, click on it, and click the Select Folder button. VS now notices the CMakeLists.txt file in that directory and starts to load all of the subprojects that it requires. It therefore takes a little while before VS is ready to go.
The file CMakeSettings.json describes the configurations that can be used to build RSC:
- WSL-GCC-Debug: Windows Subsystem for Linux using the gcc compiler
- x64-Clang-Debug: 64-bit Windows using the clang compiler
- x64-Debug and x64-Release: 64-bit Windows using the MSVC compiler
- x86-Debug and x86-Release: 32-bit Windows using the MSVC compiler
When you change the configuration, you may need to invoke Project > Delete Cache and Reconfigure before initiating a build. This erases the old files that CMake generated and then generates those required for the new configuration.
The x64 configurations are built using Ninja, which dramatically reduces build times. I haven't succeeded in getting Ninja to support x86, so it still builds the old, slow way.
If you notice CMake generating any .vcxproj files, avoid modifying them, either directly or through the Properties editor. The reason is that CMake regenerates those files before building for another target (x86, x64, or Linux)--at which point your edits will be lost.
Instead of modifying .vcxproj files, you need to modify GlobalSettingsInclude.cmake, or one of the CMakeLists.txt files, to set the build parameters that you require. The CMake tutorial and reference should help if you need to do this. Many CMake questions are also addressed on stackoverflow.
You can now launch RSC through the VS Debug menu. If Debug > Start Debugging is greyed out, use the Select Startup Item... drop-down menu, located to the right of the Configuration drop-down menu, to set the .exe that should be launched.
Make sure that RSC is launched from a directory below the src directory, as described in the installation guide.
The tool CMakeConverter significantly eased RSC's migration to CMake by analyzing .vcxproj files to generate the initial CMakeLists.txt files and a GlobalSettingsInclude.cmake stub that could be populated with RSC's compile and link options. If you have a VS solution that you want to migrate to CMake but are new to it, give this tool a try.