[CMake] Detecting linux distro?
Andreas Schneider
mail at cynapses.org
Mon Mar 3 16:43:50 EST 2008
Kedzierski, Artur CIV NSWC Corona, PA53 wrote:
>
> I had to do that too. I ended up going by distribution-specific
> file in /etc. For example,
> Red Hat: /etc/redhat-release
> Slackware: /etc/slackware-version
> Slamd64: /etc/slamd64-version
> To determine whether it is 64-bit vs 32-bit Red Hat, I use
> 'uname -m'.
>
uname -m is a bad idea. If you compile a 32bit application in a chroot system
on a x86_64 system. Then uname -m will return x86_64 and not i386.
You should use:
if (CMAKE_SIZEOF_VOID_P MATCHES "8")
endif (CMAKE_SIZEOF_VOID_P MATCHES "8")
-- andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : http://public.kitware.com/pipermail/cmake/attachments/20080303/a1cb284f/signature.pgp
More information about the CMake
mailing list