[CMake] Re: [vtkusers] OSX universal binaires for VTK, cmake , ITK

Bill Hoffman bill.hoffman at kitware.com
Tue Jan 30 15:54:21 EST 2007


Mike Jackson wrote:
> Sean will chime in pretty quick but basically since CMake uses 
> compilations to test things like endian then you run the risk of 
> creating binaries that will not work. At the moment I build each type 
> (PPC or Intel) on their respective machines then lipo them together on 
> one of the machines. This is very labor intensive to do it this way 
> but seems to be the only way to get the binaries to work right.
>
> Sean may have more..
VTK should be changed to support the mac universal binaries.   In 
vtkConfigure.h.in this line:
#cmakedefine VTK_WORDS_BIGENDIAN

IT should be chanced to this:

#ifndef __APPLE__
#  cmakedefine VTK_WORDS_BIGENDIAN
#else
#ifdef  __BIG_ENDIAN__
#  define VTK_WORDS_BIGENDIAN
#endif

That should fix the problem, and allow for universal binaries to be 
created.   The other issue is the SIZEOF stuff.  Same sort of thing can 
be done with that.

Basically, vtkConfigure.h.in needs to have a large ifdef __APPLE__ 
section that hard codes, or otherwise sets defines to the right values 
based on built-in defines from the compiler and not the results of 
try-run tests.

If someone can test this and create a patch for vtkConfigure.h.in I will 
put it in VTK.

-Bill







More information about the vtkusers mailing list