- This firmware is using CMake based build system.
- This firmware is designed to run on Arduino Leonardo (or analog) boards.
- This instructions is only for CLion running under macOS.
- Clone Arduino-CMake-NG repository.
- Set
ARDUINO_CMAKE_TOOLCHAIN_PATH
environment variable with the cloned repository path (it should be something like$HOME/Github/arduino-cmake/Arduino-CMake-NG
). - Locate AVR Tools (on macOS it is most likely located in
/Applications/Arduino.app/Contents/Java/hardware/tools/avr
) - Set
ARDUINO_AVR_PATH
environment variable with absolute path to AVR Tools directory. - Locate your connected Arduino Leonardo board port (it should be something like
/dev/cu.usbmodem145101
). - Set
UPLOAD_PORT
environment variable in CMake settings to board port you've just found out. - Follow toolchain manual
and pass the following argument to CMake:
-DCMAKE_TOOLCHAIN_FILE=${ARDUINO_CMAKE_TOOLCHAIN_PATH}/Arduino-Toolchain.cmake
.
This project is using Arduino-CMake-NG toolchain o build and upload firmware to target device. In fact upload is kind of broken for Leonardo class of devices but workaround is implemented.
On macOS you should modify your terminal profile to keep your environment variables set in any new terminal session.
This can be done by adding this line export SOME_ENV_VALUE="/Some/Value/Meaning"
to ~/.bash_profile
or ~/.zshrc
depending on terminal you are using.
You should restart terminal session (or any other application) for the changes to take effect.
Open Preferences > Build, Execution, Deployment > CMake.
Edit Environment field.