Skip to content

Setting up CLion for development

Orfeas Zafeiris edited this page Apr 9, 2023 · 4 revisions

1. Create the CMakeUserPresets.json file.

NOTE This is not needed if you generated a project using the mod generator.

In order to be able to easily build, install, and debug the game with the SDK / your mod, you need to create a CMakeUserPresets.json file that points to your game's installation directory. Two sample preset files are provided in this repository as CMakeUserPreses.json-epic_sample and CMakeUserPresets.json-steam_sample for Epic Games Store and Steam users respectively. Copy one of these files to CMakeUserPresets.json, open it, and ensure that GAME_INSTALL_PATH is pointing to the directory where your game is installed.

2. Open the project directory in CLion.

After opening the project, you might get prompted to select which profiles you want to use. Select the Debug profile and disable it.

Disable the Debug profile in the Open Project Wizard

3. Ensure your toolchain is set up correctly.

Go to File > Settings > Build, Execution, Deployment > Toolchains and ensure that you have a Visual Studio toolchain as the default and that its architecture is set to amd64.

Toolchain Settings

4. Enable the CMake profiles.

Go to File > Settings > Build, Execution, Deployment > CMake and enable the x64-Debug-Install and x64-Release-Install profiles.

CMake Profiles Screen

5. Configure the project for debugging.

After CLion has finished configuring the CMake profiles, you should be able to see your mod or the ZHMModSDK under the run configurations at the top right of the IDE. Select the configuration and then edit it.

First, in the Before launch options, add the Install step:

Add install step to before launch

Then, configure the Executable field to point to your game's HITMAN3.exe file. For Epic Games Store installations that will most commonly be at C:\Program Files\Epic Games\HITMAN3\Retail\HITMAN3.exe. For Steam installations that will most commonly be at C:\Program Files (x86)\Steam\steamapps\common\HITMAN 3\Retail\HITMAN3.exe.

Set executable to HITMAN3.exe

Finally, based on your game's platform, you'll have to configure a few additional options:

Epic Games Store

If you're using the EGS version of the game, you must add -EpicPortal -epicuserid=userid to the Program arguments field. You can find your user ID by running Hitman 3 normally through EGS and looking at its command line parameters using something like Task Manager. If you don't specify your actual user id, you will not have the same in-game progression.

Set the Program arguments for EGS

Steam

If you're using the Steam version of the game, you must add SteamGameId=1659040;SteamAppId=1659040;SteamOverlayGameId=1659040 to the Environment variables field. If you're using the Steam demo version of Hitman 3, replace 1659040 with 1847520.

Set the Environment variables for Steam

6. Run the project.

You should now be able to run and debug the project using the Run or Debug buttons at the top right of the IDE.

Debug button location