Say you have a package that depends on another package. How do you reference that requirement in your build step? For example,
from conans import ConanFile
class PkgB(ConanFile):
name="pkgB"
exports="*"
build_requires="pkgA/1.0@me/stable"
def build(self):
self.run("make pkBPath=<Need path to pkgB here>")
I'm probably just approaching this the wrong way. How is this supposed to be handled?
Hi @rconde01,
You are looking for the deps_cpp_info attribute. This gathers all the information from dependencies like include folders, lib folders, flags and so on.
Its usage looks something like this:
from conans import ConanFile
class PkgB(ConanFile):
name="pkgB"
exports="*"
requires="pkgA/1.0@me/stable"
def build(self):
self.run("make pkgAPath=%s" % self.deps_cpp_info["pkgA"].lib_paths[0])
*I think what you meant was actually "make pkgAPath=...", if not please explain
Hope that helps! Do not hesitate to ask any other doubt
Yes - you're right...I meant pkgA, not package B...i will look into that thanks...if it works out i will close. Thanks for the quick response! You may want to add that to an example in the documentation for build_requires.
this worked thanks