CLion 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.

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:


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

GenerationIn this section, specify the options and environment variables related to the Generation phase of CMake.
CMake optionsIn this text field, type the additional CMake options to be passed to the CMake command. The options should be delimited with spaces.
You can also click multiline to type the required options in the editor window, each option on a new line.
Pass system environment/
Do not pass environment/
Pass custom environment <variable name>=<value>/
Pass system and custom environment: <variable name>=<value>
Use this section to specify the environment and/or custom variables to be passed to the Generation phase of CMake.
Note that the section's name changes depending on the setting of the check box Pass system environment variables and the presence of custom variables in the table of custom variables.
Table of custom variablesThis table lists the custom variables (if any). Passing s custom variable overwrites the system one, thus allowing the user to add or change a system variable to/in CMake.
Use add, delete, copy and mainToolbarPaste buttons to manage the list of custom variables.
ShowClick 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.
BuildIn this section, specify the options related to the Build phase of CMake:
Build optionsIn 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.

Build output pathSpecify location of the build output. Click the browse button to select the desired path from the Path Chooser dialog.

This setting is saved in .idea/workspace.xml and is not supposed to be shared. There are two options:

  • Default: build files are generated in the standard CMake location.
  • Specified: can be selected as an absolute path or relative to the project root.

See Also

Web Resources:


External Links:

Last modified: 7 May 2015