conan-io / hooks

Official Conan client hooks
MIT License
32 stars 46 forks source link

[conan-center] Hooks regarding `test_package` and `cpp_info` #374

Open jgsogo opened 2 years ago

jgsogo commented 2 years ago

I'm proposing three hooks:

  1. Every recipe should have a test_package folder (default name for Conan to run after conan create) (+info: https://github.com/conan-io/conan-center-index/pull/8389). 🤔 Maybe it is already there.
  2. If cpp_info contains .name or .filename, then (one of) the generators cmake_find_package[_multi] are expected
  3. If cpp_info contains .set_property, then (one of) the generators CMakeDeps, MSBuildDeps, PkgConfigDeps are expected (maybe depending on the property).

Not really sure about the last two entries, not sure if we want (so) many packages with several test_xxxx folders.

uilianries commented 2 years ago
  1. Every recipe should have a testpackage folder (default name for Conan to run after conan create) (+info: [poc] Test other generators: run several tests in test*/conanfile.py conan-center-index#8389). thinking Maybe it is already there.

Yes, the Hook 24: TEST PACKAGE FOLDER: https://github.com/conan-io/hooks/blob/master/hooks/conan-center.py#L248

uilianries commented 2 years ago
  1. If cpp_info contains .set_property, then (one of) the generators CMakeDeps, MSBuildDeps, PkgConfigDeps are expected (maybe depending on the property).

We can not adopt it now. We are "migrating" recipes on CCI, supporting both cpp_info.names and set_property at same recipe to be prepared for 2.0, however, new generators are not used yet. We could think about a warning message to consider refactoring the recipe to new generators support.