Created
August 30, 2020 10:13
-
-
Save Hexer10/f4197871909964eec1820c4ee6795be6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
message("Found Arduino SDK: ${ARDUINO_SDK_PATH}") | |
## Uncomment if Arduino SDK Path is wrong | |
# set(ARDUINO_SDK_PATH <custom path>) | |
### Edit here | |
set(CLI_PATH <path to arduino-cli.exe) | |
set(FQBN <your fully qualified board name>) | |
set(PORT <your port> | |
### Add subdirectories for IntelliSense & Autocomplete | |
include_directories( | |
# PUT HERE your custom libraries, you need to put the path to the folder which contains the .h and .cpp files | |
# Also make sure to add the library through Arduino IDE | |
${ARDUINO_SDK_PATH}/hardware/arduino/avr/libraries/EEPROM/src | |
${ARDUINO_SDK_PATH}/hardware/arduino/avr/libraries/HID/src | |
${ARDUINO_SDK_PATH}/hardware/arduino/avr/libraries/SoftwareSerial/src | |
${ARDUINO_SDK_PATH}/hardware/arduino/avr/libraries/SPI/src | |
${ARDUINO_SDK_PATH}/hardware/arduino/avr/libraries/Wire/src | |
) | |
### Create custom target | |
add_custom_target(cli-upload | |
WORKING_DIRECTORY ../ | |
COMMAND ECHO Compiling | |
COMMAND ${CLI_PATH} compile --fqbn ${FQBN} | |
COMMAND ECHO Compiling done! Uploading... | |
COMMAND ${CLI_PATH} upload --port ${PORT} --fqbn ${FQBN} | |
COMMAND ECHO Uploading done! | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment