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 and its root directory is marked with icon.
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:
- 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 check boxes to import all of their contents. Uncheck the subdirectories check boxes to import their contents selectively.
- When needed, use User include Directories pane to define include directories to be added to a build, that will be specified in
include_directoriescommand of generated
CMakeLists.txtfile. Refer to CMake include_directories command for details.