Before starting with CLion, check these system requirements.
Build, Execution, Deployment | Toolchains in the CLion's settings to make sure you have all the required tools installed on your machine. Note that you can use either bundled or custom version of CMake and debugger executable.
Microsoft Visual C++ compiler
There is also an experimental support for Microsoft Visual C++ compiler. To turn it on, use Registry (in Find Action dialog Shift+Ctrl+A type Registry; open Registry, type clion.enable.msvc to quickly find the setting and turn it on.
CLion supports and auto-detects Microsoft Visual C++ compiler from Visual Studio 2013, 2015 and 2017. CMake project is still required (it will be used along with the NMake generator).
Start a new project
To start a completely new project, use
File | New Project... to generate the sample project and pre-fill root CMakeLists.txt with the necessary information:
To check system requirements and get started with CLion, refer to the Quick Start Guide.
Open an existing project
To start working with an existing CMake project in CLion, locate the root CMakeLists.txt file, CMakeCache.txt file or CMake generation directory (the last two options work only for Makefiles generator).
Alternatively (if you don't have a CMake-based project), import a C/C++ project from an existing source, and CLion will create CMakeLists.txt for you.
Another option is to check out source code from an existing VCS storage or repository. Git, GitHub, CVS, Mercurial, Subversion, TFS and Perforce are supported.
Add new files
New files can be added to the project by using the New menu. In the Project tree view, press Alt+Insert or select New in the context menu.
- Click C++ Class to generate a .cpp file source file with a header and a class stub:
- Click C/C++ Source File to generate a simple source file, optionally with an associated header.
- Click C/C++ Header File to generate a simple header file.
Update CMake targets
In all three cases you can also select the CMake targets in which the files need to be included, and CLion will automatically update the appropriate CMakeLists.txt in your project:
File extensions can be configured in
Editor | Code Style | C/C++ | New
File Extensions settings. These file extensions are available when creating a new C++ class,
or header file. Reorder the list of possible combinations to have your favorite one on top
and to use it as the default.