cmake/Help/prop_tgt/FRAMEWORK.rst

38 lines
1.3 KiB
ReStructuredText
Raw Normal View History

2014-08-03 19:52:23 +02:00
FRAMEWORK
---------
2018-10-28 12:09:07 +01:00
Build ``SHARED`` or ``STATIC`` library as Framework Bundle on the macOS and iOS.
2014-08-03 19:52:23 +02:00
2017-04-14 19:02:05 +02:00
If such a library target has this property set to ``TRUE`` it will be
2018-10-28 12:09:07 +01:00
built as a framework when built on the macOS and iOS. It will have the
2014-08-03 19:52:23 +02:00
directory structure required for a framework and will be suitable to
2019-11-11 23:01:05 +01:00
be used with the ``-framework`` option. This property is initialized by the
value of the :variable:`CMAKE_FRAMEWORK` variable if it is set when a target is
created.
2015-11-17 17:22:37 +01:00
2016-03-13 13:35:51 +01:00
To customize ``Info.plist`` file in the framework, use
:prop_tgt:`MACOSX_FRAMEWORK_INFO_PLIST` target property.
2018-10-28 12:09:07 +01:00
For macOS see also the :prop_tgt:`FRAMEWORK_VERSION` target property.
2016-03-13 13:35:51 +01:00
Example of creation ``dynamicFramework``:
.. code-block:: cmake
add_library(dynamicFramework SHARED
dynamicFramework.c
dynamicFramework.h
)
set_target_properties(dynamicFramework PROPERTIES
FRAMEWORK TRUE
FRAMEWORK_VERSION C
MACOSX_FRAMEWORK_IDENTIFIER com.cmake.dynamicFramework
MACOSX_FRAMEWORK_INFO_PLIST Info.plist
2016-07-09 11:21:54 +02:00
# "current version" in semantic format in Mach-O binary file
VERSION 16.4.0
# "compatibility version" in semantic format in Mach-O binary file
SOVERSION 1.0.0
2016-03-13 13:35:51 +01:00
PUBLIC_HEADER dynamicFramework.h
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer"
)