CLion 2017.3 Help

CMake

Use this page to configure CMake in your project. The settings described here are project-related; this page is marked with icon.

Item

Description

Automatically reload CMake project on editing

If this checkbox is selected, CLion automatically reloads a project while editing a CMake file.

If this checkbox is not selected, after editing a CMake file a banner shows up, where you can choose to reload the current project manually, or enable automatic reload, which leads to selecting this checkbox:

However, if external changes take place (for example, version control update), the CMake project reloads anyway.

Profiles

Profiles list

In this field, select a CMake profile to be generated. You can edit or delete the existing profile or create a new one.

Click the button to add a profile to the list. By default, profile is named according to the currently selected build type and toolchain.

From this drop down list select the desired build type. The default type is Debug.

Toolchain

From this drop down list, select the desired toolchain. This list consists of toolchains you had created in the Toolchains settings dialog. If nothing is selected, the Defaulttoolchain is used.

CMake options

In this text field, specify the additional CMake options to be passed to the CMake command. The options should be delimited with spaces. You can also press Shift+Enter or click to type the required options in the editor window, each option on a new line.

Environment

Click the button to invoke the Custom variables pane and select there the environment variables to be passed to the Generation phase of CMake.

Use , , and buttons to manage the list of custom variables.

Use Show link to see the list of system environment variables and their values.

Generation path

Specify here the location of the generated CMake files. That could be either absolute (e.g. c:\CLion Projects\My Project\CMake Files\cmake-build-debug or relative to the current project root path (e.g cmake-build-debug):

In this text field, type a path or click the browse button to select the desired path from the Select Path dialog.

Do nothing to use the default location for generated files.

This setting is saved in .idea/workspace.xml and is not supposed to be shared.

Note: If you select a subdirectory of the project root as the generation output, the IDE marks the files of that subdirectory as excluded from the project and considers them as non-project files. Navigation actions like Navigate to file are not applicable to these files.

Build

Description

Build options

In this text field, specify the options to be passed to the build tool used by CMake. Find more information about the available build options in the CMake documentation.

You can also click to type the required options in the editor window.

If nothing is specified, the default setting -j <number_of_cpu> is used.