Closed coreyhartley closed 5 months ago
Hi @coreyhartley
Thanks for your question.
I am checking it, but I see some potential issues I'd like to clarify first:
name = "A"
is invalid, both because it is uppercase, but also 1 letter names are not allowed. I guess this is a placeholder for a real name, but it would be good to have something that fully works and I can reproduce here."*:cppstd": 17
. The compiler.cppstd
is a setting
not an option. It is most likely that this has no effect, should be removed.[~v0.1]
For version ranges in Conan, the v
should be dropped, and use only the digits. It is also generally recommended to go explicit [>=XXX <YYY]
, rather than ~
, because in our experience most of the readers won't really understand the later.find_package(C REQUIRED)
shouldn't be done. Only the direct dependencies declared in the recipe should be used in CMakeLists.txt
, the transitive dependencies will be automatic.Finally I think the issue that you are seeing that zmq
headers are not found, is because by default transitive dependendencies hide the headers. There are 2 cases here:
#include "zmq.h"
, then it should also have a requires
to zmq
package.#include
then the issue is that the intermediate package uses zmq
headers in its public headers, and as such they are not hidden and should be propagated downstream. This should be done with self.requires("cppzmq/[~4.10]", transitive_headers=True)
(same for other libraries too).Please let me know if this helps.
The whole A
, B
, C
nomenclature was just meant to simplify things. But everything else was very helpful! I think that the transitive_headers
flag was exactly what I was looking for. So far it looks to be working. Thank you!
Happy to help, thanks for the feedback! 🙂
Don't hesitate to create new tickets for any further question, thanks!
What is your question?
I'm having a real hard time with sub-dependencies. Essentially, I have 2 projects, A and B. B is a dependency of A. B has several 3rd-party dependencies of it's own. When I go add B as a "requirement" to A in my
conanfile.py
, A is unable to pull in B's depndencies.I've tried scouring the documentation, as well as what is available on the internet, even ChatGPT. I can't find a resource that can tell me how to properly do this.
The only way I have found around this is for A to redeclare all sub-dependencies. But then I have had issues doing this from conflicting libraries builds, somehow.
Is it possible to have sub-dependencies without redefining all of them in my
conanfile.py
andCMakeLists.txt
? If so, what am I doing wrong? It looks like Conan automatically attempts to install them... If so, what am I doing wrong?A - conanfile.py:
A - CMakeLists.txt:
B - conanfile.py:
B - CMakeLists.txt:
Output:
Have you read the CONTRIBUTING guide?