CLion chooses system includes over local includes

I have a project, let's call it XXX, where I am installing the headers to /usr/local/include. My problem is, CLion's code jumping jumps to those installed headers instead of the ones in my project folder.


The structure is as follows:







After I run make install, I have the include/XXX folder copied to /usr/local/include. In the 2019 version of CLion, the switching between header and source button would find the one in my project directory. Now, it finds the installed one in /usr/local/include, which is not what I want, because I can't modify it directly, nor would I want to.


I have tried adding the directory to my CMAKE_IGNOGRE_PATH like so:

set(CMAKE_IGNORE_PATH "usr/local/include/XXX")

but that didn't work. Is there an option to ignore system directories inside the CLion code navigator?

Comment actions Permalink

Any updates on this?

Comment actions Permalink

I'm on CLion 2021.2.3 and have the same issue. I'm using a catkin/ros setup and my CMakeLists.txt installs to to my catkin ws. After building clion indexes those headers and not the ones im actually developing with (the ones under vcs)

Comment actions Permalink

Same problem here. I am working on the source code of an already installed library, and when I want to go to the definition of a function, CLions chooses the installed header instead of the one in the source code I am working on.

The version I am currently using: Build #CL-213.6461.75, built on December 28, 2021


Please sign in to leave a comment.