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
Toolchain declare DIR find package variables #9032
Toolchain declare DIR find package variables #9032
Conversation
|
||
def get_file_name(conanfile): | ||
"""Get the name of the file for the find_package(XXX)""" | ||
ret = conanfile.new_cpp_info.get_property("cmake_file_name", "CMakeDeps") |
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.
This is not very great now, that it depends explicitly on CMakeDeps
, while it has been made common and is being used not in CMakeDeps, but in CMakeToolchain. I understand why, but reads a bit confusing if you don't know it.
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.
It is used in both of them. Maybe that property shouldn't be attached to the CMakeDeps
generator by the recipe creator.
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.
I added a comment. Suggestion welcome.
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.
I am not fully convinced on the proposition of both having the property name and the specific generator as a specialization. We might want to revisit that, but yes, I guess at the moment this is fine here.
|
||
def get_file_name(conanfile): | ||
"""Get the name of the file for the find_package(XXX)""" | ||
ret = conanfile.new_cpp_info.get_property("cmake_file_name", "CMakeDeps") |
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.
I am not fully convinced on the proposition of both having the property name and the specific generator as a specialization. We might want to revisit that, but yes, I guess at the moment this is fine here.
@@ -409,10 +401,17 @@ def context(self): | |||
|
|||
os_ = self._conanfile.settings.get_safe("os") | |||
android_prefix = "${CMAKE_CURRENT_LIST_DIR}" if os_ == "Android" else None | |||
|
|||
host_req = self._conanfile.dependencies.transitive_host_requires | |||
find_names_needed = os_ in ('iOS', "watchOS", "tvOS") |
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.
This doesn't happen in OSX, right, only for these systems?
Changelog: Feature: The
conan_toolchain.cmake
now includesxxx_DIR
variables for the dependencies to ease thefind_package
mechanism to locate them. The declaration of these directories is a must when cross-building in OSX where CMake ignoresCMAKE_PREFIX_PATH
andCMAKE_MODULE_PATH
to look only at the system framework directories.Docs: conan-io/docs#2108