How to make CLion work with Arduino and other embedded tools (Microchip XC ... etc)

The biggest part of this questions is "How do I add include directory into CLion for inspection to work properly?". I guess running build can be done relatively easily.

1

I just tried:

set(INCLUDE_DIRECTORIES "t:\\downloads\\picinclude")

and

include_directories("t:\\downloads\\picinclude")

But it didn't work. The IDE still does not find the .h files.

 

1

Hi!

Please take a look at http://www.instructables.com/id/Setup-JetBrains-Clion-for-Arduino-Development/?ALLSTEPS. Also you can find some useful CLion plugins and workarounds via PlatformIO in comments: https://youtrack.jetbrains.com/issue/CPP-364

0

Yes, I found that for arduino, but I had two problems with it:

1. It crashed - I already submitted report

2. It is only for arduino and I look for more generic approach that supports any C project as long as you point where the include files are. I don't need debugging or anything complex. I just inspection to work.

 

I don't know why I can't make include_directories work. I searched google and I found many reports that inspection doesn't work but the project compiles just fine, but that's on linux and apparently this was solved. I also tried using mingw paths:

# t:\downloads\picinclude
include_directories
("/t/downloads/picinclude")

I can't make it work. The directory t:\downloads\picinclude is copied from c:\Program Files in order to not contain spaces. I can only mark a folder as a library if it's in the project directory - It's not very good solution to copy includes in every project I have.

1
Avatar
Permanently deleted user

The same problem. 

It would be great if we get a guide to set an external compiler. Quick CMake Tutorial is very good - but it leaves questions.
The problem for me is hidden procedures in CLion. I cannot figure how it
1) processes CMake
2) processes additional .CMAKE file which is recommended as DCMAKE_TOOLCHAIN_FILE in some publications
3) treats Build,Execution,Deployment/Toolchains when we set external Compiler (the "make", "C Compiler" and "C++ Compiler" are not changed - is it ok?)
4) tests new Compiler - does it use flags and paths defined in CMakeLists.txt?

Some of my experiments gave (unexpected) result of accepting by CLion of include_directories() - but the Compiler was not accepted. Sometimes vice versa.

1

请先登录再写评论。