[CMake] Differentiating between FreeBSD and Linuxs

Eric Noulard eric.noulard at gmail.com
Wed May 16 13:27:04 EDT 2007


2007/5/16, Ajay Divekar <ajay.divekar at guardiantechintl.com>:
> I was trying to differentiate between FreeBSD and Linux's and found that by
> using CMAKE_SYSTEM_NAME variable I will be able to do that. I had
>
> if (CMAKE_SYSTEM_NAME MATCHES Linux)
>   SET(...)
> ELSE(CMAKE_SYSTEM_NAME MATCHES Linux)
>   SET(...)
> ENDIF(CMAKE_SYSTEM_NAME MATCHES Linux)
>
> This works on freeBSD but fails on Fedora and SUSE. Any Solution ?

It works perfectly for me on debian ??
May be you could add:
MESSAGE("CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}")

In order to see the var value?

Do you test the var value before of after PROJECT(xxx) ?
it seems that the variable is not set before PROJECT(xxx) is invoked.


-- 
Erk


More information about the CMake mailing list