-
Notifications
You must be signed in to change notification settings - Fork 946
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] autotools with CFLAGS/LDFLAGS #16202
Comments
Hi @nikoladsp Thanks for your question. The responsibility of extracting the information from dependencies and generating the necessary files for the build systems to locate the dependencies is the one of def generate(self):
deps = CMakeDeps(self) # or deps = MSBuildDeps(self), or deps = PkgConfigDeps(self)...
deps.generate() And see how it works. def generate(self):
for require, dep in self.dependencies.host.items():
dep.package_folder
dep.cpp_info.includedirs
dep.cpp_info.libdirs
... Check https://docs.conan.io/2/reference/conanfile/methods/generate.html#conan-conanfile-model-dependencies for more information about dependencies and Don't worry about the Then, when you know how to generate the files that you want, if you want to reuse it, the recommendation would be to put the code in a common About the Please let me know if this helps. |
Many thanks for your answer - I will try it later today or tomorrow morning. Just to check my understanding: I need to get package location (where include and lib are stored) so I can prepend CFLAGS and LDFLAGS when doing ./configure - so autotools can find it? Also, what I have to set Kindest regards |
Well, we already have the You have the implementation here if you want to start from there: https://github.com/conan-io/conan/blob/develop2/conan/tools/gnu/autotoolsdeps.py
The In the case of the conan/conan/tools/gnu/autotools.py Line 84 in 66ef385
|
I did play a bit with suggested readings and realized that maybe I should of ask: "Is it possible to build package with autotools but in such way it can be consumed by CMake"? Majority of packages I am using are available via Conan recipes - but there will be couple of exceptions to this rule. Shall I make custom generate() method based on say PkgConfigDeps or completely custom generator that will help other team members to consume packages from their CMake projects? |
Absolutely. Conan packages are intended to be created with any build system and be consumed with any other build system. All packages in ConanCenter use different build systems, and there are already tons of packages using CMake consuming packages built with autotools, meson, etc.
The key here is the If using CMake, they might be able to use the built-in |
What is your question?
Hi,
I have to use a library (GraphicsMagick) that does not have CMake/Conan recipe. It depends on couple of other libraries that do have Conan recipe: libpng and libwebp (to name just a few).
I would like to make a Conan package so I can use it as other libraries - something like:
But I need to find out libpng and libwebp include and library directories in Conan cache prior running ./configure. Those have to match "shared" version (since "static" version of these libraries maybe exists in cache). Also, how to set output folder path/name?
Many thanks.
Have you read the CONTRIBUTING guide?
The text was updated successfully, but these errors were encountered: