Create New CMake Project from Sources
To work with non-CMake sources in CLion, you can convert them into a CMake project structure.
Create a new CMake project from sources
On the main menu, chooseand select the path to the sources.
In the Import CMake Project dialog, specify the following:
Select project files - select the files to be imported as project files. Use the subdirectories checkboxes to import their entire contents or clear the checkboxes to import the contents selectively.
User Include Directories - select the directories to be included into the project and specified in the CMake include_directories command. CLion includes a directory automatically when it contains at least one header file, if it is named
"include", or when it has subdirectories that contain header files only.
Note that directories not selected in the Select Project Files pane are not presented in the User Include Directories list - select them first, and then the available include directories will appear in the list.