[CMake] Compiling universal binaries for Mac OS X

Sean McBride sean at rogue-research.com
Mon Nov 14 10:51:17 EST 2005


On 2005-11-11 19:11, Brad King said:

>Jaroslav Snajdr wrote:
>> We use CMake to build our software on Mac OS X and right now we are 
>> trying to port the program to the Intel Mac platform. Apple has support 
>> for creating so-called universal binaries. I compile one executable for 
>> PPC, one executable for Intel and finally I merge them into one file 
>> (universal binary) with Apple-supplied "lipo" utility.
>> 
>> Is there any support in CMake for this kind of build process? Is anyone 
>> else on this list also going to build universal binaries for Mac OS X? 
>
>As far as I know this has not been done before with CMake.  How do you 
>plan to build the per-architecture executables?  Can they all be built 
>on the same machine with different compiler flags?  If so then you will 
>want to create one build tree per architecture.  Once all the 
>executables are built you can use the tool to combine them yourself. 
>This could be done in a shell script or in a "cmake -P" script.

I would also like to see this working with cmake, as I will one day need
to build vtk as a universal binary.  I haven't tried yet.  But Brad, the
answer is yes, both ppc Macs and intel Macs can build executables for
one another or a universal binary as Jaroslav described, by changing
compiler flags.  Apple has a long doc on porting here:

<http://developer.apple.com/documentation/MacOSX/Conceptual/
universal_binary/index.html>

and a shorter doc, that is probably more relevant to cmake here:

<http://developer.apple.com/technotes/tn2005/tn2137.html>

I suspect it will be quite easy for cmake to support!

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada




More information about the CMake mailing list