[question] How can I get sub graph of a dependency in a recipe?
What is your question?
I need to find libs in topological order of a dependency (openssl) and its dependencies, in order to get their libs, lib dirs, include dirs, defines, system libs/frameworks so that I can patch a CMakeLists for check_symbol_exists() (for the well known bug in targets defined by CMakeDeps not working with these functions: https://github.com/conan-io/conan/issues/12012 & https://github.com/conan-io/conan/issues/12180). I don't want the full graph (other unrelated dependencies of this recipe), and I don't want only cpp_info of openssl (I need also its dependencies (there might be zlib depending on an openssl option)).
How can I do that with self.dependencies?
Have you read the CONTRIBUTING guide?
- [ ] I've read the CONTRIBUTING guide
Thanks for your question @SpaceIm
In https://docs.conan.io/2/reference/tools/cpp_info.html?highlight=topological_sort#aggregating-information-in-custom-generators you have the topological_sort iterator of dependencies, returning them in order.
Moving this to docs repo for better docs for this
Thanks @memsharded , in this example all dependencies of current recipe are aggregated, but I don't understand how to aggregate a sub part of the graph (openssl and its dependencies, openssl being one of the dependencies of current recipe). The problem is that conan objects are not always typed, so I don't always know what I'm manipulating and what is returned.
For example self.dependencies doesn't seem to be the same type than self.dependencies[dep].dependencies, and my IDE doesn't give any type information for the later, and conan doc doesn't give much detail.
Here is what I've done (it works but it's ugly): https://github.com/conan-io/conan-center-index/blob/daf4299e60642fc281c01afbb46607bfb8570a48/recipes/dcmtk/all/conanfile.py#L162-L220