[CMake] Specifying build architectures on Mac OS X (ppc7400 does not work?)

Sean McBride sean at rogue-research.com
Tue May 15 14:13:46 EDT 2007


On 2007-05-07 11:26, Sean McBride said:

>Has anyone tried to build a Universal Binary with the following:
>
>CMAKE_OSX_ARCHITECTURES:STRING=ppc7400;i386
>
>instead of the usual:
>
>CMAKE_OSX_ARCHITECTURES:STRING=ppc;i386
>
>If I do a 'lipo -info' on the build result it tells me "Architectures in
>the fat file: foo.a are: ppc i386".  It should say "ppc7400 i386", which
>I do get when I build with Xcode instead of CMake.
>
>(ppc7400 is for the G4, which is the oldest CPU I want to target, I
>don't care about the G3.)
>
>Anyone else tried this?  Thanks,

Replying to myself... :(

It seems this actually partly works.  Let's say I'm building VTK.  I've
set CMAKE_OSX_ARCHITECTURES:STRING=ppc7400;i386.  I do 'make' and in the
resulting /bin directory are, amongst other files:

CommonCxxTests (an executable)
libvtkRendering.a (a static lib)

If I do 'lipo -info' on each, I learn:

$ lipo -info /Users/sean/kitware/VTK-pristine-bin/bin/CommonCxxTests 
Architectures in the fat file: /Users/sean/kitware/VTK-pristine-bin/bin/
CommonCxxTests are: ppc7400 i386 

$ lipo -info /Users/sean/kitware/VTK-pristine-bin/bin/libvtkRendering.a 
Architectures in the fat file: /Users/sean/kitware/VTK-pristine-bin/bin/
libvtkRendering.a are: ppc i386 
 
Very strange!  It seems that for all executables it is 'ppc7400' as
expected, but for all static libs it is 'ppc'.

Any ideas why??  Thanks,

-- 
____________________________________________________________
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