The toolchain was created and tested within the following environment:
Linux
Windows XP
Windows 7
OS X
Note:
If building in a Windows environment, you need to extent the values of the
environment variable PATH
to the location of the binaries, especially to
find make
. To enable a more general approach to different Windows toolchains,
the variable AVR_FIND_ROOT_PATH
needs to be defined. Tested was it with the
following setup (XP):
PATH=...;d:/Program Files/Atmel/Atmel Studio 6.0/extensions/Atmel/AVRGCC/3.4.1.81/AVRToolchain/bin;...
AVR_FIND_ROOT_PATH="d:/Program Files/Atmel/Atmel Studio 6.0/extensions/Atmel/AVRGCC/3.4.1.81/AVRToolchain/avr"
Issue within Windows 7 environment
With Windows 7 (64bit) and the Atmel Studio 6.2 setup, make.exe
now resides
differently. It also crashes during the cmake generation process, just after the
simple examples to test the compiler (try_compile(...)) ran through. The why and
avoidance of this is currently unknown to me. I didn't try to use a cygwin make
as
a substitute yet.
After getting the project
git clone git@github.com:mkleemann/cmake-avr.git /path/to/clone/in
you just need to run the following commands
mkdir -p /path/to/some/build/dir
cd /path/to/some/build/dir
cmake -DCMAKE_TOOLCHAIN_FILE=/path/to/clone/in/generic-gcc-avr.cmake /path/to/clone/in/example
make
For Windows use:
cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=/path/to/clone/in/generic-gcc-avr.cmake /path/to/clone/in/example
This just creates the example, but does not upload it. For all possible targets, you need to run
make help
after running the cmake
command.