Separate "include" folder
Answered
It is common to use separate src and include folders in CMake projects. Typical arrangement can be found at https://github.com/Barthelemy/CppProjectTemplate . In this project, if I open, for example, CppProjectTemplate/ProjA/include/ProjA/World.h header, I get a warning "This file does not belong to any project target...", which makes most of the IDEs features useless.
Please sign in to leave a comment.
Hi! Here is the related issue in our tracker: https://youtrack.jetbrains.com/issue/CPP-10758. This functionality was implemented in CLion 2018.1 EAP, please try it.
No, it doesn't work in CLion 2018.1 EAP Build #CL-181.3741.16 either.
Yes, sorry for misleading, CPP-10758 is about importing project from sources, and that's not your case.
To figure out available preprocessor definitions CLion uses CMake targets, so in order to get the file greyed out you need to add the file to some CMake target. We understand that it is not required by CMake and we have the issue in our tracker: https://youtrack.jetbrains.com/issue/CPP-270. Feel free to comment or upvote. In the meantime, please add the header to some target to provide a resolve context for it (if it is possible for you). As the other workaround you and use
Mark directory as Project sources and headersfeature. It also should work. Please take a look at the blog post to find out more: https://blog.jetbrains.com/clion/2015/12/mark-dir-as/.