Prerequisites
Before you begin, ensure you have:- CMake 3.24 or later
- Visual Studio 2022 with C++ development tools
- Git for cloning the repository
- PowerShell or Command Prompt
- Windows 10 or later (64-bit)
You can download CMake from cmake.org or install it via Visual Studio Installer.
Project structure
The CMake build system is configured with:CMakeLists.txt- Main project configurationcmake/WorldSources.cmake- Source file list for MinecraftWorld librarycmake/ClientSources.cmake- Source file list for MinecraftClient executablecmake/CopyAssets.cmake- Post-build asset copy script
Build targets
The CMake configuration defines two main targets:- MinecraftWorld - Static library containing world/game logic
- MinecraftClient - Main executable (WIN32 application)
Configuration
Configure the build
Run CMake configuration with the Visual Studio 2022 generator:
Use
CMAKE_GENERATOR_INSTANCE to explicitly specify your Visual Studio installation if you have multiple versions installed (Community, Professional, Enterprise).Building
Debug build
Build the Debug configuration with debugging symbols and diagnostic features:build/Debug/MinecraftClient.exe
Release build
Build the Release configuration with optimizations:build/Release/MinecraftClient.exe
Build all targets
To build both the library and executable:Running the game
The game must be launched from the output directory because it relies on relative paths for assets (e.g.,
Common/Media/...).CMake configuration details
Platform validation
The CMakeLists.txt includes strict platform checks:Runtime library
The project uses static MSVC runtime:- Debug:
MultiThreadedDebug - Release:
MultiThreaded
Compiler options
Theconfigure_msvc_target() function applies these settings:
Preprocessor definitions
Both Debug and Release configurations define:_LARGE_WORLDS- Enable large world support_DEBUG_MENUS_ENABLED- Enable debug menus_CRT_NON_CONFORMING_SWPRINTFS- Legacy CRT compatibility_CRT_SECURE_NO_WARNINGS- Disable CRT security warnings_WINDOWS64- 64-bit Windows platform flag
_DEBUG.
Linked libraries
The MinecraftClient executable links against: System libraries:d3d11- Direct3D 11XInput9_1_0- Xbox controller inputwsock32- Windows socketslegacy_stdio_definitions- Legacy C runtime
- Iggy (UI middleware):
iggy_w64.lib,iggyperfmon_w64.lib,iggyexpruntime_w64.lib - Miles Sound System:
mss64.lib - 4J Studios libraries:
4J_Input,4J_Storage,4J_Render_PC(with_dsuffix for Debug)
Post-build asset copying
The CMake build automatically copies required assets after compilation:- Sound files (
Durango/Sound→Windows64/Sound) - Music files
- Game data (
Windows64/GameHDD) - Media archives (
Common/Media/MediaWindows64.arc) - Resources, tutorial, and trial content
- Required DLLs (
iggy_w64.dll,mss64.dll)
Asset copying is automatic for both Debug and Release builds. You don’t need to manually copy files.
Build from scratch
To perform a clean build:Parallel builds
CMake automatically uses parallel compilation with/MP. To control the number of parallel jobs:
Troubleshooting
”This CMake build currently supports Windows only”
The CMake build system is Windows-only. If you’re on macOS or Linux, you’ll need a Windows machine or VM. Running the game via Wine is separate from having a supported build environment.”Use a 64-bit generator/toolchain (x64)”
Ensure you specify the x64 architecture with-A x64 when configuring CMake.
”Cannot find Visual Studio instance”
If CMake can’t find Visual Studio, explicitly specify the path:Missing library files
If the build fails with linker errors, verify that all required.lib files are present in:
Minecraft.Client/Windows64/Iggy/lib/Minecraft.Client/Windows64/Miles/lib/Minecraft.Client/Windows64/4JLibs/libs/
Next steps
- Learn about Visual Studio builds for IDE-based development
- Review platform support for compatibility details
- Set up CI/CD pipelines using the CMake workflow