diff options
author | Bartosz Kosiorek <bartosz.kosiorek@tomtom.com> | 2015-12-02 21:34:25 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-12-03 13:52:09 (GMT) |
commit | e76ee2c006777e268715b39ad71f49e3d18b11a4 (patch) | |
tree | 5c913b087d66d2fa5f25b65635b9b2fb9d562a92 /Help/prop_tgt | |
parent | 6f6897f1aef884963503d8068707cf27fa7d99e7 (diff) | |
download | CMake-e76ee2c006777e268715b39ad71f49e3d18b11a4.zip CMake-e76ee2c006777e268715b39ad71f49e3d18b11a4.tar.gz CMake-e76ee2c006777e268715b39ad71f49e3d18b11a4.tar.bz2 |
iOS: Fix framework resource directory layout (#15848)
A typical iOS application bundle (also Framework Bundle) contains the
application executable and any resources used by the application (for
instance, the application icon, other images, and localized content) in
the top-level bundle directory. The same rule applies to Framework
Bundles.
Diffstat (limited to 'Help/prop_tgt')
-rw-r--r-- | Help/prop_tgt/MACOSX_BUNDLE.rst | 2 | ||||
-rw-r--r-- | Help/prop_tgt/MACOSX_RPATH.rst | 6 | ||||
-rw-r--r-- | Help/prop_tgt/RESOURCE.rst | 66 |
3 files changed, 62 insertions, 12 deletions
diff --git a/Help/prop_tgt/MACOSX_BUNDLE.rst b/Help/prop_tgt/MACOSX_BUNDLE.rst index 8d7d914..7cd8046 100644 --- a/Help/prop_tgt/MACOSX_BUNDLE.rst +++ b/Help/prop_tgt/MACOSX_BUNDLE.rst @@ -3,7 +3,7 @@ MACOSX_BUNDLE Build an executable as an Application Bundle on OS X or iOS. -When this property is set to true the executable when built on OS X +When this property is set to ``TRUE`` the executable when built on OS X or iOS will be created as an application bundle. This makes it a GUI executable that can be launched from the Finder. See the :prop_tgt:`MACOSX_FRAMEWORK_INFO_PLIST` target property for information about diff --git a/Help/prop_tgt/MACOSX_RPATH.rst b/Help/prop_tgt/MACOSX_RPATH.rst index 41bb8cc..1f9a036 100644 --- a/Help/prop_tgt/MACOSX_RPATH.rst +++ b/Help/prop_tgt/MACOSX_RPATH.rst @@ -3,8 +3,8 @@ MACOSX_RPATH Whether this target on OS X or iOS is located at runtime using rpaths. -When this property is set to true, the directory portion of -the "install_name" field of this shared library will be ``@rpath`` +When this property is set to ``TRUE``, the directory portion of +the ``install_name`` field of this shared library will be ``@rpath`` unless overridden by :prop_tgt:`INSTALL_NAME_DIR`. This indicates the shared library is to be found at runtime using runtime paths (rpaths). @@ -18,6 +18,6 @@ can be controlled by the :prop_tgt:`INSTALL_RPATH` target property on the target linking to this target. Policy :policy:`CMP0042` was introduced to change the default value of -``MACOSX_RPATH`` to ``TRUE. This is because use of ``@rpath`` is a +``MACOSX_RPATH`` to ``TRUE``. This is because use of ``@rpath`` is a more flexible and powerful alternative to ``@executable_path`` and ``@loader_path``. diff --git a/Help/prop_tgt/RESOURCE.rst b/Help/prop_tgt/RESOURCE.rst index 5dad3ea..d837f7b 100644 --- a/Help/prop_tgt/RESOURCE.rst +++ b/Help/prop_tgt/RESOURCE.rst @@ -1,11 +1,61 @@ RESOURCE -------- -Specify resource files in a :prop_tgt:`FRAMEWORK` shared library target. - -Shared library targets marked with the :prop_tgt:`FRAMEWORK` property generate -frameworks on OS X, iOS and normal shared libraries on other platforms. -This property may be set to a list of files to be placed in the -``Resources`` directory inside the framework folder. On non-Apple -platforms these files may be installed using the ``RESOURCE`` option to -the ``install(TARGETS)`` command. +Specify resource files in a :prop_tgt:`FRAMEWORK` or :prop_tgt:`BUNDLE`. + +Target marked with the :prop_tgt:`FRAMEWORK` or :prop_tgt:`BUNDLE` property +generate framework or application bundle (both OS X and iOS is supported) +or normal shared libraries on other platforms. +This property may be set to a list of files to be placed in the corresponding +directory (eg. ``Resources`` directory for OS X) inside the bundle. +On non-Apple platforms these files may be installed using the ``RESOURCE`` +option to the ``install(TARGETS)`` command. + +Following example of Application Bundle: + +.. code-block:: cmake + + add_executable(ExecutableTarget + addDemo.c + resourcefile.txt + appresourcedir/appres.txt + ) + + target_link_libraries(ExecutableTarget heymath mul) + + set(RESOURCE_FILES + resourcefile.txt + appresourcedir/appres.txt + ) + + set_target_properties(ExecutableTarget PROPERTIES + MACOSX_BUNDLE TRUE + MACOSX_FRAMEWORK_IDENTIFIER org.cmake.ExecutableTarget + RESOURCE "${RESOURCE_FILES}" + ) + +will produce flat structure for iOS systems:: + + ExecutableTarget.app + appres.txt + ExecutableTarget + Info.plist + resourcefile.txt + +For OS X systems it will produce following directory structure:: + + ExecutableTarget.app/ + Contents + Info.plist + MacOS + ExecutableTarget + Resources + appres.txt + resourcefile.txt + +For Linux, such cmake script produce following files:: + + ExecutableTarget + Resources + appres.txt + resourcefile.txt |