[cmake-developers] iOS support

Ruslan Baratov ruslan_baratov at yahoo.com
Mon Sep 29 09:35:21 EDT 2014


On 23-Sep-14 19:42, Florent Castelli wrote:
> On 23 Sep 2014, at 16:56, Bill Hoffman <bill.hoffman at kitware.com> wrote:
>
>>> That said it would be really cool to beef up the xcode support enough to
>>> be able to create an actual ios app.  I have not dug into that enough.
>>> Should be able to do most of it with CMAKE_XCODE_ATTRIBUTE.     I will
>>> look into this try_compile COPY_FILE issue today and get back to the list.
>>>
>>> It would be great if you could get an example/Test in place that builds
>>> an app for a device and works with Xcode and for a stretch goal also
>>> works with makefiles or ninja.
>>>
>> Couple of more things.
>>
>> Much of the stuff found in these toolchains:
>> https://github.com/Kitware/VTK/blob/master/CMake/ios.toolchain.xcode.cmake
>> https://github.com/Kitware/VTK/blob/master/CMake/ios.simulator.toolchain.cmake
>> https://github.com/Kitware/VTK/blob/master/CMake/ios.device.toolchain.cmake
>> Should be in Platform files.  If we created ios platform files we could remove most of the stuff from those toolchain files.  This would be a great thing to work on.
>>
> The problem is that I want a project that is usable by developers directly and you can't really force them to target just the simulator. It should work for targeting both simulator and real device. So having a generic iOS toolchain that can generate both in one project is a requirement for me.
>
Hi,

Universal libraries can be built by setting CMAKE_OSX_SYSROOT to 
"iphoneos". This is how it works for me:

* https://github.com/ruslo/polly/blob/master/ios-7-1.cmake
* https://github.com/ruslo/polly/blob/master/os/iphone.cmake
* https://github.com/ruslo/polly/wiki/Toolchain-list#ios

real root was found by invoking `xcode-select -print-path`, i.e. you can 
switch iOS version by providing appropriate DEVELOPER_DIR environment 
variable.
Works for Xcode only (since Xcode 5.0).

Ruslo



More information about the cmake-developers mailing list