CLion 2017.3 Help

CMake Settings

File | Settings | Build, Execution, Deployment | CMake


Use this page to configure CMake in your project. The settings described here are project-related; this page is marked with /help/img/idea/2017.3/current_project_icon.png icon.

ItemDescription
Automatically reload CMake project on editingIf 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:

/help/img/idea/2017.3/cl_reload_cmake.png

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 /help/img/idea/2017.3/add.png button to add a profile to the list. Profile is named according to the currently selected build type and toolchain.
  • Click the /help/img/idea/2017.3/delete.png button to delete the selected profile from the list.
  • Click the /help/img/idea/2017.3/copy.png button to create a copy of the selected profile.
Note, that the list of CMake profiles determines the list of profiles of the Run/Debug Configurations dialog.
Name This field represents the name of the selected profile.
Build type 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.
CMake optionsIn 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 /help/img/idea/2017.3/multiline.png to type the required options in the editor window, each option on a new line.
Environment Click the /help/img/idea/2017.3/browseButton.png button to invoke the Custom variables pane and select there the environment variables to be passed to the Generation phase of CMake.
  • Use /help/img/idea/2017.3/add.png, /help/img/idea/2017.3/delete.png, /help/img/idea/2017.3/copy.png and /help/img/idea/2017.3/mainToolbarPaste.png 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 /help/img/idea/2017.3/multiline.png to type the required options in the editor window.

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

Last modified: 24 October 2017

See Also