Could you please detail how you reach the result? I've already noticed the HEADER_SEARCH_PATHS parameter, but are there other?
Hey Olivier, my guess is that this should work fine on mpide too, as long as you have Arduino.app installed. Unless Mpide has a lot of functions that are not in Arduino? Anyway it is only for syntax coloring and code completion, it will not affect your build.
IF mpide is not following the arduino conventions, it should be another project anyway, we can't make one XCode project for every flavour of Arduino-style AVR programming, right? Better make a specific project that bases its concepts on the Arduino project.
How does it work? "Serial" is defined in HardwareSerial.h, but only when certain macros have been defined. Those are defined in io.h.
Those macros get defined depending on a macro that defines the arduino board you're using.
So when you pick your board inside the Arduino.app before compiling, it adds a macro that defines your board. For example: __AVR_ATmega168__ . When this is defined, io.h can then load the correct io header for that specific board and the serial communication can get put together correctly.
I have just set __AVR_ATmega8__ in the build settings for the fake target, because for our purposes it doesn't really matter what board the fake target thinks it is building for. (not really sure about this)
While looking through all this, I noticed that a lot of stuff in the Arduino .cpp and .h files depends on inttypes.h, stdlib.h, stdio.h etc..
Just to be sure, I included the ones that avr-g++ uses in the header search paths.
I thought about moving the Arduino group to the header search paths too, but I think you sometimes want to check them for reference...
best,
tim