Reputation: 1685
I am starting to learn conan and I have a doubt. Lets say I have a library that depends on boost and on cgal. Cgal it self depends also on boost.
If I have a recipe for cgal, how would I indicate that I want to use the same boost version that I am using on the library?
Upvotes: 0
Views: 276
Reputation: 3889
You need to check first which version cgal is using and set the same specific version in your new recipe.
If you use a different version, Conan will warning you, but you can force it using the override argument. So you will be able to use different versions.
Of course, if you want to use the same version and be sure that it will not change after some while, you can use the package revision too. So you will use the exactly same version for every new build.
Why Conan can not detect the version dynamically? Well, it's the chicken-egg question. To detect the requirements and generate the graph-lock, first, Conan need to know what you need as requirement in you recipe. On the other hand, you want to know the graph-lock before saying what you need, to detect the correct Boost version. Thus, you won't be able to know which Boost version is being used by cgal, before to set your own requirements and Conan be able to generate the dependence tree.
Upvotes: 0