[CMake] Hi and some newbie questions
Mathieu Malaterre
mathieu.malaterre at gmail.com
Fri Sep 14 08:28:40 EDT 2007
On 9/14/07, wim van hoydonck <wim.van.hoydonck at gmail.com> wrote:
> On 9/14/07, Jack Kelly wrote:
> > Goswin von Brederlow wrote:
> > > Jack Kelly writes:
> > >> # One way would be to have a file i486.cmake:
> > >> SET(ARCH i486)
> > >> # and whatever else...
> > >
> > > And cmake automatically includes the right file then?
> > >
> > >> # A file called x86_64.cmake:
> > >> SET(ARCH x86_64)
> > >> # ...
> > >>
> > >> # Put this in the CMakeLists.txt:
> > >> INCLUDE(${PLATFORM})
> > >>
> > >> # and invoke cmake like so:
> > >> # cmake -DPLATFORM=x86_64 /path/to/build
> > >
> > > That would be stupid. It should know itself what architecture to pick.
> > I agree, but I can't see a way to let CMake do that. Anyone else have
> > any ideas? If you were on a *ix system you could FIND_PROGRAM a copy of
> > config.guess and parse its output. Yuk.
>
> On a Unix-like OS, you can execute "uname -m" to get the machine
> architecture (but this is probably not really portable to M$...):
>
> EXECUTE_PROCESS(COMMAND uname -m
> RESULT_VARIABLE UNAME_RESULT
> OUTPUT_VARIABLE MACHINE_ARCH)
How about:
CMAKE_SYSTEM_PROCESSOR
2 cents,
--
Mathieu
More information about the CMake
mailing list