[cmake-developers] Reworking SystemInformation

Rolf Eike Beer eike at sf-mail.de
Sat Nov 6 15:32:14 EDT 2010


I wanted to have a look if I could fix one of my bugs (0010895: Processor 
detection is very x86-specific). What I found was some things in kwsys classes 
I'm not sure about.

First there is a bunch of files that have trailing whitespaces over and over 
which seems rather randomly scattered over the files. I did

 for i in *; do sed 's/[ \t]*$//' -i $i; done

which lead to the attached patch (0001).

Next I found a thing called testSystemInformation.cxx. Looks like it is a  
program to debug the SystemInformation class. It is the only user of some 
things like DoesCPUSupportCPUID(), GetProcessorAPICID(), and 
DoesCPUSupportFeature() from that class. What about just kicking them out? 
AFAICT this is Windows-only stuff so this is pretty useless on nearly all 
architectures anyway. I just deleted some of them and it still compiles 
without problems so I don't see any problems (patch 0002).

The next thing is the root cause of the above bug: nearly everything in that 
class is centered around Intel like CPUs. While that is indeed the majority of 
the platforms that use CMake (at least in numbers of users) this makes support 
for other CPUs a bit harder. E.g. storing the processor family as integer 
makes sense on x86 as it's encoded this way there but what /proc/cpuinfo on my 
C3600 prints as family id is "PA-RISC 2.0" which doesn't fit in an integer at 
all. I would like to rework that so the transition from integer to string is 
done immediately on query and the string is stored also on x86 so non-x86 
would work without any further action at least on Linux.

Comments?

Eike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-remove-unused-members-of-SystemInformation-class.patch
Type: text/x-patch
Size: 7698 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20101106/753533eb/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-remove-trailing-whitespace.patch
Type: text/x-patch
Size: 133190 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20101106/753533eb/attachment-0005.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20101106/753533eb/attachment.sig>


More information about the cmake-developers mailing list