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

Comments

Projects
None yet
8 participants
@bkuberek

bkuberek commented Mar 22, 2015

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

This comment has been minimized.

Member

ivankravets commented Mar 22, 2015

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 from How to configure CLion Ptoject to How to configure CLion Project Mar 22, 2015

@ivankravets

This comment has been minimized.

Member

ivankravets commented Mar 22, 2015

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

This comment has been minimized.

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

This comment has been minimized.

Member

ivankravets commented Mar 22, 2015

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

This comment has been minimized.

bkuberek commented Mar 22, 2015

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

This comment has been minimized.

Member

ivankravets commented Mar 27, 2015

@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

This comment has been minimized.

bkuberek commented Mar 28, 2015

thanks for the update

@ivankravets ivankravets added help wanted and removed question labels Jun 19, 2015

@ivankravets ivankravets added enhancement and removed help wanted labels Jul 14, 2015

@ivankravets ivankravets added this to the 2.2.1 milestone Jul 14, 2015

@ivankravets ivankravets assigned valeros and unassigned ivankravets Jul 14, 2015

@valeros valeros closed this in d5c852d Jul 15, 2015

@jimbojsb

This comment has been minimized.

jimbojsb commented Jul 16, 2015

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

This comment has been minimized.

Member

ivankravets commented Jul 16, 2015

@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

This comment has been minimized.

voneiden commented Oct 10, 2015

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

This comment has been minimized.

Member

ivankravets commented Oct 13, 2015

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

This comment has been minimized.

Member

ivankravets commented Oct 13, 2015

@voneiden thanks a lot for the hint! 👍

@voneiden

This comment has been minimized.

voneiden commented Oct 13, 2015

@ivankravets Nice, no problem.

ivankravets added a commit that referenced this issue Oct 13, 2015

@averri

This comment has been minimized.

averri commented Nov 9, 2016

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

image

@earliestearl

This comment has been minimized.

earliestearl commented Nov 11, 2016

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

This comment has been minimized.

Member

ivankravets commented Nov 11, 2016

@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.

@earliestearl

This comment has been minimized.

earliestearl commented Nov 11, 2016

@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

This comment has been minimized.

Member

ivankravets commented Nov 11, 2016

@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