Commit c205544e authored by Gregor Jasny's avatar Gregor Jasny

Apple: Add documentation for iphone-friendly-cmake topic

Closes: #17870
parent 43b5d5b9
......@@ -522,3 +522,45 @@ See also target properties:
* :prop_tgt:`ANDROID_SECURE_PROPS_PATH`
* :prop_tgt:`ANDROID_SKIP_ANT_STEP`
* :prop_tgt:`ANDROID_STL_TYPE`
.. _`Cross Compiling for iOS, tvOS, or watchOS`:
Cross Compiling for iOS, tvOS, or watchOS
-----------------------------------------
For cross-compiling to iOS, tvOS, or watchOS the :generator:`Xcode`
generator is recommended. But also the :generator:`Unix Makefiles`
generator or the :generator:`Ninja` generator might be used but require
more manual work in areas like target CPU selection or code signing.
A toolchain file may target any of the three systems by setting the
:variable:`CMAKE_SYSTEM_NAME` variable to a value from the table below.
By default the latest Device SDK is chosen. Like for all Apple platforms
a different (e.g. Simulator) SDK could be selected by setting the
:variable:`CMAKE_OSX_SYSROOT` variable. A list of available SDKs could
be queried by running ``xcodebuild -showsdks``.
======= ================= ==================== ================
OS CMAKE_SYSTEM_NAME Device SDK (default) Simulator SDK
======= ================= ==================== ================
iOS iOS iphoneos iphonesimulator
tvOS tvOS appletvos appletvsimulator
watchOS watchOS watchos watchsimulator
======= ================= ==================== ================
For example to create a CMake configuration for iOS, the following
command is sufficient:
.. code-block:: console
cmake .. -GXcode -DCMAKE_SYSTEM_NAME=iOS
Code Signing
^^^^^^^^^^^^
Some build artifacts for the embedded Apple platforms require mandatory
code signing. CMake tries very hard to avoid code signing in the
internal configuration phase like complier id and feature detection.
If code signing is required or desired the developmemt team id could be
passed in the ``CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM`` variable. It
will be forwared to the generated Xcode project and appropriately used.
iphone-friendly-cmake
---------------------
* CMake now supports :ref:`Cross Compiling for iOS, tvOS, or watchOS`
using simple toolchain files.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment