Importing Existing non-CMake Project
Importing operation refers to the projects with existing sources that you would like to work with in CLion IDE. You can import the whole project or select the desired files and subdirectories to be imported to CLion. Once the project has been imported, it is available for all the IDE actions.
To import a project to CLion:
On the main menu, choose.
- In Select Directory dialog box that opens, select the path to the desired project. Do one of the following:
In the path filed, type the qualified name of the desired project directory, or click the button to choose from the list of recent entries.
Select the desired directory on the tree pane. You can also choose the project in your file browser (Windows Explorer, for example) and drag-and-drop the selected item to the tree pane of Select Directory dialog.
Press OK to proceed.
CLion automatically generates the top-level CMakeLists.txt file for your project. If the project already contains original
CMakeLists.txtfile, CLion prompts you to overwrite it with generated file or leave the original one as is and proceed with opening of imported project: Note, that
CMakeLists.txtfile won't be overridden until the user completes and confirms configuring of project import.
- In Import CMake Project dialog box that opens:
Use Select project files pane to select the files to be imported as project files. Select the subdirectories checkboxes to import all of their contents. Uncheck the subdirectories checkboxes to import their contents selectively.
- The User Include Directories pane represents a list of directories to be included to a project and specified in CMake include_directories command. CLion includes these directories automatically when at least one of the following criteria is matched:
A directory that contains at least one header file.
A directory is named
A directory, which doesn't match the previous conditions but has only the subdirectories that contain the header files only.
Note, that directories not selected in the Select Project Files pane are not presented in the User Include Directories list: you need to select the related check boxes to let the desired directories appear in the latter.