[bug] conan 1.42.0: CMakeDeps does not inherit anymore from cmake_find_package_multi names
See original GitHub issueEnvironment Details (include every applicable attribute)
- Operating System+version: macOS Big Sur
- Compiler+version: Apple Clang 13
- Conan version: 1.42.0
- Python version: 3.9.7
Steps to reproduce (Include if Applicable)
- create a recipe where
self.cpp_info.names["cmake_find_package_multi"]
inpackage_info()
has a different name than recipe name (a simple one isutfcpp
recipe). - consume this recipe in a project and use
CMakeDeps
generator (you can replace cmake_find_package_multi by CMakeDeps in test_package of utfcpp recipe and run conan create).
=> generated config file and target will have default value (recipe name), so find_package()
and target_link_libraries()
might fail.
It has been seen in https://github.com/conan-io/conan-center-index/issues/7887
Workaround: migrate to set_property()
(which has an unwanted side effect in CONAN_PKG targets of cmake
generator: https://github.com/conan-io/conan-center-index/issues/7925, so the combination of those 2 issues is really annoying).
Issue Analytics
- State:
- Created 2 years ago
- Comments:24 (18 by maintainers)
Top Results From Across the Web
CMakeDeps — conan 1.56.0 documentation
The CMakeDeps is a multi-configuration generator, it can correctly create files for Release/Debug configurations to be simultaneously used by IDEs like Visual ...
Read more >Howto modify/affect/adapt conan dependencies - Stack Overflow
The obvious recommendation: Update Conan to the latest version (1.35.1). pip install -U conan. Packages in Conan Center Index (all official) ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok. Therefore I believe that:
CMakeDeps
shouldn’t be promoted by conan team (in tutorials, and Slack/reddit etc) until CCI recipes properly support it.CMakeToolchain
+cmake_find_package*
is the way to go currently.set_property()
in CCI (and therefore proper support ofCMakeDeps
) should begin whenset_property()
is stable enough.CMakeDeps
shouldn’t be recommended for consumers until the end of this transition.I guess what @SpaceIm means is that if you lowercase the config file
then all of
should now work on all platforms.