-
Notifications
You must be signed in to change notification settings - Fork 989
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
[bug] Unable to set cmake_config_version_compat property from consumer conanfile #14807
Comments
Thanks very much for reporting. Said that, I think there is no reason to be inconsistent and having some properties that cannot be overriden from downstream, no need to discuss the semantics of each property, so lets fix this for next release. |
Without making comment on whether it should be dictated by the consumer, this issue was prompted when packaging up the ensmallen library. They use the syntax to specify a minimum compatible version (see the commit context): mlpack/ensmallen@1208c62#diff-1e7de1ae2d059d21e1dd75d5812d5a34b0222cef273b7c3a2af62eb747f9d20aR60 find_package(Armadillo 9.800.0 REQUIRED) Having said that, I think that there is a difference between the versioning policy upstream and what the consumer says they are compatible with. Upstream, assuming semver, a major version bump means "the public api has had a breaking change, in some way", which might look like a bump from 1.x to 2.x. On the consumer side, there's every possibility that the nature of the breaking change had no impact on their compatibility with the library because the breaking change was not part of their usage of the library. In that case, they may be comfortable saying, "we think we're compatible with anything newer than 0.1.1", and then revising that as a breaking change that does impact their usage comes out. This will also mean that when packaging libraries, I won't need to do things like this: replace_in_file(
self,
os.path.join(self.source_folder, "CMakeLists.txt"),
"find_package(Armadillo 9.800.0 REQUIRED)",
"find_package(Armadillo REQUIRED)",
) And can instead just def generate(self):
deps = CMakeDeps(self)
deps.set_property("armadillo", "cmake_config_version_compat", "AnyNewerVersion")
deps.generate() Anyway, just wanted to provide some additional context. I'm glad it will be in the next release :) |
Environment details
Steps to reproduce
conan new cmake_lib -d name=foo -d version=0.1.0
conan build
armadillo-config-versions.cmake
doesn't contain the appropriate configuration for theAnyNewerVersion
policy:Logs
The text was updated successfully, but these errors were encountered: