CLion 2018.3 Help

Import 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:

  1. On the main menu, choose File | Import Project.

  2. 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 get 2x 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.

  3. CLion automatically generates the top-level CMakeLists.txt file for your project. If the project already contains original CMakeLists.txt file, CLion prompts you to overwrite it with generated file or leave the original one as is and proceed with opening of imported project:

    cl overwriteCMakeLists
    Note, that CMakeLists.txt file won't be overridden until the user completes and confirms configuring of project import.

  4. 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:
      1. A directory that contains at least one header file.

      2. A directory is named "include".

      3. A directory, which doesn't match the previous conditions but has only the subdirectories that contain the header files only.

      When needed, use User include Directories pane to define include directories to be added to a project manually: click the pane's caption and select the desired check boxes.
      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.
    cl importCMakeProject
Last modified: 14 February 2019

See Also

Concepts:

External Links: