[feature] Allow to generate more than one Find/config CMake file per recipe
See original GitHub issue- I’ve read the CONTRIBUTING guide.
Currently, for a given recipe, cmake_find_package and cmake_find_package_multi can generate one and only one CMake Find/config file, based on the value of self.cpp_info.filenames["cmake_find_package"]/self.cpp_info.filenames["cmake_find_package_multi"] in package_info().
Unfortunately, some libraries provide several config files for their components. In CCI, at least these recipes can’t properly model official config files:
- mongo-c-driver
- mongo-cxx-driver
- spirv-tools
- google-cloud-cpp
A simple solution would be to allow self.cpp_info.filenames["cmake_find_package"] and self.cpp_info.filenames["cmake_find_package_multi"] to take a tuple, and duplicate the same Find/config files when conan generators are executed. mongo-cxx-driver recipe relies on this trick to duplicate the generated config file of mongo-c-driver at build time to satisfy its build system without the need to patch it: https://github.com/conan-io/conan-center-index/blob/master/recipes/mongo-cxx-driver/all/conanfile.py#L146-L151
It would also be nice to support this feature in the new generator CMakeDeps for conan 2.0
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (4 by maintainers)

Top Related StackOverflow Question
Another example in hiredis https://github.com/redis/hiredis/blob/master/CMakeLists.txt
Not discussed yet, sorry. Wouldn’t be difficult to generate several config files with the same content, but I know that the next feature request would be to have some components associated with one file and others to the other one and that could become pretty insane. So honestly I don’t know what to do with this.