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.

cmake_find_package_multi and version information

See original GitHub issue

To help us debug your issue please explain:

  • I’ve read the CONTRIBUTING guide.
  • I’ve specified the Conan version, operating system version and any tool that can be relevant.
  • I’ve explained the steps to reproduce the error or the motivation/use case of the question/suggestion.

I was writing a Conan recipe for ITK 5 which uses Eigen3 and requires it through the following CMake line (see the corresponding issue for more background information):

find_package(Eigen3 REQUIRED CONFIG)

Long story short, after having bypassed a recipe-specific issue, I managed to get CMake to find the right CMake config file generated with the Conan generator cmake_find_package_multi, but the configuration step eventually failed with the following error:

CMake Error at source_subfolder/Modules/ThirdParty/Eigen3/CMakeLists.txt:56 (find_package):
  Could not find a configuration file for package "Eigen3" that is compatible
  with requested version "3.3".

  The following configuration files were considered but not accepted:

    ~/.conan/data/itk/5.0.1/myteam/stable/build/a9e815bf664154117de467f08af021beb20b7cc4/Eigen3Config.cmake, version: unknown

The recipe I used was that for Eigen 3.3.7, so Conan has the version information, but it seems that this information wasn’t propagated to the files generated by cmake_find_package_multi, triggering the error above.

Would it be possible to forward the version information to the files generated by this generator so that examples like the one above work?

Conan version: 1.19.1 CMake version: 3.10.2

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
SSE4commented, Nov 6, 2019

@lasote yes, sure

2reactions
lasotecommented, Oct 10, 2019

Now I have another issue because it looks for Eigen3::Eigen but the target generated is most likely Eigen3::Eigen3. It’s another issue and I’m not sure that there is an easy workaround from the Conan side, I’ll patch my ITK CMake instead.

No, we have a new cppinfo.name but it changes both scope and name: Eigen3XXX::Eigen3XXX at the same time… We tried to create the concept of components in the cppinfo but it is a blocked feature for several different reasons: https://github.com/conan-io/conan/issues/5090

Read more comments on GitHub >

github_iconTop Results From Across the Web

[question] Referencing custom cmake macros in conan create ...
Using the 'cmakefindpackagemulti' generator creates it's own buildtools-config.cmake file which lets findpackage work but the generated -config.cmake 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