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

openssl-3.x.x: Migrating names and build_modules to set_property format #8059

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions recipes/openssl/3.x.x/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import os
import textwrap

required_conan_version = ">=1.33.0"
required_conan_version = ">=1.36.0"


class OpenSSLConan(ConanFile):
Expand Down Expand Up @@ -711,13 +711,14 @@ def _module_file_rel_path(self):
"conan-official-{}-variables.cmake".format(self.name))

def package_info(self):
self.cpp_info.names["cmake_find_package"] = "OpenSSL"
self.cpp_info.names["cmake_find_package_multi"] = "OpenSSL"
self.cpp_info.names["pkg_config"] = "openssl"
self.cpp_info.set_property("cmake_target_name", "OpenSSL")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have forgotten cmake_file_name, now it generates Findopenssl.cmake instead of FindOpenSSL.cmake. Therefore test package uses built-in FindOpenSSL.cmake from CMake installation instead of conan generated one.

self.cpp_info.set_property("pkg_config_name", "openssl")

self.cpp_info.components["ssl"].builddirs.append(self._module_subfolder)
self.cpp_info.components["ssl"].build_modules["cmake_find_package"] = [self._module_file_rel_path]
self.cpp_info.components["ssl"].set_property("cmake_build_modules", [self._module_file_rel_path])
self.cpp_info.components["crypto"].builddirs.append(self._module_subfolder)
self.cpp_info.components["crypto"].build_modules["cmake_find_package"] = [self._module_file_rel_path]
self.cpp_info.components["crypto"].set_property("cmake_build_modules", [self._module_file_rel_path])

if self._use_nmake:
libsuffix = "d" if self.settings.build_type == "Debug" else ""
self.cpp_info.components["ssl"].libs = ["libssl" + libsuffix]
Expand All @@ -743,9 +744,7 @@ def package_info(self):
self.cpp_info.components["crypto"].system_libs.append("atomic")
self.cpp_info.components["ssl"].system_libs.append("atomic")

self.cpp_info.components["crypto"].names["cmake_find_package"] = "Crypto"
self.cpp_info.components["crypto"].names["cmake_find_package_multi"] = "Crypto"
self.cpp_info.components["crypto"].names["pkg_config"] = "libcrypto"
self.cpp_info.components["ssl"].names["cmake_find_package"] = "SSL"
self.cpp_info.components["ssl"].names["cmake_find_package_multi"] = "SSL"
self.cpp_info.components["ssl"].names["pkg_config"] = "libssl"
self.cpp_info.components["crypto"].set_property("cmake_target_name", "Crypto")
self.cpp_info.components["crypto"].set_property("pkg_config_name", "libcrypto")
self.cpp_info.components["ssl"].set_property("cmake_target_name", "SSL")
self.cpp_info.components["ssl"].set_property("pkg_config_name", "libssl")