Controlling Source, Library and Exclude Directories
Let's consider the three simple cases which you might face during the project development.
You have imported a folder with the library header files under the Project root directory. You may want to inform CLion that this folder contains the library files since the IDE itself is unable to distinguish the project and library files unambiguously. Moreover, you can experience incorrect behavior of some features like refactoring, code navigation, etc. for that files, and get an IDE's notification.
Similar to the first case. You have a folder with source/header files, but the IDE doesn't consider them as project files, therefore you can experience incorrect IDE behavior. If you don't want to change the project structure, the possible solution is to inform IDE in some way that this directory contains the project files.
You don't want the IDE to index particular folders with binaries and sources. Besides, this might reduce the overall indexing time.
Mark directory as...
To mark directory in the desired way, do the following:
- In the Project view, select the desired directory and right click it.
- In the drop down menu that opens, select Mark Directory as option.
- In the next menu, make your choice:
- For the case number one, select Library Files option. Now the directory is marked as a library root in the project view.
- For the case number two, select Project Sources and Headers option. Now the directory is marked as project source/header folder in the project view: ( icon).
- For the case number three, select Excluded option. Now the directory is marked as excluded ().