[CMake] What sets UNIX, WIN32, et al.?

Phil Smith phil at voltage.com
Mon Jan 12 11:29:17 EST 2009


Thanks. That was the key!

...phsiii
-----Original Message-----
From: cmake-bounces at cmake.org [mailto:cmake-bounces at cmake.org] On Behalf Of Alexander Neundorf
Sent: Friday, January 09, 2009 6:29 PM
To: cmake at cmake.org
Subject: Re: [CMake] What sets UNIX, WIN32, et al.?

Hi Phil,

On Saturday 10 January 2009, Phil Smith wrote:
...
> What's happening is that none of the WIN32, APPLE, UNIX variables are being
> set. And I'll be ****ed if I can figure out what normally sets them!
>
> The CMake command is:
>         cmake -DCMAKE_TOOLCHAIN_FILE:string=".\zosport.cmake" -G"Unix
> Makefiles" .\
>
> and I was guessing that the -G"Unix Makefiles" was setting UNIX (which is
> what we need), but no.
>
> I'm sure this is something stupid and obvious...

UNIX is set in Modules/Platform/UnixPaths.cmake, WIN32 is set in
Modules/Platform/Windows.cmake, APPLE is set in
Modules/PLatform/Darwin.cmake. I.e. they are for the target platform.
With cmake 2.6 now also CMAKE_HOST_UNIX, CMAKE_HOST_WIN32 and CMAKE_HOST_APPLE
are available.
Additionally you can use CMAKE_SYSTEM_NAME (or CMAKE_SYSTEM) to test the
operating system of the target system, if you want to test the operating
system of the host use CMAKE_HOST_SYSTEM_NAME (or CMAKE_HOST_SYSTEM).

Alex
_______________________________________________
CMake mailing list
CMake at cmake.org
http://www.cmake.org/mailman/listinfo/cmake


More information about the CMake mailing list