-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
set opencl pkg_config name #8623
Conversation
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.
update required_conan_version = ">=1.43.0"
please
self.cpp_info.names["cmake_find_package"] = "OpenCL" | ||
self.cpp_info.names["cmake_find_package_multi"] = "OpenCL" | ||
self.cpp_info.names["pkg_config"] = "OpenCL" | ||
self.cpp_info.set_property("cmake_target_name", "OpenCL") |
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.
self.cpp_info.set_property("cmake_target_name", "OpenCL") | |
self.cpp_info.set_property("cmake_target_name", "OpenCL::Headers") |
self.cpp_info.names["cmake_find_package"] = "OpenCL" | ||
self.cpp_info.names["cmake_find_package_multi"] = "OpenCL" | ||
self.cpp_info.names["pkg_config"] = "OpenCL" |
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.
self.cpp_info.names["pkg_config"] = "OpenCL" | |
self.cpp_info.set_property("pkg_config_name", "OpenCL") |
This comment has been minimized.
This comment has been minimized.
self.cpp_info.components["_opencl-headers"].names["cmake_find_package"] = "Headers" | ||
self.cpp_info.components["_opencl-headers"].names["cmake_find_package_multi"] = "Headers" | ||
self.cpp_info.components["_opencl-headers"].set_property("cmake_target_name", "OpenCL::Headers") | ||
self.cpp_info.components["_opencl-headers"].set_property("pkg_config_name", "OpenCL") | ||
|
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.
You know you can accept suggestions through github? It saves time sometimes.
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.
yes, but I prefer to test that locally before committing
self.cpp_info.names["cmake_find_package"] = "OpenCL" | ||
self.cpp_info.names["cmake_find_package_multi"] = "OpenCL" | ||
self.cpp_info.set_property("cmake_target_name", "OpenCL::OpenCL") |
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.
self.cpp_info.set_property("cmake_target_name", "OpenCL::OpenCL") | |
self.cpp_info.set_property("cmake_target_name", "OpenCL::Headers") |
No (same review than #8623 (comment))
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.
can you explain that? from the docs it seems that this recipe generates the target OpenCL::OpenCL
for both the cmake_find_package
and the cmake_find_package_multi
generators.
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's an unwanted side effect of cmake_find_package, the truth is OpenCL-Headers source code which only provides OpenCL::Headers
target. set_property()
is better in this case, and we should drop those side effects in CMakeDeps
.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
self.cpp_info.components["_opencl-headers"].names["cmake_find_package"] = "Headers" | ||
self.cpp_info.components["_opencl-headers"].names["cmake_find_package_multi"] = "Headers" | ||
self.cpp_info.components["_opencl-headers"].set_property("cmake_target_name", "OpenCL::Headers") | ||
self.cpp_info.components["_opencl-headers"].set_property("pkg_config_name", "OpenCLHeaders") |
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.
self.cpp_info.components["_opencl-headers"].set_property("pkg_config_name", "OpenCLHeaders") | |
self.cpp_info.components["_opencl-headers"].set_property("pkg_config_name", "OpenCLHeaders") |
No, if "official" pkg-config file is OpenCL.pc
, just set pkg_config_name
to OpenCL
.
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.
but this causes PkgConfigDeps
to generate a self including file:
Name: OpenCL
Description: Conan package: OpenCL
Version: 2021.06.30
Requires: OpenCL
with this change it generates
Name: OpenCL
Description: Conan package: OpenCL
Version: 2021.06.30
Requires: OpenCLHeaders
and
prefix=/home/conan/.conan/data/opencl-headers/2021.06.30/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9
libdir1=${prefix}/lib
includedir1=${prefix}/include
Name: OpenCLHeaders
Description: Conan component: OpenCLHeaders
Version: 2021.06.30
Libs: -L"${libdir1}" -F Frameworks
Cflags: -I"${includedir1}"
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 would say it's a bug of PkgConfigDeps
, it's still experimental.
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.
what would you expect the generator to do?
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.
Actually i would expect the component pkg-config file to override the global pkg-config file like it happens for pkg-config
generator
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.
@SpaceIm, I think that here maybe the best would be not to declare the pkg_config_name
property in the component at all, just for the root cpp_info, so Conan will create a new name for the component (OpenCL-_opencl-headers.pc
in this case) that is included in the OpenCL.pc
that is the one we want.
Doing that names will not collide and also not declaring the property with other invented named we don't promote names that are not official... Also, for Conan 1.45 we have added a warning to try to avoid names overlapping when using PkgConfigDeps
. WDYT?
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.
Conan 1.45 will bring the same behavior for PkgConfigDeps
. It's already tested here conan-io/conan#10344. The documentation is pending but it's ongoing.
In summary, you can put:
self.cpp_info.components["_opencl-headers"].set_property("pkg_config_name", "OpenCL")
and you're not going to create the self including file anymore.
I detected other pull requests that are modifying opencl-headers/all recipe: This message is automatically generated by https://github.com/ericLemanissier/conan-center-conflicting-prs so don't hesitate to report issues/improvements there. |
This comment has been minimized.
This comment has been minimized.
Failure in build 3 (
Note: To save resources, CI tries to finish as soon as an error is found. For this reason you might find that not all the references have been launched or not all the configurations for a given reference. Also, take into account that we cannot guarantee the order of execution as it depends on CI workload and workers availability. |
this PR can be closed, pkg-config name has been fixed already in #9259 |
Specify library name and version: opencl-headers
the name of the pc file installed by
ocl-icd
system package is OpenCL.pcconan-center hook activated.