CLion 2024.1 Help

Tutorial: Configure CLion on macOS

This tutorial will guide you through the process of installing, updating, and initial configuration of CLion on macOS.

Installation procedures

Before you start CLionLion installation on macOS, make sure your machine meets the hardware requirements, and the version of your macOS is 10.9.4+.

Manual installation and patch updates

  1. Download the latest release or EAP version of CLion for macOS (earlier versions are available on the Previous CLion Releases page).

  2. Open the downloaded CLion-*.dmg package and drag CLion to the Applications folder.

  3. Open the Applications folder and launch the CLion installer.

  4. If the security warning appears, agree to open the application:

    cl_macinstall_warning.png
  5. When you install CLion manually, the update checking is performed automatically by default (every time the IDE is ready to update, you will see a message in the status bar). To configure the update process, go to Settings | Appearance and Behaviour | System Settings | Updates and select the update channel:

    cl_updatechannel_choice.png

    Click Check now to perform the checking right away. In case there are available updates according to the chosen channel, you will see a dialog like the following:

    cl_update_prompt.png

Installation and update via Toolbox

Toolbox is a control panel that allows you to manage all JetBrains developer tools, including CLion, as well as your projects, from a single point of access. It enables you to maintain different versions of CLion, install updates and roll them back if needed. Toolbox remembers your JetBrains Account and uses it to automatically log in when you install and register new tools.

  1. Download Toolbox and launch the setup file.

  2. When the installation is complete, accept the JetBrains privacy policy and sign in to your JetBrains Account.

  3. Now you can choose which version of CLion to install:

    Toolbox App
  4. Toolbox shows the list of the installed versions:

    cl_toolbox_installed.png
  5. In the Settings dialog, configure the way of updating CLion:

    cl_toolbox_update.png

    Note that in case of using Toolbox, the update process cannot be configured from within the IDE. The Settings | Appearance and Behaviour | System Settings | Updates dialog shows the following message:

    cl_toolbox_externalupdate.png

After the installation or upgrade, you will be prompted to import, inherit, or create new settings for the IDE.

Required tools

CLion needs to be provided with C and C++ compilers. These tools may be pre-installed on your system: check it in Settings | Build, Execution, Deployment | Toolchains - the compiler and make detection should perform successfully.

If your system does not have working installations of compilers, the simplest solution is to install Xcode command line developer tools.

  1. Run the following command:

    xcode-select --install
  2. When prompted to install command line developer tools, click the Install button:

    cl_xcodetools.png

    You can also choose to install the full package of Xcode, though it is not necessary for CLion.

With Xcode command line tools, you get the Clang compiler installed by default. To check the compiler presence and its version, run clang --version.

Command line tools may not update automatically along with the system or Xcode update. This may cause error messages like invalid active developer path during project loading in CLion. To fix this, run the same xcode-select --install command, and the tools will be updated accordingly.

Note that you can use multiple compilers for the needs of your project, refer to Compilers.

Configure toolchains

Now you need to configure the toolchain to work with, which means choosing the CMake executable, the build tool, the C/C++ compilers, and the debugger.

Navigate to Settings | Build, Execution, Deployment | Toolchains and edit the default toolchain, or click to add a new one.

macOS toolchains

CMake, build tool, and compilers

In the CMake field, specify the CMake binary that you want to use. You may stick to the bundled CMake, or use your custom CMake executable (see the minimum supported version in Software requirements).

By default, CLion will use bundled Ninja as the Build Tool. You can specify another build tool of your choice, for example, make.

The chosen CMake attempts to detect the compilers considering the packages installed on your system. If detection succeeds, the C Compiler and C++ Compiler fields are filled automatically:

Default toolchain

Debugger

CLion for macOS comes with the bundled LLDB v 17.0.6, which is the default debugger. You can also switch to a custom GDB (supported versions are 7.8.x-14.1).

Select the debugger in Settings | Build, Execution, Deployment | Toolchains:

Toolchain debugger options for macOS

Issues are possible when working with GDB on macOS. To improve the behavior, enable the cidr.debugger.gdb.workaround.macOS.startupWithShell option in Registry (select Help | Find Action from the main menu and type Registry):

Enabling the cidr.debugger.gdb.workaround.macOS.startupWithShell registry key

Note that enabling this option is not equivalent to setting set startup-with-shell off in your .gdbinit script.

Further steps

Now that you have CLion installed and configured, you may find the following articles useful for further steps of the development:

Last modified: 26 May 2024