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. As for now, 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.
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.