Headers don't show up as searchable source Follow
In my project, I do most of my coding in headers files.
However, the include directory is not bolded like the cpp directory and things like code intentions/intellisense don't work in these files (they work fine in .cpp files). It's as if CLion thinks my headers are external source. Classes defined in the headers also do not show up in searches unless I do Cmd-Shift-N a few times (I'm on mac).
I also have another project where this sort of structure is fine, I'm not sure what the magic setting/cmake configuration is required to make this work.
Any ideas?
Please sign in to leave a comment.
Hi Chris.
Please check that all your headers were added in CMakeLists.txt. You can add the following line to your CMakeLists:
https://youtrack.jetbrains.com/issue/CPP-270
Feel free to comment or upvote.
I'm not explicitly including the headers in a target however they are included the CMakeLists.txt using "include_directories".
If I try to extract a variable in these headers, I get the red tool tip error message "Selected element is not in the project".
Hi Chris.
For now the only way to add headers to CLion project is to add them to some target. We understand that this in not required by CMake, however there is no other way for the IDE to get required data otherwise.
Ah yes, this is what was in another project that works:
All good now :)