question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[package] zlib/1.2.11: cmake find_package generates wrong filename

See original GitHub issue

Package and Environment Details (include every applicable attribute)

  • Package Name/Version: zlib/1.2.11
  • Conan version: conan 1.19.1
  • Python version: Python 3.7.4

Conan profile

[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]

Steps to reproduce (Include if Applicable)

Create conanfile.txt with contents:

[requires]
boost/1.71.0

[generators]
cmake_find_package
cmake_paths

CMakeLists.txt:

include(${CMAKE_BINARY_DIR}/conan_paths.cmake)

find_package(boost REQUIRED)

Run

$ mkdir build && cd build
$ conan install ..
$ cmake ..

Expected: boost is found by CMake.

Actual:

By not providing "Findzlib.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "zlib", but
  CMake did not find one.

I’m pretty sure this is the offending commit: https://github.com/conan-io/conan-center-index/commit/eda6295c4d5cfa725bf2f00a7dd15f35c306018c but I suspect there was a reason for making the change. If I rename FindZLIB.cmake to Findzlib.cmake, it finds the package successfully. This is because the generated Findboost.cmake contains this line:

    find_dependency(zlib REQUIRED)

cc @uilianries

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
SSE4commented, Oct 29, 2019

@sztomi I believe this stability guarantee applies to the conan client itself. as for recipes I guess the policy is to be compatible with the latest release https://github.com/conan-io/conan-center-index/wiki

Make sure you are using the latest Conan client version, the recipes might evolve introducing features of the newer Conan releases
0reactions
danimtbcommented, Oct 30, 2019

@sztomi was your question solved? Can we close this issue? thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

find_package — CMake 3.25.1 Documentation
If the package configuration file cannot be found CMake will generate an error describing the problem unless the QUIET argument is specified.
Read more >
CMake FIND_PACKAGE succeeds but returns wrong path
This problem occurs when using some older versions of boost with cmake-2.8.6-rc2 or later, where the boost package finding code was changed.
Read more >
Creating your own projects using CMake - Open Babel
The filename of modules to find packages must start with Find. ... Next, calling find_package will execute the module to find openbabel and...
Read more >
find_package(ZLIB) is not idempotent (#21343) · Issues - GitLab
cmake version 3.16.3 (on Debian Linux) cmake version 3.15.19101501-MSVC_2 (on Windows 10) It seems that find_package(ZLIB) is not idemponent ...
Read more >
[Urgent] Error during catkin_make: can't find turtle_ros_3d
CMake Error at /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package): Could not find a package configuration file ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found