-
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
global cpp_info can be used to initialize components #13994
global cpp_info can be used to initialize components #13994
Conversation
@@ -572,6 +572,8 @@ def package_info(self): | |||
self.cpp_info.set_property("pkg_config_name", "pkg_other_name") | |||
self.cpp_info.set_property("pkg_config_aliases", ["pkg_alias1", "pkg_alias2"]) | |||
self.cpp_info.components["cmp1"].libs = ["libcmp1"] | |||
self.cpp_info.components["cmp1"].libdirs = ["lib"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests were ill-formed in the first place, because they were defining things that doesn't work. Yes, they are serialized, but most generators just discard the global cpp_info definition.
@@ -32,6 +32,7 @@ def build(self): | |||
|
|||
def layout(self): | |||
cmake_layout(self, src_folder="src") | |||
self.cpp.source.includedirs = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is important to invalidate the non-existing includedirs
in conanfile.cpp.source.includedirs = ["include"]
inside cmake_layout()
This is too risky, better wait until |
Changelog: Feature: Global
cpp_info
can be used to initialize components values.Docs: omit
This is a long standing issue, where users that define
self.cpp_info.includedirs = ["myinclude"]
are surprised that individual components will not use themyinclude
folder too.There could be different approaches to this, I have implemented the following:
cpp_info
self.cpp_info
are not taken into account.