Meson projects
Meson version: 0.54 or higher
In CLion, you can create, open, build, and run/debug Meson projects. Meson support works on all platforms and for all local and remote toolchains, including WSL and Docker.
Follow the official installation guide to install Meson on your system.
Select File | New | Project from the main menu or click New Project on the Welcome screen.
In the left-hand pane, select Meson.
Specify the project name and type, and select the language standard:
Click Create.
CLion will generate a simple project containing main.cpp and meson.build:
tip
You can adjust the meson.build file template in Settings | Editor | File and Code Templates | Other.
Select File | Open from the main menu or click Open on the Welcome screen.
Point CLion to the directory containing meson.build and click Open.
CLion will load the Meson project structure and show the results in the Build tool window:
To open the Meson tool window, click on the right-hand toolbar or select View | Tool Windows | Meson from the main menu.
In this window, you can find the list of build targets, and useful commands, like clean
, install
, test
, configure
, and others:

Double-click on a command or target to run it. The tooptip on hover will show the exact command that will be applied:

Use the toolbar to perform project actions and quickly access the project settings:

Go to Settings | Build, Execution, Deployment | Meson or click
in the Meson tool window.
Use this dialog to configure the following:
Toolchain — select one the configured toolchains.
Meson executable — specify a custom Meson executable, if required.
Setup options — use this field for additional Meson commands, such as
--native-file
.Build directory — check or change the build directory.
Build options — provide additional build options, if required.
CLion highlights the code in meson.build scripts. To adjust the color scheme, go to Settings | Editor | Color Scheme | Meson.
You can use the Structure view to navigate to targets, dependencies, and option commands in meson.build and meson_options.txt.
Press to open the Structure tool window or to open the Structure popup.
When you make changes in meson.build, CLion shows an icon suggesting to reload the project:
Click the icon or press the shortcut.
tip
You can adjust the color scheme for Meson files in Settings | Editor | Color Scheme | Meson.
Alternatively, click
in the Meson tool window.
Another option is to use the Tools | Meson menu:
Select Wipe and reload Meson Project to perform a wipe before reload.
tip
From this menu, you can also Change project root.
CLion detects the project build targets and creates the Native Application configurations for them:
In the main menu, go to Run | Edit Configurations to set up additional parameters if required:
Use the actions in the Build menu to build the project or the selected configuration.
tip
Learn more in Build actions.
To run or debug your program, you can use the configuration widget (click
or
), the Run menu, or the gutter icons next to the program's entry point:
Refer to Run applications and Debug for more information.