Most probably CLion is unaware of some files in your project (these files are grayed out in the project tree):
CLion gets this information from CMakeLists.txt files in the following way:
This is how CLion now knows that main.cpp is included in your project. Before v2018.2, header files (in case their names differ from the appropriate .cpp files already added to the SOURCE_FILES variable) should also be included in the project in that way. Starting from 2018.2, CLion automatically treats included files as project files.
Since CLion 1.5 EAP there is also a new feature ‘Mark Directory As’ that allows to mark directories as:
- Project sources and headers
Read more about use cases and details in our blog.