[POC][CMakeConfigDeps] Multi-CONFIG CMake files mechanism - #20298
[POC][CMakeConfigDeps] Multi-CONFIG CMake files mechanism#20298franramirez688 wants to merge 8 commits into
Conversation
| # A dependency might be split into several CMake config files (root + | ||
| # cmake_file_name dict groups), each one needs its own _DIR entry. | ||
| for cmake_filename, cmake_file_info in self._cmakedeps.get_cmake_filenames_info(dep).items(): | ||
| extra_variants = self._cmakedeps.get_property("cmake_file_name_variants", dep, | ||
| custom_props=cmake_file_info.get("properties"), | ||
| check_type=list) or [] |
There was a problem hiding this comment.
Huge diff, but there are a couple of changes over here. One of them is these lines
| cmake_file_name_prop = self._cmakedeps.get_property( | ||
| "cmake_file_name", dep, custom_props=cmake_file_info.get("properties")) | ||
| is_cmake_filename_defined = ( | ||
| isinstance(cmake_file_name_prop, str) | ||
| or (isinstance(cmake_file_name_prop, dict) | ||
| and cmake_filename in cmake_file_name_prop) | ||
| ) |
There was a problem hiding this comment.
And this evaluation is the other one. The rest of the diff is only indentation changes
|
I noticed that when a dependency's Would it make sense to raise an exception at generate time (something like "package X has no default target, point |
memsharded
left a comment
There was a problem hiding this comment.
I think it is overall looking good, but maybe it would still be worth to decouple a preparation PR that takes into account for the indents and other similar refactor preparation and small generalizations, to be able to introduce the pure multi-file more cleanly.
| # have a context-independent filename. When the same package is both requires and | ||
| # tool_requires, keep the host-context version so legacy variables (<pkg>_LIBRARIES, | ||
| # ...) are preserved. | ||
| for cmake_filename, cmake_file_info in self.get_cmake_filenames_info(dep).items(): |
There was a problem hiding this comment.
It seems this is also just an indent, but difficult to read the diff.
Changelog: Feature: Multi-CONFIG CMake files mechanism in CMakeConfigDeps.
Changelog: Feature: Property
cmake_file_nameaccepts a string or a dict object in CMakeConfigDeps.Docs: https://github.com/conan-io/docs/pull/XXXX
Closes: #19407
Checked on CCI repo
spirv-tools
Applying this diff, it should work locally on your native env: