CMake support in CLion
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:
While editing CMake files in CLion, you can use auto-completion for file names and CMake commands:
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:
The CLion Team
Subscribe to Blog updates
Thanks, we've got you!
Introducing the New CLion Conan Plugin
We are thrilled to announce the launch of the new version of the Conan CLion Plugin, now compatible with the 2.X versions of Conan.
How To Address 7 Major C++ Pain Points with CLion
The top major C++ pain points have remained unchanged in recent years. How can a modern IDE help address these pain points?
How To Debug C++ Code Efficiently: Disassemble On Demand
CLion 2023.1 brought the ability to explore assembly code even when the source code is available. A new Disassemble action has been added to improve your debugging experience, help you catch issues, and eliminate inefficiencies in the code. When debugging C or C++ code in CLion, you can explore th…