Go Down

Topic: Arduino on Xcode Project — Official Thread (Read 153 times) previous topic - next topic

timKnapen

oh right, I just checked my makefile and it appears that the problem was this:

INCLUDE_LIBRARIES = $(addprefix -I, $(LIBRARY_PATHS))

somehow by doing the $(addprefix ..) doesn't expand the ~/ in LIBRARY_PATHS.
Just passing a build setting as a single variable does expand the ~/
I'm cleaning that up in my makefile, because ~/ is awesome! :-)

best,
tim.

timKnapen

#96
Jan 24, 2012, 01:42 am Last Edit: Jan 24, 2012, 02:50 am by timKnapen Reason: 1
Hi all,

I think we've finally managed to have code completion working decently on Xcode 4.

The updated project is here:

https://github.com/timknapen/Arduino-With-XCode/tree/experimental/Arduino/ArduinoOnXCode4
This is the 'experimental' branch. I will merge it into the main branch once I get some feedback from other people that can get it to work too.

There is a little trick to it:
You need to add all the sources ( .c, .cpp and .h files) to the 'Compile sources' build phase of the Fake Target. This fake target is only used for triggering the code completion in Xcode 4.

In the project navigator click on your project > Targets > fake target > build phases > expand "Compile sources"
press the "+" button at the bottom and in the list that pops up, just select all your .c, .cpp and .h files.

To add your own libraries, just drag them into the source tree with these options:

You will still have to add the path to those files in the build settings

hope this helps,
tim.

avenue33

Tim,

Great work! Thanks.

In the screen-shot you supply, Serial.print is still in black :(

avenue33

I posted two suggestions on the GitHub issues list:

#3-- Codesense not working all the time in Xcode 3.2
Serial.print() is still in black  :~

#4-- Auto-Launch of the Console
Serial console parameters
Close serial console before upload OK
Open serial console after upload Error: screen /dev/tty.usbmodem641 -b19200 Must be connected to a terminal.
How to make the connection with the terminal?

#12-- User libraries easy declaration
Just type the name of the folder of your library
Example:

  • code: #include "Serial_GP"

  • makefile: USR_LIBRARIES_LIST  = Serial_GPS


timKnapen

#99
Jan 24, 2012, 03:09 pm Last Edit: Jan 25, 2012, 12:39 am by timKnapen Reason: 1

In the screen-shot you supply, Serial.print is still in black :(


Look here: :-)


Latest changes for XCode 4 to be found here:
https://github.com/timknapen/Arduino-With-XCode/tree/experimental/Arduino/ArduinoOnXCode4

Any more code completion that is not working?

Go Up