CLion 2017.1 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 /help/img/idea/2017.1/current_project_icon.png 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:

/help/img/idea/2017.1/cl_reload_cmake.png

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 /help/img/idea/2017.1/add.png 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 /help/img/idea/2017.1/delete.png button to delete the selected configuration from the list.
  • Click the /help/img/idea/2017.1/copy.png 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 /help/img/idea/2017.1/multiline.png to type the required options in the editor window, each option on a new line.
Environment Click the /help/img/idea/2017.1/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.1/add.png, /help/img/idea/2017.1/delete.png, /help/img/idea/2017.1/copy.png and /help/img/idea/2017.1/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.

Microsoft Visual C++ compiler specific settings

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 /help/img/idea/2017.1/multiline.png to type the required options in the editor window.

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

See Also

Last modified: 19 July 2017