Two questions about includes


I'm everyday AppCode user. Recently I started after hours project using Arduino and PlatformIO stack which works quite well by generating CMake project for CLion. Though I have two problems:

  1. I'm used to have a header file which is auto-included to every other files so I can put there common defines, etc. In PlatformIO I use `-includeHeaderFile.h` compiler parameter which does the job. Question is how to mark `HeaderFile.h` in CLion/CMake that it is auto-included. 
  2. Second problem is with `-iquoteDirectoryPath` style includes. How to add include folder in CMake so CLion allows/suggests imports in "" and not in <>? I use `include_directories()` in my lists but then CLion always suggests and autoimports headers using <> notation. Of course I can make it work by using `-I` instead of `-iquote` but I don't want to.


Comment actions Permalink

Hi Oskar.

Unfortunately, it's not implemented in CLion yet. We have the issue in the tracker: Feel free to add your comments or upvote.

CMake doesn't support -quote yet: So we are providing an additional way to control header search path types. Please find out more in our blog: The feature is available since CLion 1.5 EAP. Does that help?

Comment actions Permalink

Hi, thanks for getting back to me.

I upvoted CPP-53. Hopefully it'll be fixed soon.

Unfortunately marking dir as project files doesn't help. As you can see in attached screenshot CLion suggests only <> include and after providing it the implementation file (which indirectly includes it) has some problems with parsing what leads to warnings in header file visible in second screenshot while using "" includes works fine. I believe invalidating cache help for the last.



Please sign in to leave a comment.