Skip to content

Conversation

@kazurem
Copy link
Collaborator

@kazurem kazurem commented Dec 9, 2025

MicroMouse Simulator - Build Guide

Project Structure

MicroMouse-Simulator/
├── CMakeLists.txt       # Root build configuration
├── src/                 # C++ implementation files (.cpp)
│   ├── main.cpp         # Application entry point
│   └── MazeGen.cpp      # Maze generation implementation
└── include/             # C++ header files (.hpp)
    └── MazeGen.hpp      # Maze generation interface

Prerequisites

Before building, ensure you have the following installed:

  • CMake (version 3.10 or higher recommended)
  • A C++ compiler (GCC, Clang, MSVC, or MinGW)
  • A build system (Make, Ninja, or MSBuild)

Building the Project

Step 1: Configure the Project

Navigate to the project root directory and run:

cmake -B build

This command creates a build/ directory containing all CMake configuration files.

Specifying a Generator (Optional)

CMake supports multiple generators for different build systems. You can specify one using the -G flag:

# For MinGW Makefiles
cmake -B build -G "MinGW Makefiles"

# For Visual Studio 2022
cmake -B build -G "Visual Studio 17 2022"

# For Ninja
cmake -B build -G "Ninja"

Note: If no generator is specified, CMake selects a default based on your platform.

Step 2: Build the Executable

Once configuration is complete, build the project with:

cmake --build build

This compiles and links all source files into the executable mms.exe (or mms on Unix-like systems).

Build Configuration (Optional)

For multi-configuration generators like Visual Studio, you can specify the build type:

# Build in Release mode
cmake --build build --config Release

# Build in Debug mode
cmake --build build --config Debug

Locating the Executable

The output location depends on the generator used:

Generator Executable Location
MinGW Makefiles / Unix Makefiles build/mms.exe (or build/mms)
Visual Studio build/Debug/mms.exe or build/Release/mms.exe
Ninja build/mms.exe (or build/mms)

Running the Simulator

After building, run the executable from the build directory:

# For MinGW Makefiles
./build/mms.exe

# For Visual Studio (Debug)
./build/Debug/mms.exe

# For Visual Studio (Release)
./build/Release/mms.exe

Troubleshooting

CMake configuration fails:

  • Verify CMake is installed and accessible in your PATH
  • Check that you have a compatible C++ compiler installed

Build fails with compilation errors:

  • Ensure all dependencies are properly installed
  • Check that your compiler supports the C++ standard used by the project

Can't find the executable:

  • Check the generator-specific location listed in the table above
  • Verify the build completed without errors

Cleaning the Build

To start fresh, delete the build/ directory and reconfigure:

# On Unix-like systems
rm -rf build/

# On Windows (PowerShell)
Remove-Item -Recurse -Force build/

# Then reconfigure
cmake -B build

@kazurem kazurem merged commit 87c4a4c into kr8457:dev Dec 9, 2025
@kazurem kazurem linked an issue Dec 9, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Setup up the basic file structure structure for the project

1 participant