Repository: conan-io/conan

Issue:
[Macos] Problem when linking with self-made frameworks
To help us debug your issue please explain:

- [ ✔ ] I've read the [CONTRIBUTING guide](https://raw.githubusercontent.com/conan-io/conan/develop/.github/CONTRIBUTING.md).
- [ ✔ ] I've specified the Conan version, operating system version and any tool that can be relevant.
- [ ✔ ] I've explained the steps to reproduce the error or the motivation/use case of the question/suggestion.


[Conan version] 1.5.1
[System] Mac OSX 10.13.5
[Problem] 
We have a self-made framework named Demo.framework, and wanna integrate it with Conan.
I'm following the official doc [How to link with Apple Frameworks](https://docs.conan.io/en/latest/howtos/link_apple_framework.html) to write my conan_file.py as shown below.
But when I install the uploaded pkg by follwing [With the xcode generator](https://docs.conan.io/en/latest/integrations/xcode.html), I ended up get a build error said: framework Demo not found.

And I finally find out that the generated conanbuildinfo.xcconfig has no "FRAMEWORK_SEARCH_PATHS" in it, when I manually add the FRAMEWORK_SEARCH_PATHS into the config file, XCode can find the framework now.

My question is why the "FRAMEWORK_SEARCH_PATHS" is not generated by Conan? Or what's the right way to use our own framework with Conan ?

Thanks a lot.

[Other info]

```python
from conans import ConanFile, tools

class DemoConan(ConanFile):
    name = "Demo"
    version = "snapshot"
    settings = "os", "compiler", "build_type", "arch"
    description = "Demo to demonstrate the issue"
    url = "None"

    def package(self):
        if self.settings.os == "Macos":
            self.copy("Demo.framework/**", symlinks=True)

    def package_info(self):
        if self.settings.os == "Macos":
            self.cpp_info.includedirs = ['Demo.framework/Headers']
            self.cpp_info.bindirs = ['Demo.framework']
            self.cpp_info.exelinkflags.append("-framework Demo")
            self.cpp_info.sharedlinkflags = self.cpp_info.exelinkflags

```




Discussion:
Hi! Until now we didn't try to package a framework, we are definitely not heavy OSx coders. So we need to look at `FRAMEWORK_SEARCH_PATHS`, absolutely makes sense to set it. 
I'm trying to push it to 1.6 but it is very packed already, probably it has to wait for 1.7.
Thanks to let me know. FIY, I'm using imports() feature to do the trick right now i.e. import the framework into my project and directly rely on it. It worked well but still expect the official support for FRAMEWORK_SEARCH_PATHS, thank you.

Resolving patch:
diff --git a/conans/client/generators/xcode.py b/conans/client/generators/xcode.py
--- a/conans/client/generators/xcode.py
+++ b/conans/client/generators/xcode.py
@@ -12,6 +12,7 @@ class XCodeGenerator(Generator):
 GCC_PREPROCESSOR_DEFINITIONS = $(inherited) {definitions}
 OTHER_CFLAGS = $(inherited) {c_compiler_flags}
 OTHER_CPLUSPLUSFLAGS = $(inherited) {cpp_compiler_flags}
+FRAMEWORK_SEARCH_PATHS = $(inherited) {rootpaths}
 '''
 
     def __init__(self, conanfile):
@@ -26,6 +27,7 @@ def __init__(self, conanfile):
         self.c_compiler_flags = " ".join(deps_cpp_info.cflags)
         self.cpp_compiler_flags = " ".join(deps_cpp_info.cppflags)
         self.linker_flags = " ".join(deps_cpp_info.sharedlinkflags)
+        self.rootpaths = " ".join('"%s"' % d.replace("\\", "/") for d in deps_cpp_info.rootpaths)
 
     @property
     def filename(self):
diff --git a/conans/model/build_info.py b/conans/model/build_info.py
--- a/conans/model/build_info.py
+++ b/conans/model/build_info.py
@@ -19,6 +19,7 @@ def __init__(self):
         self.resdirs = []  # Directories to find resources, data, etc
         self.bindirs = []  # Directories to find executables and shared libs
         self.builddirs = []
+        self.rootpaths = []
         self.libs = []  # The libs to link against
         self.defines = []  # preprocessor definitions
         self.cflags = []  # pure C flags
@@ -120,6 +121,7 @@ def merge_lists(seq1, seq2):
         self.resdirs = merge_lists(self.resdirs, dep_cpp_info.res_paths)
         self.builddirs = merge_lists(self.builddirs, dep_cpp_info.build_paths)
         self.libs = merge_lists(self.libs, dep_cpp_info.libs)
+        self.rootpaths.append(dep_cpp_info.rootpath)
 
         # Note these are in reverse order
         self.defines = merge_lists(dep_cpp_info.defines, self.defines)


Test patch:
diff --git a/conans/test/generators/xcode_gcc_vs_test.py b/conans/test/generators/xcode_gcc_vs_test.py
--- a/conans/test/generators/xcode_gcc_vs_test.py
+++ b/conans/test/generators/xcode_gcc_vs_test.py
@@ -75,10 +75,10 @@ def package_info(self):
 
         package_id = os.listdir(client.paths.packages(conan_ref))[0]
         package_ref = PackageReference(conan_ref, package_id)
-        package_paths = client.paths.package(package_ref).replace("\\", "/")
+        package_path = client.paths.package(package_ref).replace("\\", "/")
 
-        expected_lib_dirs = os.path.join(package_paths, "lib").replace("\\", "/")
-        expected_include_dirs = os.path.join(package_paths, "include").replace("\\", "/")
+        expected_lib_dirs = os.path.join(package_path, "lib").replace("\\", "/")
+        expected_include_dirs = os.path.join(package_path, "include").replace("\\", "/")
 
         self.assertIn(expected_lib_dirs, lib_dirs)
         self.assertEquals("hello.lib;%(AdditionalDependencies)", libs)
@@ -96,3 +96,4 @@ def package_info(self):
         self.assertIn("GCC_PREPROCESSOR_DEFINITIONS = $(inherited)", xcode)
         self.assertIn('OTHER_CFLAGS = $(inherited) %s' % expected_c_flags, xcode)
         self.assertIn('OTHER_CPLUSPLUSFLAGS = $(inherited) %s' % expected_cpp_flags, xcode)
+        self.assertIn('FRAMEWORK_SEARCH_PATHS = $(inherited) "%s"' % package_path.replace("\\", "/"), xcode)