Conan-center-index: [package] catch2/2.9.2: Expected CMake scripts to be included in the package

Created on 30 Oct 2019  路  11Comments  路  Source: conan-io/conan-center-index

Package and Environment Details (include every applicable attribute)

  • Package Name/Version: catch2/2.9.2

I expected to have access to cmake scripts that are installed with Catch2.

The helper scripts are set to be installed.

https://github.com/conan-io/conan-center-index/blob/6a7ff72be4e6fa6362112459f7319f6e6e565a99/recipes/catch2/2.x.x/conanfile.py#L33

Then they are deleted during packaging.

https://github.com/conan-io/conan-center-index/blob/6a7ff72be4e6fa6362112459f7319f6e6e565a99/recipes/catch2/2.x.x/conanfile.py#L51

Currently, I am using the older bincrafters package (catch2/2.5.0@bincrafters/stable) which still includes the CMake scripts. I would need to maintain my own conan package to use the newer version of Catch2.

bug high

All 11 comments

Catch2 provides more than just install scripts though: some of the provided CMake scripts such as CatchAddTests.cmake allow to discover Catch tests in the source and register them as CTest tests. It's notably not the Config.cmake files and yet they seem to be removed to from the package.

Those scripts should be kept since they're not meant for dependency discovery.

In that case, it is totally fine to have them packaged. Thanks for the info @Morwenn

Thanks for the response

@Morwenn That is exactly my use case. I use catch_discover_tests.

@danimtb I'll keep updated with https://github.com/conan-io/conan/issues/5798 and https://github.com/conan-io/conan-center-index/issues/209 for now. For now, I'll keep using the old package. Do you want to close this issue or keep it open to specifically track the catch2 package?

If I understand correctly this issue is independent of the ones you linked to: they try to solve the problems with packages that provide more than the basic dependency mechanisms in Find*.cmake and *Config.cmake files. In the test of Catch2 the relevant files are separate from the dependency-finding ones, so we should update the Catch2 recipe to not get rid of them.

The CMake scripts require the config file to be loaded so that they are in the path. The first bullet point of https://github.com/conan-io/conan/issues/5798#issuecomment-537469608 should fix this.

Edit: Fixed typo

This issue is not fixed as CatchAddTests.cmake is still missing from the package, which is required by catch_discover_tests.

@danimtb Can you please re-open this issue?

@pleroux0 I gonna submit a new PR with a fix. Thanks for reporting

Can this issue be closed?

Closed by #292. Thanks @Morwenn!

Was this page helpful?
0 / 5 - 0 ratings