-
Notifications
You must be signed in to change notification settings - Fork 0
Develop KeeperFX with CMake and Visual Studio 2022
In the development branch, you can develop with CMake and Visual Studio 2022.
- Visual Studio 2022 v17.11.5 or above versions.
- Community or other commercial versions.
- (Optional) Install clang-cl tools. See this document for details.
- CMake 3.30.5 or above versions.
- MSYS2 (msys2-x86_64-20240727.exe or newer)
Open msys2_shell.cmd in C:\msys64 (your MSYS2 installation), and install these packages by the pacman.
- pacman -S make gettext base-devel
- pacman -S mingw-w64-i686-gcc
- pacman -S mingw-w64-i686-gdb
-
Visual Studio 2022 is supposed to configure the CMake immediately. Please wait for it to finish.
-
If you are new to CMake and VS 2022, I suggest reading this document.
-
Now, only x86-MinGW32-Debug or x86-MinGW32-Release can build a playable game.

-
You can choose the standard or **heavylog **target.

-
Use buttons in the Build menu to build or clean the project.
-
In the Project menu, you can delete the CMake cache and re-configure.
-
All outputs are put under the out\build folder of your project root.
- You must have a playable game folder. See this instructions.
- Assume you built x86-MinGW32-Debug/standard configuration, you should see keeperfx.exe, keeperfx.map, and many DLL files under out\build\x86-MinGW32-Debug.
- Copy keeperfx.exe, keeperfx.map, and all DLL files to your game folder.
- If you didn't add "C:\msys64\mingw32\bin" to your PATH environment variables, copy ibgcc_s_dw2-1.dll and libwinpthread-1.dll to the game folder.
- Now you can start to play the game.
- If you want to start it with the VS debugger, create launch.vs.json under .vs folder of your project root. Enter the following content.
{ "version": "0.2.1", "defaults": {}, "configurations": [ { "type": "default", "project": "CMakeLists.txt", "projectTarget": "<the exe you want to start - keeperfx.exe or keeperfx_hvlog.exe>", "name": "keeperfx_hvlog.exe", "currentDir": "", "cwd": "", "args": [ "-level", "00001", "-campaign", "personal", "-nointro", "-alex" ] } ] }