[cmake-developers] iOS: direction to official support and questions

Brad King brad.king at kitware.com
Thu Aug 10 11:04:57 EDT 2017


On 08/08/2017 08:08 AM, Raffi Enficiaud wrote:
> I have looked a bit to the Android toolchains, and I have to say I found 
> those quite complicated as a first reading :)

This note may help:

 https://gitlab.kitware.com/cmake/cmake/issues/16708#note_300971

I don't think iOS will need all the toolchain and stl selection logic.

Ideally CMake would gain iOS platform modules such that one could
set CMAKE_SYSTEM_NAME to `iOS`.

> set(CMAKE_FIND_ROOT_PATH
>      ${CMAKE_IOS_DEVELOPER_ROOT}
>      ${CMAKE_IOS_SDK_ROOT}
>      ${CMAKE_PREFIX_PATH}
>      /path/to/boost_1_64_0_build/install
>      CACHE string  "iOS find search path root")
> ```
> 
> where this path is hard coded, and points to the fat static libraries 
> prefix path of boost. If I remove this path, FindBoost does not find the 
> boost libraries anymore (of course I am passing BOOST_ROOT). In 
> addition, I have this:
> 
> set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
> set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
> set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

These last three lines tell the find commands to only look at
paths re-rooted under CMAKE_FIND_ROOT_PATH and CMAKE_SYSROOT.
If boost is not under one of those then it won't be found.

> set(CMAKE_MACOSX_BUNDLE YES)

Is it possible to build any binary of any form on iOS without this?
If not then the iOS platform modules should set something to tell
the generators that this should always be enabled.

> set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")

Similarly for this, but perhaps only during `try_compile`.

I'm not familiar enough with iOS development to answer the rest of
your questions.

-Brad


More information about the cmake-developers mailing list