Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new CMakeConfigDeps #17831

Merged
merged 2 commits into from
Feb 24, 2025
Merged

Conversation

memsharded
Copy link
Member

@memsharded memsharded commented Feb 21, 2025

Changelog: Feature: Make available in conanfiles the new incubating CMakeConfigDeps generator, still under the incubating "conf" feature flag.
Docs: conan-io/docs#3999

@memsharded memsharded added this to the 2.13.0 milestone Feb 21, 2025
@@ -11,6 +11,7 @@

_generators = {"CMakeToolchain": "conan.tools.cmake",
"CMakeDeps": "conan.tools.cmake",
"CMakeConfigDeps": "conan.tools.cmake",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am proposing this name, because I propose to support only generation of xxx-config.cmake files, not the legacy FindXXX.cmake format for several reasons:

  • There are no packages in ConanCenter that use self.cpp_info.set_property("cmake_find_mode", "module")
  • There are only 65 packages in ConanCenter that use self.cpp_info.set_property("cmake_find_mode", "both"). There might be consumers of those packages that are happy with config.cmake files.
  • Conan private usage is very likely to be 100% config.cmake files, I see very little reasons to want FindXXX.cmake modules besides legacy support for open source third party packages.
  • Some of the ConanCenter consumer recipes that rely on a FindXXX.cmake module file might be fixed by some patching to their CMakeLists.txt. If not, the existing CMakeDeps is not going to be retired anytime soon, it can be used in ConanCenter for a long time.
  • The logic of the FindXXX.cmake is different enough to be in a dedicated generator. If at some point we want a modern alternative to the CMakeDeps generator to generate FindXXX.cmake modules, we can create a dedicated CMakeFindDeps generator

Copy link
Contributor

@jcar87 jcar87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!!! LGTM

@memsharded memsharded merged commit b8dfc92 into conan-io:develop2 Feb 24, 2025
34 checks passed
@memsharded memsharded deleted the feature/cmakeconfigdeps branch February 24, 2025 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants