CMake support in CLion

Posted on by Anastasia Kazakova

All work in CLion is done within the context of a project. Projects serve as the basis for coding assistance, bulk refactoring, coding style consistency, and other smart features.

CLion now relies on CMake as a project model. It takes all the information about the project from CMake build system. You can specify which files are included in the project, which C++ standard to use, and where to search for header files.

Any CMake-based projects can be opened easily in CLion, with no additional configuration needed: simply point it to the root CMakeLists.txt file in your project sources. You can also import non-CMake projects (File | Import Project…), for which CLion will generate a CMakeLists.txt file.

CMake project settings can be found in Settings/Preferences | Build, Execution, Deployment | CMake dialog, and Tools | CMake menu shows several useful CMake-related actions:
cmake_menu_tools

While editing CMake files in CLion, you can use auto-completion for file names and CMake commands:
cmake_commands_completion
Additionally, CLion can apply CMake files changes automatically.

If you are interested in these and some other CMake-related features in CLion view our demo:
http://www.youtube.com/watch?v=Rbb0fVCz41w

Sincerely yours,
The CLion Team

Comments below can no longer be edited.

3 Responses to CMake support in CLion

  1. Do not use Meson – rojtberg.net says:

    July 25, 2017

    […] the introduction of the server mode it got native support by QtCreator, CLion, Android Studio (NDK) and even Microsofts Visual Studio. Native means that you do not have to […]

  2. I Need Help says:

    July 29, 2017

    Why my CMakeLists.txt is shown in red in the tree?!

    • Anastasia Kazakova says:

      July 31, 2017

      Probably, it’s not under version control, while the rest of the project is. Could you please check?

Subscribe

Subscribe for updates