Installation with JetBrains CLion
3.1 CMake configuration with CLion
CLion uses Makefiles for your platform as the default generator.
The following image contains the toolchain configuration for CLion running on Windows.
The following image contains the CMake configuration for CLion running on Windows.
Here you can choose a better generator like ninja
by setting the cmake options flag to -G Ninja
.
To reload the CMake cache, triggering the copy of new headers and discovery of new targets (libraries, executables and/or modules), you can either configure to re-run CMake automatically after editing CMake files (pretty slow and easily triggered) or reload manually. The following image shows how to trigger the CMake cache reload.
3.2 Building the project with CLion
You can select the desired target on a drop-down list and then click the hammer symbol, as shown in the image below.
3.3 Running executables with CLion
Select the desired target to run from the drop-down list and then click either: the play button to execute the program; the bug to debug the program; the play button with a chip, to run Valgrind and analyze memory usage, leaks and so on.