Geo-preneur - Debugging Makefile-based projects using XCode...
http://blog.burhum.com/post/35555678746/debugging-makefile-based-projects-using-xcode
january 2017 ‧ autoconf gnu linux mac make xcode ‧ open in karakeep
Karakeep has no AI summary for this page yet. summarize now
I love using XCode to write C++. Nevertheless, many of the projects I use a lot (like GDAL) don’t maintain XCode projects. Compiling these type of projects usually is usually done with autoconf and GNUMakefiles. The usual workflow takes this form from the command line: ./configure ./make ./make install But what if I want to use XCode? Here is a quick way I use to get up and running with XCode 4.5.2 Let’s use GDAL as an example. Create a new XCode project 1.- File->New Project 2.- Choose Application -> Command Line Tool. Call it something meaningful like gdal-trunk (uncheck use automatic reference counting). 3.- Delete the Target Checkout the version you want from GDAL and compile it with debug First, we need to make sure that our project is compiled with the -g flag so debugging information is included. For GDAL, this is accomplished with the –enable-debug flag. Personally, I also like to keep my debug build separate from the rest of my system. So I also specify a build directory using the –prefix flag. These are the commands I use in the command line: svn checkout https://svn.osgeo.org/gdal/trunk/gdal gdal cd gdal ./configure --enable-debug --prefix=/Users/rburhum/src/gdal-xcode/gdal-trunk/build make make install Setup XCode to show GDAL source and call the makefile every time we build 1.- While highlighting the project: File->New Taget. Under OSX -> Other, choose “External Build System”. Pick a target name like “gdal_target”. Finish. 2.- Click on the new target, select info. Make sure the directory there has the root directory that has your makefile. In my case /Users/rburhum/src/gdal-xcode/gdal 3.- Product->Edit Scheme. Under Build->Build hit the “+” and add the new target you just created.
This will make sure that make gets called. But with GDAL, you will need to have the code installed again after every compilation (a different topic for another day). So we will need to trigger that behavior: 4.- Under Post Actions, add the following script: cd /Users/rburhum/src/gdal-xcode/gdal /usr/bin/make install Setup XCode to call the executable you want to debug Almost there! The last step missing is to add the executable you want to debug. Let’s say that it is ogrinfo. While still on the Edit Scheme window. Choose Run. Under Info, browse and pick ogrinfo from your build directory. Under Arguments, choose whatever you may want to pass to ogrinfo (in my case: -al /Users/rburhum/Applications/geoserver-2.1.3/data_dir/data/nyc/poi.shp Add the GDAL source tree to XCode Right click on your Project and Choose “Add files to gdal-trunk”. Make sure you choose “Create Folder References” and that “Copy items into destination folder” is unchecked. Browse to the root of the GDAL directory and pick it. You are done! Put your breakpoints, change your code and whenever you hit run/debug, XCode will compile the new code and run it inside XCode.
*bookmark *download *tobuy *todownload *tofollow *toread *towatch *wishlist 2d 360 3d 3ds 3g 8080 abandonware accounting actionscript adapter addin adhoc adventure air airbnb airplay alemanha algorithm android animation api app apple appletv appstore arcade architecture archive arduino aria2 art article asm assembler atcommand audio autolayout automation aws baby backend backlight backup bank bbs beer berlin bezier bios bitcoin bivert blipfm blipster blog blu-ray bluetooth bluray bonjour book bookmark bootcamp boxee brasil brazil breaks bruno bug bugtracking build buildapc business c c# c++ canada capacitors car carro casa case cave cdx cell chart cheat chiptune cliq cms cocoa cocoa-touch code codec collection component console control controller cookie cooking cooler core-animation core-audio core-data core-graphics coreaudio corporate couchpotato course covid crack crt crypto css cubic-bezier curitiba curso cv cydia database dataservices ddwrt debug decompiler deconz degrafa demoscene design designpatterns designsystem deutsch deutschland dev developer development disassemly diy dj dlna dns dnsmasq doc docker docs documentation dos dosbox dotnet download dreamcast drink driver drm ds ds-lite dvb-c dvd ebook electronics emu emudev emulator engine entrepreneurship epg eprom epub erp example exploit facebook famicom faq feedbin fightstick figma filetype:pdf finances firebird firetv firmware fix flash flashcart flex flexvizgraphlib fluorine fm font forum framework free freelance freeware gabinete gadget game gameboy gameboy-pocket gamecube gamedesign gamedev gamegear gamegenie games gba gdb genesis german germany ghidra git gnu google googlemaps GoogleReader gps gpu graph gsm gui guide hack hackintosh hacks hamburg hardware harmony hassio hd hdmi hdpvr health healthinsurance home home-automation homeassistant homebrew honda hosting hotel howto html htpc http icecast icon IFTTT ikea im image imported indie indiegame info inspiration install insteon internet interview investimento ios ios7 ipad iphone ipod iptv ir irblaster irpf isdb iso itunes j2me jailbreak jantar japan java javascript job json keyboard kodi language last.fm lastfm lcd learning lg lib library light linux liquidsoap live lldb localization london lua mac macos make mame management manual mapkit maps mastersystem math mce media media:document mediacenter mediaserver megadrive memory-management memorycard miami microsim midi mister mms mobile mobilesubstrate mod modchip models modem monitor monogame mopidy motorola movie movies mp3 mpd msn mtu multiroom music mysql mythtv nas nds neogeo nes net network nointro nvidia nyc objective-c opcode openal opengl opengles opensource openvpn opl os osx pal paper parts pc pcb pcengine pci perlerbeads peugeot phone photo photoshop php physics pico8 piracy plex plugin Pocket pokemon portfolio poster prepaid profiling project protocol provisioning proxy ps1 ps2 ps3 ps4 psp puremvc push pvm pvr python raspberrypi rc recalbox receita recipe recover redump regex region regionlock remote repair repro research resource restaurante retrogaming retrograming retropc retropie retroprogramming review rgb rip riser rockband rom romhack roms router rpg rsync ruby rubyonrails sample saopaulo saturn scart scrape script scumm sdk sdl security seedbox serial server service setup shipping shmups shop shopping shoutcast sign silencio sim skinning sms snes softmod software sonos soulseek sound soundblaster soundtrack source specs spline spotify spritekit sql sqlite star startup steamdeck stick store stream subtitles subversion svn swift swiftui swing switch switchless sync synology synth tasker tax tech terminal test tether theme theos thinclient thread threads three20 tickets timezone tips titles tobuy tokyo tool tools toread torrent toy tracker travel trip tshirt tutorial tv tweak twitter ubiquiti ubuntu ui uifont uikit uitableview uiview unity unix unlock upload upnp uremote usa usb utorrent ux veralite viagem video vinyl visa vista visualization visualstudio vita vpn vps vr vst walkthrough wallpaper warez wdtv web web2.0 webdesign webdev webradio webservices wifi wii wiiu windows wishlist wordpress xbla xbmc xbox xbox360 xcode xml xna youtube z-wave z80 zigbee