CLion 2017.3 Help

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 cl projectIcon icon.

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 show recent 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.
      cl importDirectory
  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
  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.
    • When needed, use User include Directories pane to define include directories to be added to a build, that will be specified in include_directories command of generated CMakeLists.txt file. Refer to CMake include_directories command for details.
    cl importCMakeProject
    When import is completed, the skipped off files and directories are grayed out in the project view.
Last modified: 27 March 2018

See Also

Concepts:

External Links: