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
AI Assistant Insights: Writing C++ Code With the Power of AI in CLion!
AI Assistant in CLion can generate whole code snippets for you. It uses the project context to create relevant function calls and C++ statements.
Striving For Better C++ Code, Part II: Function Summaries to Speed Up the Data Flow Analysis
This is the second blog post in the series dedicated to Data Flow Analysis (DFA) and its implementation in CLion. Read the first part here: Striving For Better C++ Code, Part I: Data Flow Analysis Basics Striving For Better C++ Code, Part II: Function Summaries to Speed Up the Data Flow Analysi…
Striving For Better C++ Code, Part I: Data Flow Analysis Basics
CLion comes with a built-in data flow analyzer, which runs constantly when you are writing your code and helps improve your code’s quality. It can reveal various code problems that might later lead to runtime issues, security breaches, and other vulnerabilities. Examples of these useful checks are c…