[CMake] Semantics of CMAKE_SYSTEM_PROCESSOR

Hendrik Sattler post at hendrik-sattler.de
Sun Jun 29 09:10:56 EDT 2008


Am Mittwoch, 25. Juni 2008 20:36:09 schrieb Alexander Neundorf:
> On Wednesday 25 June 2008, Andreas Pokorny wrote:
> > Hi there,
> > I am back from india, and now back into maintaining cmake for our
> > project(s). Today I came across a problem regarding
> > CMAKE_SYSTEM_PROCESSOR. As I understood platform definition files are
> > supposed to set this value. The documentations says here:
> >   On systems that support uname, this variable is set to the output of
> > uname -p,
> >   on windows it is set to the value of the environment variable
> >  PROCESSOR_ARCHITECTURE
> >
> > But uname -p and PROCESSOR_ARCHITECTURE do not really match.
> > I.e. the cmake value will be x86 on windows, and i686 in linux, or maybe
> > i486 depending on the distribution. In cygwin uname is supported, but for
> > some reasons it returns unknown.
> >
> > I think in most cases the user needs a coarse information like x86
> > x86_64 or arm. Then maybe in an additional variable the processor
> > generation like i686 or armv4  .. and so on.
>
> The modules which come with cmake don't actually use it AFAIK (not sure
> about the cpack packaging files), so it shouldn't matter too much.
> It can be used when cross compiling to be able to have more fine-grained
> control regarding the target platform and to be able to supply specialized
> files for it.

Additionally, you usually do not want to know the system processor of the 
build system but the system processor of the target system (the system that 
you build for). Even when not (really) cross-compiling, this can be totally 
different.
It's better to ask the compiler what it compiles for.

HS


More information about the CMake mailing list