Posts Tagged ‘Xcode’

Boost and Xcode, united through CMake

Friday, May 7th, 2010

A while back I complained about my problems with developing applications using Boost in Xcode.  Between then and now I had a long period where I couldn’t even get Boost compiled on my Mac.

Now, however, I’ve found that there is a CMake based distribution of Boost.  This is great since CMake can Xcode projects directly, which makes it easy to make sure the libraries build will work with projects I make directly in Xcode.  Which incidentally is also why I was happy to see Bio++ move to CMake.

My only problem now is that I have a bunch of old software based on Automake that uses Boost.  They don’t seem to play well together on my Mac.  I should port those to CMake, but first I need to learn how to use CMake, and time is not something I have plenty of at the moment.  Maybe this should be a project for the summer holiday.

Does anyone know of any scripts that can assist me in converting Autoconf/Automake configurations to CMake?

Installing with CMake and Xcode, again, again

Monday, September 21st, 2009

Ok, I have finally figured out why I had problems with xcodebuild most of today.

I use the Xcode project files built from CMake, and I was expecting

$ xcodebuild -configuration Release install

to install my libraries — since it looks like that is what I’m asking it to — or at least complain if I did something wrong.  Apparently there is nothing wrong with that command line, it just doesn’t install my libraries.  It builds them ok, but it doesn’t install them.

What I wanted to run was

$ xcodebuild -configuration Release -target install build

that builds the install target that then installs the libraries.

264-296=-32

Building DocSets

Friday, September 11th, 2009

Ok, I figured out how to build the docsets now.  Wasn’t really that hard.  Doxygen really does all the work, if you only tell it to.

You have to enable the docset generation and tell Doxygen the name of the documentation and the name of the bundle:

Something like this in the Doxygen file:

GENERATE_DOCSET        = YES
DOCSET_FEEDNAME        = "Bio++ NumCalc"
DOCSET_BUNDLE_ID       = bpp.NumCalc

Then when you run Doxygen it will generate a makefile in the html directory, and if you run make install there it will create the bundle and install it.

To  automate this in Xcode you can pick the apidoc target and add a Run Script.

Add run scriptRename it to something sensible if you want

Rename scriptJust add “cd html && make install” as the script

The scriptand when you build the target the docset bundle gets installed.

Installed bundlesI had to restart Xcode before they showed up in the Developer Documentation, though, but now they are there:

Developer documentationIt is only the NumCalc library that really has a nice title there, but that is because it is the only one with a long project name in the Bio++ doxygen files, so not really a failing of this docset build.

I don’t know how to change the Unknown Publisher heading, though.  I have no idea where to put a publisher.

Now I just have one problem left.  The documentation doesn’t show up in the Quick Help dialogue which I had hoped it would.  It doesn’t seem like Xcode links the documentation bundle with the code at all, which is a bit disappointing.

It does find the relevant information if I highlight a symbol and ask the Help menu for the documentation, so that at least is something.

254-279=-25

Distributed builds in Xcode

Thursday, September 10th, 2009

Yeah!  After the upgrade to Snow Leopard, I even got the distributed builds in Xcode up and running, so now I’m compiling on four cores (two in my iMac and two on my macbook), not just the two on the machine I’m sitting with.

Distributed build screenshot

Neat!

Earlier I had some problems with this due to different builds of the compilers on the two machines, but now it works.

Of course, I’m not sure if it is even faster to compile this way, with the network overhead and all, but it is nice to see it working at least.

253-277=-24

Installing from CMake+Xcode

Thursday, September 10th, 2009

Ok, I solved the first problem from my previous post, i.e. installing a library from the Xcode project generated by CMake.

The trick is to pick the install target, select the PostBuild rule and select Get Info:

Xcode screenshotthen just add “sudo” to the command there:

sudo screenshotI am not sure if this works if you haven’t run sudo recently, ’cause I don’t know how it will react if it needs to ask for a password, but if you have run sudo recently it should work. Works for me, anyway.

Oh, and you probably want to build the Release version of the target first.  I’m not sure if it will do this for you either, but I had it already compiled when I tried this.

Still haven’t figured out how to build the Documentation Set yet, but I will look into it next time I have the time.

253-276=-23