[CMake] How to check the operating system is MacOSX?

Eric Wing ewmailing at gmail.com
Tue Sep 18 14:55:18 EDT 2012


On 9/18/12, Doug <douglas.linder at gmail.com> wrote:
> Just idly though, I've never yet encountered a situation where:
>
> if(APPLE)
>   ...
> elseif(UNIX)
>   ...
> endif()
>
> Wasn't sufficient.

I have plenty of these situations :P

The most common case though is that 3rd party dynamic libraries are
not allowed on iOS so generally I have to build things differently for
iOS.

Another case is sometimes features need to be removed to avoid the
risk of rejection by the AppStore (e.g. don't compile in calls to
mprotect()).

And sometimes sub-components need to be different/replaced/removed
compared to their Mac counterparts. LGPL libraries are a frequent
issue. But specializations such as Ogg Vorbis vs. Ogg Tremor (integer
version) also require different build instructions depending on the
platform (Mac vs. iOS). x86 is not an indicator because the iOS
Simulator is i386 which needs to be compiled like any other iOS
device.

-Eric
-- 
Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/


More information about the CMake mailing list