Skip to content

Commit 4f32fc2

Browse files
lasotememsharded
authored andcommitted
Framework search paths (conan-io#727)
* Framework search paths * Apple frameworks packaging * Added changelog
1 parent 518593d commit 4f32fc2

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

‎changelog.rst‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ Check https://github.com/conan-io/conan for issues and more details about develo
2424
- Feature: Added ``filename`` parameter to ``tools.get()`` in case it cannot be deduced from URL.
2525
- Feature: Propagated ``keep_permissions`` and ``pattern`` parameters from ``tools.get()`` to ``tools.unzip()``.
2626
- Feature: Added XZ extensions to ``unzip()``. It will only work in Python 3 with lzma support enabled, producing an error otherwise.
27+
- Feature: Added `FRAMEWORK_SEARCH_PATHS` var to the xcode generator to support packaging Apple Frameworks. Read more :ref:`here<package_apple_framework>`.
28+
2729

2830
1.5.2 (5-July-2018)
2931
--------------------

‎howtos/link_apple_framework.rst‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,36 @@ frameworks if we are building an executable and ``sharedlinkflags`` will only ap
3636
If we are not using CMake to consume this package ``sharedlinkflags`` and ``exelinkflags`` are used indistinctly.
3737
In the example above we are assigning in the last line ``sharedlinkflags`` with ``exelinkflags``, so no matter what the consumer will build,
3838
it will indicate to the linker to link with the specified frameworks.
39+
40+
41+
.. _package_apple_framework:
42+
43+
44+
How to package Apple Frameworks
45+
===============================
46+
47+
To package an Apple framework:
48+
49+
- Copy/Create a framework folder ``XXX.framework`` (being ``XXX`` the name of your framework),
50+
to your package folder, putting there all the subdirectories (``Headers``, ``Modules``, etc).
51+
52+
.. code-block:: python
53+
54+
def package(self):
55+
# If you have the framework folder built in your build_folder:
56+
self.copy("XXX.framework/*", symlinks=True)
57+
# Or build the destination folder:
58+
tools.mkdir("XXX.framework/Headers")
59+
self.copy("*.h", dst="XXX.framework/Headers")
60+
# ...
61+
62+
63+
- Declare the framework in the ``cpp_info`` object.
64+
65+
.. code-block:: python
66+
67+
def package_info(self):
68+
...
69+
70+
self.cpp_info.exelinkflags.append("-framework XXX")
71+
self.cpp_info.sharedlinkflags = self.cpp_info.exelinkflags

‎reference/generators/xcode.rst‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,5 @@ The file declare these variables:
3030
+--------------------------------+----------------------------------------------------------------------+
3131
| OTHER_CPLUSPLUSFLAGS | The requirements cxxflags |
3232
+--------------------------------+----------------------------------------------------------------------+
33+
| FRAMEWORK_SEARCH_PATHS | The requirements root folders, so xcode can find packaged frameworks |
34+
+--------------------------------+----------------------------------------------------------------------+

0 commit comments

Comments
 (0)