[CMake] Detect 32 bit build on a 64 bit system

Andreas Pakulat apaku at gmx.de
Tue Sep 29 14:11:03 EDT 2009


On 29.09.09 11:23:46, Clinton Stimpson wrote:
> On Tuesday 29 September 2009 11:00:56 am James Bigler wrote:
> > Is it possible to detect a 32 bit build on a 64 bit system.
> >
> > I know I can look at the CMAKE_SIZEOF_VOIDP to determine the bitness
> > of the build, but that can't tell me if I'm on a 64 bit linux system.
> > Is there another mechanism?
> >
> 
> Maybe execute "uname -m" and see if its "x86_64."

If the build is 32bit than that might return i686 or something similar.
At least here I need to explicitly do setarch i386 for some projects to
have them compile in 32bit mode instead of 64bit as I have a 32bit
userland (but a 64bit kernel).

Andreas

-- 
You two ought to be more careful--your love could drag on for years and years.


More information about the CMake mailing list