queezythegreat / arduino-cmake

Arduino CMake Build system
648 stars 216 forks source link

problem ubder os x #35

Closed djtal closed 12 years ago

djtal commented 12 years ago

HI,

I've just found your project.

While trying to use it I encounter some problems :

Here what i do ;

Dowlnloaded Arduino.App from main site an place it under /applications

clone you repo and follow the geeting started instruction but the I can complete thme.

$ mkdir build
$ cd build
$ cmake ..

I get the follwing error :

-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at cmake/Platform/Arduino.cmake:1382 (message):
  Could not find Arduino SDK (set ARDUINO_SDK_PATH)!
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/2.8.7/share/cmake/Modules/CMakeSystemSpecificInformation.cmake:36 (INCLUDE)
  CMakeLists.txt:17 (project)

CMake Error: your C compiler: "avr-gcc" was not found.   Please set CMAKE_C_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "avr-g++" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
-- Configuring incomplete, errors occurred!

after that tryin to customize the CMakeList.txt like

#=============================================================================#
# Author: QueezyTheGreat                                                      #
# Date:   26.04.2011                                                          #
#                                                                             #
# Description: Arduino CMake example                                          #
#                                                                             #
#=============================================================================#
set(CMAKE_TOOLCHAIN_FILE cmake/ArduinoToolchain.cmake) # Arduino Toolchain

cmake_minimum_required(VERSION 2.8)

set(ARDUINO_SDK_PATH /Applications/Arduino.app/Contents/Resources/Java)
set(ARDUINO_SDK_VERSION 1.0)
#====================================================================#
#  Setup Project                                                     #
#====================================================================#
project(ArduinoExample C CXX)

add_subdirectory(example)  # Add example directory to build

but another error a raise

-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at cmake/Platform/Arduino.cmake:1457 (message):

  Missing ARDUINO_AVRDUDE_PROGRAM!

  Invalid Arduino SDK path
  (/Applications/Arduino.app/Contents/Resources/Java).

Call Stack (most recent call first):
  /usr/local/Cellar/cmake/2.8.7/share/cmake/Modules/CMakeSystemSpecificInformation.cmake:36 (INCLUDE)
  CMakeLists.txt:18 (project)

CMake Error: your C compiler: "avr-gcc" was not found.   Please set CMAKE_C_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "avr-g++" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
-- Configuring incomplete, errors occurred!

Any hints to solve theses errors ?

Thanks

Guillaume

queezythegreat commented 12 years ago

Hi, it looks like avrdude binary was not found... Try to manually set the path (via ARDUINO_AVRDUDE_PROGRAM). For example: cmake -DARDUINO_AVRDUDE_PROGRAM=/path/to/avrdude ../path/to/sources

I haven't tested the recent changes on any platforms other than Linux. I'll try the latest version of Arduino CMake on my Mac when I have some time. BTW the avrdude binary should be within the Arduino.app.

queezythegreat commented 12 years ago

Hi, so it appears that the changes tha I have made recently don't quite fully work on Mac OS X. Fortunatly the fix was very easy (just had to move some things into the toolchain file) :) The latest version should work now.

I'm closing this ticket for now, but if you have more problems please reopen it.

djtal commented 12 years ago

hey big thanks I've got no errors now.