CLion 2017.2 Help

CMake Settings

File | Settings | Build, Execution, Deployment | CMake


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

ItemDescription
Automatically reload CMake project on editingIf this check box is selected, CLion automatically reloads a project while editing a CMake file.

If this check box 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 check box:

cl reload cmake

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

Generation

Configuration tab In this tab, select a build configuration to be generated. You can add or delete the existing configurations or create a new one.
  • Click the add button to add an existing build configuration to the list. That could be one of the four default configurations provisioned by CMake as well as a custom one.
  • Click the delete button to delete the selected configuration from the list.
  • Click the copy button to create a copy of the selected configuration.
Note, that the list of build configuration types in the Configuration pane determines the list of available Run/Debug configurations of the Run/Debug Configurations dialog.
Configuration In this drop down list select the desired build configuration. The default configuration is Debug. To add a configuration to the list, select it in the Configuration tab.
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 multiline to type the required options in the editor window, each option on a new line.
Environment Click the browseButton button to invoke the Custom variables pane and select there the environment variables to be passed to the Generation phase of CMake.
  • Use add, delete, copy and mainToolbarPaste 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.

Microsoft Visual C++ compiler specific settings

The settings of this section are available only when Microsoft Visual C++ compiler support is enabled. Refer to our tutorial for details.

ArchitectureSelect the target project architecture from the drop down list: x86, arm64, x86_arm, etc.
Platform In this text field, specify the target project platform: store, uwp or leave it blank to use the default one.
Version In this field, specify the respective Windows SDK name or leave it blank to use the default one.

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 multiline to type the required options in the editor window.

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

Last modified: 15 December 2017

See Also