Files
CMake/Help/prop_tgt/RESOURCE.rst
Bartosz Kosiorek fc1602456a Help: Replace occurrences of "Mac OS X" with "macOS"
Apple's main Operating system changed their name from OS X to macOS:

    https://www.engadget.com/2016/06/13/os-x-is-now-macos/

Revise documentation accordingly.
2018-09-05 16:10:49 -04:00

62 lines
1.5 KiB
ReStructuredText

RESOURCE
--------
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 macOS 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 macOS) 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 macOS 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