-
Notifications
You must be signed in to change notification settings - Fork 990
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] cmake_build_modules behavior in conan 1.43.0 and conan 1.43.2 #10282
Comments
I am investigating this. I have verified, and you are right, this kind of worked in 1.43.0 but was removed in 1.43.2. It seems related to the fact that build_modules cannot be defined by component, because they cannot be included by component (it is a global thing per package). It is possible that 1.43.0 was more relaxed about this, but 1.43.2 is requiring a proper definition. So the protobuf recipe should probably be changed from: self.cpp_info.components["libprotobuf"].set_property("cmake_build_modules", build_modules) to self.cpp_info.set_property("cmake_build_modules", build_modules) I'd need @lasote and @czoido to have a look at this, I don't recall if this was fully intentional and my rationale above is the right one. |
I would say it was removed here and I bet it is because we removed the "copy" from the old model ".build_modules" to the new property. It was working because the recipe still have the ".build_modules" and before 1.43 it was being ported to the |
A quick search at conan-center-index reveals that both |
Does conan-io/conan-center-index#8820 help? |
I'm wondering: since |
I need to check this a bit more. |
I'm going to check why/how could we enable the declaration (not the declaration but the usage at CMakeDeps) of |
It is not possible to do that because the consumer declares the dependency to a component in the package_info, but that is not available at build (generate()) time. But anyway the linked PR allows declaring the |
I am using conan 1.43.2
I have built conan package for google protobuf for my platform using this recipe in conan central.
https://github.com/conan-io/conan-center-index/blob/master/recipes/protobuf/all/conanfile.py
the build recipe sets "cmake_build_modules" in package_info().
self.cpp_info.components["libprotobuf"].set_property("cmake_build_modules", build_modules)
// create command
bash$> conan create . x.y.z@myuser/mychannel -pr debug64 -pr:b debug64
In my consumer conanfile.py, I am using CMakeToolchain and CMakeDeps generators
I am consuming like this
bash$ /myproject_root/build/> conan install .. -pr debug64 -pr:b debug64
However, the build modules (*.cmake files) aren't set in the generated cmake files with conan 1.43.2
If I downgrade to conan 1.43.0, then it works.
Is it a bug or am I using host and build profiles incorrectly? I am building and consuming on the same physical host.
The text was updated successfully, but these errors were encountered: