CLion not resolving includes anymore - wrong root?


It seems that suddenly CLion's highlighting and autocompletion can't find any of my includes anymore (both library includes and my local includes). Standard include (<vector>, etc) are fine.
What's strange is that I'm pretty sure the includes were resolved correctly up to some point, but I can't figure out what's wrong. The project compiles perfectly fine using the same CMakeLists.txt both inside and outside of CLion, it's really just the intellisense which is broken.

Screenshot 2015-11-26 17.22.15.png

It seems to have something to do with the project root: I am suggested to include "../../include/Mesh.h" even though the project directory is organized as follows:

> CMakeLists.txt
> includes
   > mesh.h
> src
  > main
    > hello.cpp

Screenshot 2015-11-26 17.23.18.png

My CMakeLists.txt contains (among other):

I have also included manually all the headers along the source files in my calls to add_library and add_executable, and they are white in the project sidebar (i.e. not grayed out).

What I've tried:
- Restarting several times
- Clearing caches and restarting
- Deleting the .idea files and re-importing the project

Would you have any idea of what could be wrong?
What's really confusing to me is that everything compiles, links and runs perfectly even inside of CLion.

Thanks a lot in advance for your help!

1 comment
Comment actions Permalink

And problem fixed... I realized by giving a look at the options that I was not using the bundled CMake, but the version from Brew. I had forgotten about that!
My last `brew upgrade` bumped CMake to 3.4, which I guess is not really supported yet. Reverting to the bundled CMake fixed it.


Please sign in to leave a comment.