CLion
CLion requires a file as a project file, which is problematic for Godot because it uses the SCons buildsystem instead of CMake. However, there is a CMakeLists.txt
configuration for which can also be used by CLion.
From the CLion’s welcome window choose the option to import an existing project. If you’ve already opened another project, choose File > Open from the top menu.
The folder containing the CMakeLists.txt
file.
- If this popup window appears, select This Window to open the project:
- Choose Tools > CMake > Change Project Root from the top menu and select the Godot root folder.
- You should be now be able to see all the project files. Autocomplete should work once the project has finished indexing.
If you run into any issues, ask for help in one of Godot’s community channels.
Debugging the project
Since CLion does not support SCons, you won’t be able to compile, launch, and debug Godot from CLion in one step. You will first need to compile godot yourself and run the binary without CLion. You will then be able to debug Godot by using the feature.
Run the binary you have created (in the bin directory). If you want to debug a specific project, run the binary with the following arguments :
--editor --path path/to/your/godot/project
. To run the project instead of editing it, remove the--editor
argument.
- Find and Select godot in the list (or type the binary name/Process ID)
You can now use the debugging tools from CLion.
Note
If you run the binary without any arguments, you will only debug the project manager window. Don’t forget to add the argument to debug a project.