arduino-cmake / Arduino-CMake-NG

CMake-Based framework for Arduino platforms
MIT License
138 stars 39 forks source link

On Linux, if the PATH includes $ARDUINO_SDK_PATH, examples fail to make #58

Closed glowmouse closed 5 years ago

glowmouse commented 5 years ago

On Linux, if the PATH includes $ARDUINO_SDK_PATH, examples fail to make

To reproduce:

  1. Add $ARDUINO_SDK_PATH to the linux PATH. This is something you might do if you still want to run the default arduino sdk.
  2. from $ARUINDO_SDK_PATH/build, run cmake -D CMAKE_TOOLCHAIN_FILE="../cmake/Arduino-Toolchain.cmake" ../examples
  3. run make

The error I see is

[ 35%] Building CXX object arduino-library/CMakeFiles/Ethernet.dir/home/andrew/software/arduino-sdk/arduino-1.8.7/libraries/Ethernet/src/Dhcp.cpp.obj In file included from /home/andrew/software/arduino-sdk/arduino-1.8.7/libraries/Ethernet/src/Dhcp.cpp:7:0: /home/andrew/software/arduino-sdk/arduino-1.8.7/libraries/Ethernet/src/utility/w5100.h:18:17: fatal error: SPI.h: No such file or directory

I have a fix that I'll pull request. Disclaimer - I'm new to CMAKE and Ardunino-CMake. I don't know if my fix is the best way to do this.