queezythegreat/arduino-cmake — Issue #14: Error in avrdude arguments
Author: treaves
Created: 2012-01-11 22:45:16+00:00
State: open

When I run the xxx-upload target, it fails with:
avrdude: can't open config file "/usr/local/etc/avrdude.conf": No such file or directory
avrdude: error reading system wide configuration file "/usr/local/etc/avrdude.conf"

It should not be looking there. So I looked in the cache file, and the avrdude.conf file is actually found at:
CMakeCache.txt:ARDUINO_AVRDUDE_CONFIG_PATH:FILEPATH=/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf

I was able to track down the issue to the AVRDUDE_ARGS variable. In the generated make file, the command is:
src/CMakeFiles/blink-upload: src/blink.elf
cd /Users/treaves/Development/qp/blink/builds/unix/src && /Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude AVRDUDE_ARGS -C\ /Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -patmega328p -carduino -b115200 -P/dev/tty.usbmodem1d11 -D -V -Uflash:w:blink.hex

As you can see, the variable name itself is inserted in to the arg list.