CLion 2021.1 Help

Build actions

In CLion, the actions for building, cleaning, and installing projects are grouped in the Build menu.

Tables below describe how the Build actions work for CMake, Makefile, and Compilation Database projects (with custom build targets and custom run/debug configurations).

Build actions for CMake projects

ActionDescription
Build ProjectBuilds the all target from each CMake profile configured for the current project:
build project action
This action serves as the most global build action, as it does not require a CMake profile or Run/Debug configuration to be preselected.
Build All in <selected profile>

Builds the all target from the current CMake profile.

You can configure the profiles in CMake settings and then select the desired one in the Run/Debug configuration switcher.

Build <selected configuration>Builds the selected Run/Debug configuration for CMake projects.
Recompile <current file>

Compiles the currently opened file or a group of files, if selected in the Project View. When used for multiple files, recompilation stops upon the first compilation failure.

InstallRuns cmake install for the currently selected CMake profile (see CMake install for details).
Rebuild Project

Calls Clean for all the CMake profiles and then Build Project.

Rebuild All in <selected profile>Calls Clean and then Build All in <selected profile>.
Rebuild <selected configuration>

Calls Clean and then Build <selected configuration>:

rebuild configuration

CleanCleans the project by building the clean target from the current CMake profile.

Build actions for Makefile projects

ActionDescription
Build ProjectCalls make for the target specified in the Build target field of the Makefile settings or for the first target in the project’s top Makefile if Build target is empty.
Build <selected configuration>Calls make for the target specified in the selected configuration.
Recompile <current file>

Compiles the currently opened file or a group of files, if selected in the Project View. When used for multiple files, recompilation stops upon the first compilation failure.

Rebuild ProjectCalls make clean and make for the targets specified in Build target and Clean target of the Makefile settings. If Build target is empty, the first target from the project’s top Makefile is used.
Rebuild <selected configuration>Calls make clean and make for the target specified in the selected configuration.
CleanCalls make clean for the target specified in the selected configuration.

Build actions for Compilation Database projects

ActionDescription
Build ProjectFor custom build targets: calls the Build tool of the first target.
Build <selected configuration>For custom Run/Debug configurations: calls the Build tool of the target specified in the selected configuration.
Recompile <current file>

Compiles the currently opened file or a group of files, if selected in the Project View. When used for multiple files, recompilation stops upon the first compilation failure.

Rebuild ProjectFor custom build targets: calls the Clean tool, then the Build tool of the first target.
Rebuild <selected configuration>For custom Run/Debug configurations: calls the Clean and then the Build tool of the target specified in the selected configuration.
CleanFor custom Run/Debug configurations: calls the Clean tool of the target specified in the selected configuration.
Last modified: 08 March 2021