1FRAMEWORK
2---------
3
4Build ``SHARED`` or ``STATIC`` library as Framework Bundle on the macOS and iOS.
5
6If such a library target has this property set to ``TRUE`` it will be
7built as a framework when built on the macOS and iOS.  It will have the
8directory structure required for a framework and will be suitable to
9be used with the ``-framework`` option.  This property is initialized by the
10value of the :variable:`CMAKE_FRAMEWORK` variable if it is set when a target is
11created.
12
13To customize ``Info.plist`` file in the framework, use
14:prop_tgt:`MACOSX_FRAMEWORK_INFO_PLIST` target property.
15
16For macOS see also the :prop_tgt:`FRAMEWORK_VERSION` target property.
17
18Example of creation ``dynamicFramework``:
19
20.. code-block:: cmake
21
22  add_library(dynamicFramework SHARED
23              dynamicFramework.c
24              dynamicFramework.h
25  )
26  set_target_properties(dynamicFramework PROPERTIES
27    FRAMEWORK TRUE
28    FRAMEWORK_VERSION C
29    MACOSX_FRAMEWORK_IDENTIFIER com.cmake.dynamicFramework
30    MACOSX_FRAMEWORK_INFO_PLIST Info.plist
31    # "current version" in semantic format in Mach-O binary file
32    VERSION 16.4.0
33    # "compatibility version" in semantic format in Mach-O binary file
34    SOVERSION 1.0.0
35    PUBLIC_HEADER dynamicFramework.h
36    XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer"
37  )
38