[CMake] Re: [vtkusers] OSX universal binaires for VTK, cmake , ITK
David C Thompson
dcthomp at sandia.gov
Tue Jan 30 16:42:25 EST 2007
On Tue, 2007-01-30 at 16:03 -0500, Mike Jackson wrote:
> On Jan 30, 2007, at 3:54 PM, Bill Hoffman wrote:
> > 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.
> So if we #ifdef special case for Apple then what about the guy on a
> linux intel box trying to cross compile for Linux PPC? Would he have
> the same problems? Isn't this becoming a cross compile issue?
FYI, on Linux this test would be
#include <endian.h>
#if __BYTE_ORDER == __BIG_ENDIAN
# define VTK_WORDS_BIGENDIAN
#endif
However, I don't think endian.h is a POSIX standard, so it could define
different things on different platforms and thus could break
VTK_WORDS_BIGENDIAN on those platforms. Also, if someone were
cross-compiling for a different architecture, VTK's TRY_RUN commands
would fail, so there's more than just changing the byte order to be
done.
David
More information about the vtkusers
mailing list