-
Notifications
You must be signed in to change notification settings - Fork 991
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[question] New MakeDeps generator and transitive dependencies #14691
Comments
Hi @db4 Thanks for your question. The XXX_CAIRO variables contain exclusively the information for the cairo package, not the transitive dependencies, that are defined in their own variables. The same file contains at the and an aggregated set of variables that can be used instead of the individual ones, to add not only the direct dependencies but also the transitive dependencies, have you checked those? |
@db4 Besides Cairo variables, each dependency is listed as individual variables too. As it may be tedious to include in your Makefile, you can use global variables instead: include $(BUILD_FOLDER)/conandeps.mk
CXXFLAGS += $(CONAN_CXXFLAGS) -std=c++11
CPPFLAGS += $(addprefix -I, $(CONAN_INCLUDE_DIRS))
CPPFLAGS += $(addprefix -D, $(CONAN_DEFINES))
LDFLAGS += $(addprefix -L, $(CONAN_LIB_DIRS))
LDLIBS += $(addprefix -l, $(CONAN_LIBS))
LDLIBS += $(addprefix -l, $(CONAN_SYSTEM_LIBS))
EXELINKFLAGS += $(CONAN_EXELINKFLAGS) We have it documented (https://docs.conan.io/2/reference/tools/gnu/makedeps.html#generated-files) but not well detailed. It deserves an improved. Plus, there is a PR with an example to be included in the documentation as soon as it gets merged: conan-io/examples2#115 |
Do you mean |
@db4 Please, confirm/fix the generator that you are using Could you please elaborate more why can not you use |
@uilianries |
@db4 So you have multiple targets and want to link or not, specific dependencies? |
Yes, a consumer project with many targets and different dependencies. |
@db4 Please, confirm/fix the generator that you are using NMakeDeps or MakeDeps? The issue title is different from the description. Plus, what Conan client version are you running? |
MakeDeps generator from Conan 2.0.10. Maybe the word "new" in the title is confusing, I meant that the generator was released just recently. |
@db4 Your case sounds fair, it could be improved. We could add transitive dependencies values (include, libs, ...) appended to their root node. It may implicate in duplicated values, in case including same dependency as individual but also getting a ride from its consumer package. I don't see a way to avoid it by generators, ever CMake suffers it. But I don't think it should be considered a problem, but bad usage. @memsharded WDYT about adding support for transitive deps in Make variables? |
What is your question?
To illustrate the problem consider the following conanfile.txt:
For it
conan install . -g MakeDeps
generates the following fragment:Why CONAN_INCLUDE_DIRS_CAIRO doesn't include dependencies include dirs?
Of course, the problem is not specific to cairo package. MakeDeps never includes transitive dependencies to CONAN_INCLUDE_DIRS_pkg, CONAN_LIB_DIRS_pkg, CONAN_LIBS_pkg etc.
Have you read the CONTRIBUTING guide?
The text was updated successfully, but these errors were encountered: