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.

[feature] Allow to generate more than one Find/config CMake file per recipe

See original GitHub issue

Currently, for a given recipe, cmake_find_package and cmake_find_package_multi can generate one and only one CMake Find/config file, based on the value of self.cpp_info.filenames["cmake_find_package"]/self.cpp_info.filenames["cmake_find_package_multi"] in package_info().

Unfortunately, some libraries provide several config files for their components. In CCI, at least these recipes can’t properly model official config files:

  • mongo-c-driver
  • mongo-cxx-driver
  • spirv-tools
  • google-cloud-cpp

A simple solution would be to allow self.cpp_info.filenames["cmake_find_package"] and self.cpp_info.filenames["cmake_find_package_multi"] to take a tuple, and duplicate the same Find/config files when conan generators are executed. mongo-cxx-driver recipe relies on this trick to duplicate the generated config file of mongo-c-driver at build time to satisfy its build system without the need to patch it: https://github.com/conan-io/conan-center-index/blob/master/recipes/mongo-cxx-driver/all/conanfile.py#L146-L151

It would also be nice to support this feature in the new generator CMakeDeps for conan 2.0

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
prince-chrismccommented, Aug 1, 2021
0reactions
lasotecommented, Nov 8, 2021

Not discussed yet, sorry. Wouldn’t be difficult to generate several config files with the same content, but I know that the next feature request would be to have some components associated with one file and others to the other one and that could become pretty insane. So honestly I don’t know what to do with this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[feature] add property to CMakeDeps to source a package's ...
I think it would be very convenient if the CMakeDeps generator had an option to allow the <PKG>Config.cmake file installed in the package...
Read more >
CMakePackageConfigHelpers — CMake 3.25.1 Documentation
CMakePackageConfigHelpers ¶. Helpers functions for creating config files that can be included by other projects to find and use a package.
Read more >
cmake_find_package_multi — conan 1.53.0 documentation
Generated files ¶. For each conan package in your graph, it will generate 2 files and 1 more per different build_type . Being...
Read more >
Configure CMake - Android Developers
If you want to build multiple CMake projects and include their outputs in your Android project, you can use one CMakeLists.txt file as...
Read more >
makefile - Cmake vs make sample codes? - Stack Overflow
While Make is flexible tool for rules and recipe, CMake is a layer of abstraction that also adds the configuration feature. My plain...
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