Skip to content

Commit

Permalink
CMakeDeps and cmake_build_modules property from components (conan-io#…
Browse files Browse the repository at this point in the history
…10326)

* Tests

* Aggregate components keep the properties from the root

* Update conans/test/functional/toolchains/cmake/cmakedeps/test_cmakedeps_build_modules.py

Co-authored-by: Carlos Zoido <[email protected]>

Co-authored-by: Carlos Zoido <[email protected]>
  • Loading branch information
lasote and czoido authored Jan 13, 2022
1 parent a3fc148 commit 5abd767
Show file tree
Hide file tree
Showing 4 changed files with 134 additions and 237 deletions.
1 change: 1 addition & 0 deletions conan/tools/cmake/cmakedeps/templates/target_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ def template(self):
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,MODULE_LIBRARY>{{ ':${' }}{{ pkg_name }}_{{ comp_variable_name }}_SHARED_LINK_FLAGS{{ config_suffix }}}>
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>{{ ':${' }}{{ pkg_name }}_{{ comp_variable_name }}_EXE_LINK_FLAGS{{ config_suffix }}}>
)
list(APPEND {{ pkg_name }}_BUILD_MODULES_PATHS{{ config_suffix }} {{ cpp.build_modules_paths }})
{%- endfor %}
""")
return ret
Expand Down
2 changes: 2 additions & 0 deletions conans/model/new_build_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ def aggregated_components(self):
current_values = result.get_init("requires", [])
current_values.extend(component.requires)

# We copy the properties from the root object, even if we have components
result._generator_properties = copy.copy(self._generator_properties)
# FIXME: What to do about sysroot?
else:
result = copy.copy(self.components[None])
Expand Down
Loading

0 comments on commit 5abd767

Please sign in to comment.