Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to configure CLion Project #132

Closed
bkuberek opened this issue Mar 22, 2015 · 18 comments
Closed

How to configure CLion Project #132

bkuberek opened this issue Mar 22, 2015 · 18 comments
Assignees
Milestone

Comments

@bkuberek
Copy link

Apologies if this is the wrong place to ask this question but I am trying get my current platformio project working on CLion.

I have a working platformio project that is getting bigger and difficult to manage and I was hoping to use CLion IDE. Any help is appreciated.

@ivankravets
Copy link
Member

You can integrate PlatformIO into any IDE. Which type of problem do you have? From CLion site:

CLion supports the well-known CMake build system

You can replace built-in cmake system with platformio run command. Could I ask you to write an article about it and I will place it to main PlatformIO documentation?

Thanks in advance!

@ivankravets ivankravets changed the title How to configure CLion Ptoject How to configure CLion Project Mar 22, 2015
@ivankravets
Copy link
Member

Here is interesting example how to replace built-in Eclipse builder with PlatformIO: Building and debugging Atmel AVR (Arduino-based) project using Eclipse IDE+PlatformIO

@aphelps
Copy link

aphelps commented Mar 22, 2015

I'd be interested in any results on this as well, I use IntelliJ regularly and have considered trying out CLion. If it supports a any standard makefile system you could always put together a config that mapped to platformio commands, if CLion doesn't let you do that directly within its preferences.

@ivankravets
Copy link
Member

Friends,

Who can help PlatformIO with short manual with pictures how to configure CLion and PlatformIO? It can be any format: PDF/DOC/RTF/etc., then we will convert it to RST and put to core documentation with preserving author's rights.

We could do it, but you can see how much issues we have opened. In this situation I want to concentrate our forces to the new features for PlatformIO.

@bkuberek
Copy link
Author

This is the first time I do something with C/C++ and I am still wrapping my head around basic concepts. I would gladly contribute this write up if I could figure it out on my own. I hope someone has already gone through the trouble and could share their setup.

For now I was able to get IntelliJ Ultimate with C/C++ plugin to give me basic editing help. I had to add the following paths to the C++ project settings:

# Additional include directories
/Users/bkuberek/[...]/RevoBotController/lib/Ultrasonic;
/Users/bkuberek/[...]/RevoBotController/lib/nanopb

# Additional system include directories
/Users/bkuberek/[...]/RevoBotController/.pioenvs/arduino_mega2560/FrameworkArduino;
/Users/bkuberek/[...]/RevoBotController/.pioenvs/arduino_mega2560/FrameworkArduinoVariant;
/Users/bkuberek/.platformio/packages/framework-arduinoavr/cores/arduino;
/Users/bkuberek/.platformio/packages/toolchain-atmelavr/avr/include

[line breaks added for clarity]

@ivankravets ivankravets assigned valeros and ivankravets and unassigned valeros Mar 25, 2015
@ivankravets
Copy link
Member

@valeros has tried to configure CLion with PlatformIO, but didn't received any results. They don't allow to redefine own builder. I've just posted the comments to their issues tracker:

https://youtrack.jetbrains.com/issue/CPP-871#comment=27-960431

Here is explanation by CLion owners: http://blog.jetbrains.com/clion/2014/09/cmake-vs-the-others-round-1/

@bkuberek
Copy link
Author

thanks for the update

@jimbojsb
Copy link

Just tried this feature out, seems like it generates a solid CMakeLists.txt but trying to build from inside clion pops a dialog asking for an executable. It seems like I can specify any old executable (i picked the platformio file). The build will then be allowed to run, and it definitely uploads the code to my board, but it then replaces the output on the console with the standard "platformio" help message. Also, when importing the project that platformio generates, every file except CMakeLists.txt is "grayed out" in the project pane, as in CLion doesn't think it's part of the project. It also doesn't seem to be aware of the standard arduino library for purposes of auto-complete. Thoughts?

@ivankravets
Copy link
Member

@jimbojsb which PlatformIO version do you use? I've just re-tested it under Mac. See my results:

PlatformIO integration with CLion IDE

I used this example: https://github.com/platformio/platformio/tree/develop/examples/wiring-blink and this command:

platformio init --project-dir examples/wiring-blink --ide clion -b uno

As for "auto-complete" - see explanation in Warning block: http://docs.platformio.org/en/latest/ide/clion.html

@voneiden
Copy link

I got auto complete working by setting include_directories as absolute paths and adding a line like

add_executable(Test src/test.cpp)

@ivankravets ivankravets modified the milestones: 2.3.4, 2.2.1 Oct 12, 2015
@ivankravets ivankravets reopened this Oct 12, 2015
@ivankravets ivankravets assigned ivankravets and unassigned valeros Oct 12, 2015
@ivankravets
Copy link
Member

Dear friends,

Please re-test full support of CLion IDE in the latest development version http://docs.platformio.org/en/latest/installation.html#development-version

Waiting for your feedbacks.

@ivankravets
Copy link
Member

@voneiden thanks a lot for the hint! 👍

@voneiden
Copy link

@ivankravets Nice, no problem.

@averri
Copy link

averri commented Nov 9, 2016

I have followed all the documentations, and this is what I get:

image

@arjunsarin
Copy link

I am having the problem that Clion doesn't resolve my own library in the lib folder, platformio created. platformio run works quite well without any error but I cannot use the code completion from the IDE because the editor displays me the error: Cannot find Foo.h which I include in my mainProgram.c which is in the src folder.

Can someone help me, please? Thanks in advance.

@ivankravets
Copy link
Member

@earliestearl see docs http://docs.platformio.org/en/stable/ide/clion.html

The libraries which are added, installed or used in the project after generating process wont be reflected in IDE. To fix it please run PLATFORMIO_REBUILD_PROJECT_INDEX target.

@arjunsarin
Copy link

@ivankravets Sorry, I should have read the instructions more carefully. But thank you so much for your fast and good reply. Now, everything's working. Thanks for your great work, PlatformIO!

@ivankravets
Copy link
Member

@earliestearl Would be thankful for a star ⭐️ https://github.com/platformio/platformio/stargazers and don't forget to follow us on https://twitter.com/PlatformIO_Org

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants