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

[question] Conan 1.42.2 vs 1.43.0 for cmake target names #10170

Closed
gabyx opened this issue Dec 13, 2021 · 9 comments
Closed

[question] Conan 1.42.2 vs 1.43.0 for cmake target names #10170

gabyx opened this issue Dec 13, 2021 · 9 comments
Assignees

Comments

@gabyx
Copy link

gabyx commented Dec 13, 2021

Why does Conan 1.42
produce for

  def build_requirements(self):
      self.build_requires("gtest/1.11.0", force_host_context=True)

a target Gtest::gtest (with find_package(GTest CONFIG REQUIRED))
while
conan 1.43 produces only gtest.

I dont get that why this changed?

@gabyx
Copy link
Author

gabyx commented Dec 13, 2021

Does that break with 1.43 because:

https://conan.io/center/gtest?tab=recipe

        self.cpp_info.components["libgtest"].set_property("cmake_target_name", "gtest")

instead of GTest::gtest ?

@memsharded memsharded self-assigned this Dec 13, 2021
@memsharded
Copy link
Member

Yes, that is what is happenning. We had to do a breaking change in the cmake_target_name property, as it was causing too many struggles in the migration of legacy generators like cmake_find_package.

Please read in https://docs.conan.io/en/latest/conan_v2.html#new-properties-model-for-the-cpp-info-in-conan-2-0-generators

The idea:

  • cmake_target_name now only for CMakeDeps
  • cmake_target_name is always an absolute target name like Gtest::gtest, to make it more flexible
  • legacy generators like cmake_find_package will only listen to .names field in cpp_info
  • We introduced back the .names in ConanCenter recipes that had removed it
  • We are fixing the cmake_target_name in ConanCenter as quickly as possible

@gabyx
Copy link
Author

gabyx commented Dec 13, 2021

Thanks a lot, for the info!
Thats very good to know. As a suggestion, maybe, include that it breaks ConanCenter also in the Changelog, so that you dont need to answer such question anymore. Maybe you can later drop, the mention in the Changelog, as soon as it is fixed.

@memsharded
Copy link
Member

Thats very good to know. As a suggestion, maybe, include that it breaks ConanCenter also in the Changelog, so that you dont need to answer such question anymore. Maybe you can later drop, the mention in the Changelog, as soon as it is fixed.

Sure! We are actually writing some more detailed explanations, that we wanted to link, probably tomorrow. But feel free to send PRs for this kind of things too, the docs are open source, so this can be contributed quickly and easily too, and that helps too.

@gabyx
Copy link
Author

gabyx commented Dec 13, 2021

Jup!

@czoido
Copy link
Contributor

czoido commented Dec 13, 2021

There's a PR already open for gtest to fix targets: conan-io/conan-center-index#8324
And the guide PR is already open as well: conan-io/conan-center-index#8415

@gabyx
Copy link
Author

gabyx commented Dec 13, 2021

conan-io/docs#2326

@gabyx
Copy link
Author

gabyx commented Dec 13, 2021

Is there a collecting ticket which makes ConanCenter compatible with 1.43.0 ? So I could include it in the status banner in
conan-io/docs#2326

@memsharded
Copy link
Member

Closing this ticket as outdated, seems solved too, but please don't hesitate to create new tickets if necessary for any further question. Thanks!

@memsharded memsharded closed this as not planned Won't fix, can't repro, duplicate, stale Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants