conan icon indicating copy to clipboard operation
conan copied to clipboard

Provide package version info on dep_cpp_info

Open NingyuShi opened this issue 10 years ago • 5 comments

I'm writing a customized generator for bazel, while it works fine, I would like to add more information in the generated build file on the version of the dependency package (including version/user/channel etc). Looks like conans/model/build_info.py can be improved to provide that.

NingyuShi avatar Nov 15 '16 14:11 NingyuShi

I think it could be done, but, do you want the "name/version/user/channel" for each require, because it could be N requires. Right?

lasote avatar Nov 15 '16 17:11 lasote

Yes, basically expand class _CppInfo to have name, version, user, channel.

NingyuShi avatar Nov 15 '16 17:11 NingyuShi

It might not be necessary to add it to CppInfo, now generators are provided with the full conanfile object, so name and version can already be extracted from there. Check: https://github.com/conan-io/conan/blob/develop/conans/client/generators/cmake.py#L54

The username, channel info is currently no provided, as it has the problem of not being defined for open packages (under development in user space). Please check current status in: https://github.com/conan-io/conan/issues/676

memsharded avatar Nov 30 '16 11:11 memsharded

#676 has been planned for next 0.17, it seems that this issue will be fully addressed by that.

memsharded avatar Dec 02 '16 09:12 memsharded

This has been implemented by #730, labeled as fixed, already in develop branch, will be released in 0.17. Feedback welcome :)

memsharded avatar Dec 07 '16 10:12 memsharded