CLion detects all headers as non-project files

Hi all,

I'm currently evaluating CLion and I got it to work with our project built with CMake after a bit of struggling with paths and CMake parameters. It builds fine (on console and inside CLion).
But all project headers are marked as non-projects files. Which causes CLion to ignore them when performing refactorings and does not allow to implement methods for them and so on.
I was not able to track this down to the cause. There is a CMakeFiles.txt in the project root and several of those in subdirectories. These projects build executables and shared libraries and obviously are referenced by other subdirectories. But even those which are not referenced by other subdirectories exhibit the described behavior.
Any idea what could cause this?

TIA,
Christian

1 comment
Comment actions Permalink

Hi Christian.

You probably don't have you header files mentioned in CMakeLists.txt so they are considered as non-project. You should either add it to your targets or use GLOB_RECURSE if it is not possible (file(GLOB_RECURSE YOUR_HEADERS *.h))

We have an issue in our tracker:
https://youtrack.jetbrains.com/issue/CPP-270
Feel free to comment or upvote.
0

Please sign in to leave a comment.