Opening CMake Projects (Visual Studio)
Article Info
- Last Updated
- (010f10f)
- Tags
- Howto
- Visual Studio
CMake is a cross platform build system. You can load a cmake project in visual studio reasonably easily, but it does take a few steps.
Overview
This guide explains how to open an existing CMake project in visual studio.
Before you start
Before you try to open a cmake project in visual studio, ensure:
-
You have Visual Studio installed
-
You have the CMake plugin for visual studio installed
Both of these are already the case for workshop machines.
Opening a CMake Project in Visual Studio
1. Sign into Visual Studio

Tip
|
visual studio and visual studio code are two different applications. Use visual studio (or a similar tool like clion). |
2. Select 'Continue without code'
Sadly, the cmake option is not one presented on the default list. You will need to select it from the file menu. Select the small "continue without code" option.

3. Select 'CMake… ' from the file menu
You can open a cmake project in modern versions of visual studio (providing you have the feature installed). The option should appear in the File menu, as
.
4. Select the root 'CMakeLists.txt' in the file browser
Cmake projects contain multiple cmake lists files, the root of the project contains the main one. This is the only one which will correctly load the project. This is the only one that contains the project information.
Navigate to the repository folder using the file browser and select "CMakeLists.txt".
Warning
|
you must select the root (top-level) CMakeLists.txt file for the project to open correctly. |

5. Launch the Project
Once loaded, the option to run the game executable should appear on the drop down button next to the green run button. Select the executable from this list to ensure that the build runs correctly. It is recommended to use debug mode rather than production or release mode options when testing this project, as you will get more useful error messages.
