CLion 2016.3 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/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/cl_reload_cmake.png

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

Generation

Configuration In this drop down list select the desired configuration. The default configuration is Debug.
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/multiline.png to type the required options in the editor window, each option on a new line.
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.

Pass system environment

Description
Pass system environment Use this section to specify the environment and/or custom variables to be passed to the Generation phase of CMake.
Custom variables pane In this table you can add or delete the custom variables (if any) and set their values. Use /help/img/idea/add.png, /help/img/idea/delete.png, /help/img/idea/copy.png and /help/img/idea/mainToolbarPaste.png buttons to manage the list of custom variables.
Show Click this link to show the list of system environment variables and their values.
Pass system environment variablesSelect this check box to pass system environment variables to the Generation phase of CMake.
Note that the name of the section depends on this setting as follows:
  • If this check box is selected, the section's name is Pass system environment
  • If this check box is not selected, the section's name changes to Do not pass environment
  • If this check box is selected and custom variables are defined, the section's name is Pass system and custom environment <variable name>=<value>
  • If this check box is not selected, but the custom variables are defined, the section's name is Pass custom environment <variable name>=<value>

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/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

Procedures:

External Links:

Last modified: 22 November 2016