conan-center-index: [package] cereal/1.3.0: cereal cannot be found when using the `cmake_paths` generator

Package and Environment Details (include every applicable attribute)

  • Package Name/Version: cereal/1.3.0
  • Operating System+version: Linux Ubuntu 18.04
  • Compiler+version: GCC 8
  • Conan version: conan 1.27.0

Conan profile (output of conan profile show default or conan profile show <profile> if custom profile is in use)

[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=8
compiler.libcxx=libstdc++
build_type=Release
[options]
[build_requires]
[env]

Description

When installing the cereal package, the project gets installed but cereal-config.cmake subsequently removed, see here:

tools.rmdir(os.path.join(self.package_folder, "share"))

However, without this file, CMake cannot find the cereal package when using the conan_paths.cmake toolchain file. Everything works as expected if the line above is removed.

@stilgarpl actually already noted the issue in this comment in PR #881 but it seems like they did not yet open an issue to discuss about it.

Steps to reproduce (Include if Applicable)

  • conanfile.txt requires cereal/1.3.0 and sets cmake_paths as generator
  • CMakeLists.txt calls find_package(cereal REQUIRED)
  • cd build/
  • conan install ..
  • cmake .. -DCMAKE_TOOLCHAIN_FILE=conan_paths.cmake

Logs (Include/Attach if Applicable)

Click to expand log

CMake error at find_package(cereal REQUIRED):

CMake Error at CMakeLists.txt:52 (find_package):
  By not providing "Findcereal.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "cereal", but
  CMake did not find one.

  Could not find a package configuration file provided by "cereal" with any
  of the following names:

    cerealConfig.cmake
    cereal-config.cmake

  Add the installation prefix of "cereal" to CMAKE_PREFIX_PATH or set
  "cereal_DIR" to a directory containing one of the above files.  If "cereal"
  provides a separate development package or SDK, be sure it has been
  installed.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 19 (12 by maintainers)

Commits related to this issue

Most upvoted comments

I’ve open a feature request to Conan: https://github.com/conan-io/conan/issues/7352 I think these are details that cannot be added to cpp_info model, but we can workaround them using build_modules, wdyt?

Yes, several libraries don’t define namespace, I’ve pointed some issues with current behaviour in conan: https://github.com/conan-io/conan-center-index/issues/2144#issuecomment-654179166