'cmake' generator use the package name for target 'CONAN_PKG::' - #6288
Merged
memsharded merged 5 commits intoJan 8, 2020
Merged
Conversation
…me>' instead of 'cpp_info.name'
jgsogo
added a commit
to jgsogo/conan
that referenced
this pull request
Jan 2, 2020
Contributor
Author
|
I've added here (#6292) a PR to |
danimtb
approved these changes
Jan 3, 2020
memsharded
requested changes
Jan 7, 2020
| def get_name(self, generator): | ||
| return self.names.get(generator, self.name) | ||
| def get_name(self, generator, pkg_name=None): | ||
| fallback_name = self.name if generator not in ["cmake", "cmake_multi"] else pkg_name # FIXME: Remove in v1.22 (https://github.com/conan-io/conan/issues/6269#issuecomment-570182130) |
Member
There was a problem hiding this comment.
This should mimic the behavior that will be implemented by conan-center-index when recipes are fixed, so it should affect probably cmake_paths generator too.
jgsogo
force-pushed
the
fix/cmake-conan_pkg-name
branch
from
January 7, 2020 13:19
1228ccb to
830b76e
Compare
memsharded
approved these changes
Jan 7, 2020
memsharded
left a comment
Member
There was a problem hiding this comment.
Check comment, change something if necessary or leave, and merge. Thanks.
| self.assertNotIn("my_pkg", content["conanbuildinfo_multi.cmake"]) | ||
| self.assertNotIn("MY_PKG", content["conanbuildinfo_multi.cmake"]) | ||
| self.assertIn('add_library(CONAN_PKG::MyPkG INTERFACE IMPORTED)', | ||
| self.assertNotIn("mypkg", content["conanbuildinfo_multi.cmake"]) |
Member
There was a problem hiding this comment.
It is obvious that these don't exist in content, as the package name is my_pkg. I am not sure what this assert is checking.
Contributor
Author
There was a problem hiding this comment.
Totally true, the one that could appear is MyPkG (the cpp_info.name). Changed it, after CI runs, I'll merge it.
jgsogo
added a commit
to jgsogo/conan
that referenced
this pull request
Jan 28, 2020
…:' (conan-io#6288)" This reverts commit 1bdbf18.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog: Fix: Generators
cmakeandcmake_multiuse the name of the package instead ofcpp_info.name(this change is to be reverted in 1.22)Docs: omit
closes #6269
This PR is a patch to keep previous behavior (and future one) related to the name used by the generators. In this PR the
cmakegenerator will use the value incpp_info.names["cmake"]or the package name (it won't usecpp_info.name). With this workaround we don't need to change any recipe inconan-center-indexright now to match the desired behavior, we can wait until Conan v1.22.Read the rationale in this comment: #6269 (comment)