CLion 2017.3 Help

Controlling Source, Library and Exclude Directories

Basics

Let's consider the three simple cases which you might face during the project development.

  1. 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 about it.

  2. 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.

  3. You don't want the IDE to index particular folders with binaries and sources. Besides, this might reduce the overall indexing time.

The solution for these cases is to mark a folder accordingly so that the IDE could process the folder in the desired way.

Mark directory as...

To mark directory in the desired way, do the following:

  1. In the Project view, select the desired directory and right click it.
  2. In the drop down menu that opens, select Mark Directory as option.
  3. 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: (sourceRoot 2x icon).
    • For the case number three, select Excluded option. Now the directory is marked as excluded (excludeRoot 2x icon).
    cl MarkDirectoryAs

Last modified: 15 December 2017