-
Notifications
You must be signed in to change notification settings - Fork 993
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
xcodedeps: provide package root dir #11818
Conversation
cc6de3f
to
26b70aa
Compare
Hi @the-nic, Thanks for the contribution. I think that maybe it would be better to use the resdirs information from the cppinfo so that if a package have a directory for resources it is available. And a variable something like Is there a case where you need to access directly the package folder that is not covered by the case that you add the resdir to the cppinfo and have access to it? |
Certainly, this would be a good addition, too.
The problem is, these are often multiple paths and if I have to reference a specific file from the package, it its impossible to do without the single root path. Additionally, the cmake generator also provides a package root path, so they become a bit more on par. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @the-nic,
I was thinking that probably it would be better to define this variable in the file that includes all components for the package instead here, and not with the component suffix but just as: PACKAGE_ROOT_<package>
because that information will be the same for all the components. WDYT?
Good point, I'll update the PR |
Hi @czoido I tried your suggestion right now and the problem is that the even though the information is the same for all components, its not the same for all configurations. And only the component files seem to be configuration-aware. Otherwise, we'd have to update the package file on each time a new configuration is added... |
Hi @the-nic, |
If one wants to access other folders than the provided ones (like resources), the provided variables dont contain enough information to access these folders. Provide a new variable, `PACKAGE_ROOT_<package>` pointing to the root directory of the package allowing to use it within xcode. We have to pass the package folder as another parameter, because the `transitive_cpp_info` variable does not contain the `rootpath` attribute and we also cant access the package_folder attribute from `self._conanfile.dependencies.package_folder` directly because the package name is already formatted via `_format_name`.
26b70aa
to
4a0ce76
Compare
@czoido I have removed the component name from the root dir variable. |
Thanks a lot @the-nic, |
Changelog: Feature: Defines the
PACKAGE_ROOT_<package>
variable in XcodeDeps generated files.Docs: conan-io/docs#2717
If one wants to access other folders than the provided ones (like
resources), the provided variables dont contain enough information
to access these folders.
Provide a new variable,
PACKAGE_ROOT_<package>_<component>
pointingto the root directory of the package allowing to use it within xcode.
We have to pass the package folder as another parameter, because the
transitive_cpp_info
variable does not contain therootpath
attribute and we also cant access the package_folder attribute from
self._conanfile.dependencies.package_folder
directly becausethe package name is already formatted via
_format_name
.develop
branch, documenting this one.Note: By default this PR will skip the slower tests and will use a limited set of python versions. Check here how to increase the testing level by writing some tags in the current PR body text.