Skip to content
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

CMakeDeps. global target: from merging cppinfo to link component targets #11673

Merged
merged 3 commits into from Jul 26, 2022

Conversation

lasote
Copy link
Contributor

@lasote lasote commented Jul 19, 2022

Changelog: Feature: Changed CMakeDeps generator so the global target made for a package with components is a target linked with the targets of the components, instead of a target made from merging cpp_info objects from the components.

Changelog: Fix: The cmake_build_modules property can only be declared in the self.cpp_info, not in components, where will be ignored.

Docs: conan-io/docs#2664

Closes: #11673

@lasote lasote added this to the 1.51 milestone Jul 26, 2022
Copy link
Member

@memsharded memsharded left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say that further cleanings are possible, like not calling aggregated_components if there are no components, and not computing the global TargetDataContext.

But this is perfect for a first step, disabling the output and the behavior, to learn if something breaks. Good job.

@jcar87 jcar87 merged commit 0fb3d62 into conan-io:develop Jul 26, 2022
@thorntonryan
Copy link
Contributor

Changelog: Fix: The cmake_build_modules property can only be declared in the self.cpp_info, not in components, where will be ignored.

@lasote , out of curiosity, what was the reason for this change?

I have a draft PR internally that was actually doing a component based cmake_build_modules -- in part because introducing the components seemed to throw errors on having other global self.cpp_info properties defined. But also because each component wanted to add its own *.cmake file that defined additional target properties to the component based target. So it sort of made sense to describe this on a component level, instead of at the global level.

It'll be easy to fix. Just curious why the change was made.

@memsharded
Copy link
Member

Because build_modules in practice cannot be "activated" per component. The CMake way of including them make them always global, per package. So it is better to make this fact explicit not allowing to define them per-component but globally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants