Hi guys !
Here's my quick guide to set up CLion to work with the Arduino (and others) platforms. Once you get the gist (pun) of it, you should be fine !
Follow the instructions here
# Create new folder YourProject
mkdir YourProject
platformio init -b uno -d YourProject
This will populate the folder YourProject with a src
and lib
folder.
You should have somewhere on your drive the Arduino core library, on Windows I've found it in C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino
. Copy its contents to the lib folder of your project along with the CMakeLists.txt file
If you start having more than one file in your src folder, you'll need to add them to the src CMake file.
CMake is a bit tricky to get at first, but it's a really powerful tool, and cross platform. With this setup you'll be able to develop on Windows and as well on Linux and OSX.
Open CLion and select "Import Project from Sources" and pick your newly created project. Once in the IDE, create a new Run configuration:
You will need to find the platformio executable and set it.
Enjoy !
It's possible to have a basic test project that's follow this config ? Cause I try to follow the step (on Mac) and it have compile errors