[CMake] Differentiate between Linux and FreeBSD

dizzy dizzy at roedu.net
Tue Apr 22 07:31:15 EDT 2008


On Monday 21 April 2008 12:51:46 Horacio Sanson wrote:
> 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??

Why do you need to know if it is a Linux or a FreeBSD? 

Usually, it all boils down to checking specific conditions, libraries, paths 
instead of checking a system and then setting those conditions, libraries, 
paths to expeced values for that system. I find the former much better (and 
more portable since it will probably work on systems that you have not 
specifically addressed too).

-- 
Mihai RUSU					Email: dizzy at roedu.net
			"Linux is obsolete" -- AST


More information about the CMake mailing list