[CMake] Differentiate between Linux and FreeBSD
Horacio Sanson
hsanson at gmail.com
Tue Apr 22 10:30:31 EDT 2008
I
On Tue, Apr 22, 2008 at 5:49 PM, Pau Garcia i Quiles
<pgquiles at elpauer.org> wrote:
> Quoting Horacio Sanson <hsanson at gmail.com>:
>
>
> > On Mon, Apr 21, 2008 at 7:01 PM, Pau Garcia i Quiles
> > <pgquiles at elpauer.org> wrote:
> >
> > >
> > > Quoting Horacio Sanson <hsanson at gmail.com>:
> > >
> > >
> > > > I can use IF(WIN32) and IF(UNIX) to set some variables depending if
> > > > cmake is executed in Windows or UNIX systems. The problem is that UNIX
> > > > in this context includes both Linux and FreeBSD.
> > > >
> > > > Has CMake a way to know if it is running in a Linux box or a FreeBSD
> box??
> > > >
> > >
> > > Use the CMAKE_SYSTEM_NAME variable:
> > >
> >
> > I tried using this variable but for some reason it seems to be empty
> > (i.e. calling MESSAGE with this var as parameter does not print
> > anything). This happens in both Linux (Kubuntu 7.10) and FreeBSD 7.1.
> >
> >
>
> It works for me:
>
> MESSAGE( STATUS "Platform: " ${CMAKE_SYSTEM_NAME} )
>
> outputs
>
> -- Platform: Linux
>
> What version of CMake are you using?
>
I have the version that comes default with Kubuntu Gutsy, (2.4.7-1).
Could you provide an example using the IF/ELSE functions??
thanks
Horacio
> --
>
> Pau Garcia i Quiles
> http://www.elpauer.org
> (Due to my workload, I may need 10 days to answer)
>
>
More information about the CMake
mailing list