Toolchains for CMake projects
For CMake projects in CLion, a toolchain is a set of all the necessary tools required for building and running your application: the working environment, the CMake executable, the make tool and compilers, and the debugger.
When you start working with CLion, you already have a default toolchain available. Although you can use it in development, you may also want to adjust the set of tools for the needs of your project (for example, change the working environment or switch to another compiler).
Create a new toolchain
Go toand click to add a new toolchain.
Select the preferred CMake installation, either the bundled one or a custom version of your choice.
The CMake executable that you set up on the previous step attempts to detect the make utility and the C/C++ compilers. These installations are not defaults, but the ones that CMake detects considering all the packages installed on your system at the moment.
If you prefer to use custom make and compilers instead of the detected ones, use the fields Make, C Compiler, and C++ Compiler to provide the paths. See Switching compilers.
Finally, specify the Debugger. On Windows, you can choose between the bundled or custom GDB. On macOS and Linux, CLion also includes the LLDB debugger (default for macOS). See the currently supported versions.
CLion verifies your choices and notifies you if any of the tools or packages are missing.
When the configuration is completed, click OK to save it. Now you have one more toolchain to use when creating a CMake profile.