Creating basic project file structure based on CMake #12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
MicroMouse Simulator - Build Guide
Project Structure
Prerequisites
Before building, ensure you have the following installed:
Building the Project
Step 1: Configure the Project
Navigate to the project root directory and run:
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
-Gflag: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:
This compiles and links all source files into the executable
mms.exe(ormmson Unix-like systems).Build Configuration (Optional)
For multi-configuration generators like Visual Studio, you can specify the build type:
Locating the Executable
The output location depends on the generator used:
build/mms.exe(orbuild/mms)build/Debug/mms.exeorbuild/Release/mms.exebuild/mms.exe(orbuild/mms)Running the Simulator
After building, run the executable from the build directory:
Troubleshooting
CMake configuration fails:
Build fails with compilation errors:
Can't find the executable:
Cleaning the Build
To start fresh, delete the
build/directory and reconfigure: