Setting Up Your Environment
Install the toolchain, configure CMake, build BeforeTheMesh, and run the samples.
Goal
After this tutorial you will have a working C++ toolchain, a configured CMake environment, and a built BeforeTheMesh starter project.
1. Install Visual Studio (MSVC)
Install Visual Studio 2026 Community with the Desktop Development with C++ and CMake tools. This is all we need for the BeforeTheMesh and TheMeshProject.
2. Install CMake (optional)
Download the latest CMake and ensure it is added to your system PATH. This is optional if you installed Visual Studio with CMake tools.
3. Clone the code
We assume you have Git installed. If not, you can download and install it from git-scm.com. Then clone the repository to get the source code. Alternatively, you can download the source code as a ZIP file from the GitHub repository.
git clone https://github.com/cosfer65/beforethemesh.git
cd beforethemesh
4. Configure the project
Use CMake to configure the project and generate Visual Studio solution files. You can do this from the command line or using the CMake GUI.
We recomend using the command line for simplicity. Visual Studio 2026 installs a command prompt with the environment configured for MSVC. You can find it in the Start menu under "Visual Studio 2026" > "x64 Native Tools Command Prompt for VS 2026". Run the following command from the root of the cloned repository:
cmake -A x64 -B build
This will create a "build" directory with the generated solution files. You can open the solution in Visual Studio if you prefer to build from the IDE.
5. Build the framework and the samples
Build the project using CMake. You can specify the configuration (Release or Debug) as needed.
cmake --build build --config Release
or
cmake --build build --config Debug
6. Run the sample executables
After building, you can run the sample applications to verify that everything is working correctly.
Navigate to the 'runtime' directory and you will find a 'Release' or 'Debug' folder depending on the build configuration. Inside, you will find the built binaries and can run the executable:
cd runtime/Release
./[sample_app].exe
You will see the sample application running, confirming that your toolchain, CMake configuration, and framework build are all working correctly.
7. Folder structure overview
Here is a brief overview of the folder structure of the beforethemesh code folder:
beforethemesh/
├── cmake/
├── external/
│ ├── btm_framework/
│ ├── cmake/
│ ├── include/
│ │ ├── core/
│ │ ├── math/
│ │ ├── platform/
│ │ └── render/
│ ├── src/
│ │ ├── core/
│ │ ├── math/
│ │ ├── platform/
│ │ └── render/
│ ├── examples/
│ │ ├── example-app-0/
│ │ ├── example-app-1/
│ │ └── ...
│ ├── README.md
│ └── CMakeLists.txt
├── projects/
│ ├── project-0/
│ ├── tutorial-0/
│ └── ...
├── README.md
└── CMakeLists.txt
The BeforeTheMesh project is organized into several key directories, each serving a specific purpose in the development workflow.
cmake/: This directory contains CMake modules and scripts that are used to configure and build the project. It includes custom CMake functions, macros, and toolchain files that help manage dependencies and build settings.
external/: This directory is where we include third-party libraries and dependencies. It contains the source code for the btm-framework, which is the core of our project, as well as any other external libraries we may use. The structure within this directory is organized by library, with separate folders for headers, source files, and examples.
projects/: This directory is where we will create our application projects. Each project will have its own folder, and we will use CMake to manage the build process for these projects. This is where you will create your application layers and implement your own logic in the future.
8. Our Next Step
We continue with Step 2: Our First Application, where you will create your first application layer and understand how the framework initializes.