CLion 2018.2 Help

Configuring 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 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 use another compiler that is optimal for a certain task).

To create a new toolchain:

  1. Navigate to the Toolchains settings dialog: Settings / Preferences | Build, Execution, Deployment | Toolchains, and click icons general add to add a new toolchain:

    cl newtoolchain windows

  2. If you are a Windows user, choose your working Environment: MinGW, Cygwin, WSL, or MSVC. For more details on how to configure CLion on Windows, take a look at our tutorial.

  3. Select the preferred CMake installation, either the bundled or a custom version at your choice.

  4. The CMake executable that you set up on the previous step attempts to detect the make utility and the C/C++ compilers. These installations (represented in corresponding fields) are not defaults, but the ones that CMake detects considering all the packages installed on your system at the moment.

  5. 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.

  6. 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 (which is a default debugger for macOS). Refer to the toolchain requirements for the currently supported versions.

  7. Along the process, CLion verifies your choices and notifies you accordingly if any of the tools or packages are missing:

    cl toolchainfail windows

  8. When the configuration is completed, click Apply and OK to save it. Now you have one more toolchain to use when creating a CMake profile.

Last modified: 27 November 2018

See Also