Jump to content

Get Involved/development/IDE configuration/CLion: Difference between revisions

From KDE Community Wiki
Ashark (talk | contribs)
Add basic CLion instructions
 
Ashark (talk | contribs)
Setup: Add screenshots
Line 8: Line 8:


Open a new project in CLion. Locate it to the folder with CMakeLists.txt. It will ask how do you want to open the project. Select CMake project.
Open a new project in CLion. Locate it to the folder with CMakeLists.txt. It will ask how do you want to open the project. Select CMake project.
[[File:Clion open as cmake project.png|border|300px|open as cmake project]]


In CMake configuration, choose Debug build. In the Generator, set "Let Cmake decide". In the Build directory, insert the build directory path, for example, "/home/username/kde/build/dolphin". Press OK.
In CMake configuration, choose Debug build. In the Generator, set "Let Cmake decide". In the Build directory, insert the build directory path, for example, "/home/username/kde/build/dolphin". Press OK.
[[File:Clion build configuration.png|border|700px|build configuration]]


In the run/debug target (in the upper right corner of main window), select "dolphin".
In the run/debug target (in the upper right corner of main window), select "dolphin".
[[File:Clion select run debug configuration.png|border|300px|select run debug configuration]]


Expand it and choose Edit.
Expand it and choose Edit.
[[File:Clion go to run debug configuration edit.png|border|300px|go to run debug configuration edit]]


The Run/Debug Configurations window will appear. In the Environment variables field click edit button.
The Run/Debug Configurations window will appear. In the Environment variables field click edit button.
[[File:Clion run debug configuration.png|border|500px|run debug configuration]]


Add variables, that you can find in build directory, for example, in "/home/username/kde/build/dolphin/prefix.sh".
Add variables, that you can find in build directory, for example, in "/home/username/kde/build/dolphin/prefix.sh".
[[File:Clion run debug configuration add variables.png|border|500px|run debug configuration add variables]]


In the Toolchains you can use bundled cmake and gdb. In Arch Linux their versions are very recent and not yet supported by CLion. They can be installed with [https://aur.archlinux.org/packages/clion-cmake clion-cmake] and [https://aur.archlinux.org/packages/clion-gdb clion-gdb].
In the Toolchains you can use bundled cmake and gdb. In Arch Linux their versions are very recent and not yet supported by CLion. They can be installed with [https://aur.archlinux.org/packages/clion-cmake clion-cmake] and [https://aur.archlinux.org/packages/clion-gdb clion-gdb].
[[File:Clion use bundled cmake and gdb.png|border|500px|use bundled cmake and gdb]]

Revision as of 09:16, 21 August 2023

CLion is a proprietary IDE for C++.

Install CLion

On Arch Linux install the clion.

Setup

Open a new project in CLion. Locate it to the folder with CMakeLists.txt. It will ask how do you want to open the project. Select CMake project.

open as cmake project

In CMake configuration, choose Debug build. In the Generator, set "Let Cmake decide". In the Build directory, insert the build directory path, for example, "/home/username/kde/build/dolphin". Press OK.

build configuration

In the run/debug target (in the upper right corner of main window), select "dolphin".

select run debug configuration

Expand it and choose Edit.

go to run debug configuration edit

The Run/Debug Configurations window will appear. In the Environment variables field click edit button.

run debug configuration

Add variables, that you can find in build directory, for example, in "/home/username/kde/build/dolphin/prefix.sh".

run debug configuration add variables

In the Toolchains you can use bundled cmake and gdb. In Arch Linux their versions are very recent and not yet supported by CLion. They can be installed with clion-cmake and clion-gdb.

use bundled cmake and gdb