Open
Description
What is your suggestion?
While for libraries CMake would expect them to provide -config.cmake
files (or CPS in the future), CMake does have some nice built ins that provide abstractions for things that are belong in the real of toolchains/system libraries, rather than a pure library package. Some examples are "Threads", "OpenMP", and for some complex cases, Python
, CUDAToolkit
)
It would be useful if recipes that use these and need to propagate requirements, could cause the generated files to :
- have a call to
find_dependency(xxx)
, e.gfind_dependency(Threads)
- be able to tell a Conan-generated Cmake target, to depend on a CMake-find-module-provided target
for example:
def package_info(self):
self.cpp_info.set_property("cmake_additional_dependencies", ["Threads", "OpenMP"])
self.cpp_info.components["foobar"].set_property("cmake_target_name", "foobar::libfoo")
self.cpp_info.components["foobar"].set_property("cmake_additional_interface_link_libraries", ["OpenMP::OpenMP"])
This can help mitigate workarounds like this one for llama, or having to partially replicate existing well-maintained CMake logic, in less-ideally maintained recipe hacks
Have you read the CONTRIBUTING guide?
- I've read the CONTRIBUTING guide