From 3346dd293b6762314296d41092d82499d98e38ab Mon Sep 17 00:00:00 2001 From: Dmitry Bely Date: Thu, 18 Nov 2021 19:59:20 +0300 Subject: [PATCH] Use set_property for boost --- recipes/boost/all/conanfile.py | 38 ++++++++++++++-------------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/recipes/boost/all/conanfile.py b/recipes/boost/all/conanfile.py index 6b74ffc014c1d1..7defa60013ebb6 100644 --- a/recipes/boost/all/conanfile.py +++ b/recipes/boost/all/conanfile.py @@ -16,7 +16,7 @@ except ImportError: from io import StringIO -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.36.0" # When adding (or removing) an option, also add this option to the list in @@ -1341,18 +1341,16 @@ def _option_to_conan_requirement(name): def package_info(self): self.env_info.BOOST_ROOT = self.package_folder - self.cpp_info.filenames["cmake_find_package"] = "Boost" - self.cpp_info.filenames["cmake_find_package_multi"] = "Boost" - self.cpp_info.names["cmake_find_package"] = "Boost" - self.cpp_info.names["cmake_find_package_multi"] = "Boost" + self.cpp_info.set_property("cmake_file_name", "Boost") + self.cpp_info.set_property("cmake_target_name", "Boost") + self.cpp_info.set_property("pkg_config_name", "Boost") # - Use 'headers' component for all includes + defines # - Use '_libboost' component to attach extra system_libs, ... self.cpp_info.components["headers"].libs = [] - self.cpp_info.components["headers"].names["cmake_find_package"] = "headers" - self.cpp_info.components["headers"].names["cmake_find_package_multi"] = "headers" - self.cpp_info.components["headers"].names["pkg_config"] = "boost" + self.cpp_info.components["headers"].set_property("cmake_target_name", "headers") + self.cpp_info.components["headers"].set_property("pkg_config_name", "headers") if self.options.system_no_deprecated: self.cpp_info.components["headers"].defines.append("BOOST_SYSTEM_NO_DEPRECATED") @@ -1383,24 +1381,22 @@ def package_info(self): # Boost::boost is an alias of Boost::headers self.cpp_info.components["_boost_cmake"].requires = ["headers"] - self.cpp_info.components["_boost_cmake"].names["cmake_find_package"] = "boost" - self.cpp_info.components["_boost_cmake"].names["cmake_find_package_multi"] = "boost" + self.cpp_info.components["_boost_cmake"].set_property("cmake_target_name", "boost") + self.cpp_info.components["_boost_cmake"].set_property("pkg_config_name", "boost") if not self.options.header_only: self.cpp_info.components["_libboost"].requires = ["headers"] self.cpp_info.components["diagnostic_definitions"].libs = [] - self.cpp_info.components["diagnostic_definitions"].names["cmake_find_package"] = "diagnostic_definitions" - self.cpp_info.components["diagnostic_definitions"].names["cmake_find_package_multi"] = "diagnostic_definitions" - self.cpp_info.components["diagnostic_definitions"].names["pkg_config"] = "boost_diagnostic_definitions" # FIXME: disable on pkg_config + self.cpp_info.components["diagnostic_definitions"].set_property("cmake_target_name", "diagnostic_definitions") + self.cpp_info.components["diagnostic_definitions"].set_property("pkg_config_name", "boost_diagnostic_definitions") # FIXME: disable on pkg_config self.cpp_info.components["_libboost"].requires.append("diagnostic_definitions") if self.options.diagnostic_definitions: self.cpp_info.components["diagnostic_definitions"].defines = ["BOOST_LIB_DIAGNOSTIC"] self.cpp_info.components["disable_autolinking"].libs = [] - self.cpp_info.components["disable_autolinking"].names["cmake_find_package"] = "disable_autolinking" - self.cpp_info.components["disable_autolinking"].names["cmake_find_package_multi"] = "disable_autolinking" - self.cpp_info.components["disable_autolinking"].names["pkg_config"] = "boost_disable_autolinking" # FIXME: disable on pkg_config + self.cpp_info.components["disable_autolinking"].set_property("cmake_target_name", "disable_autolinking") + self.cpp_info.components["disable_autolinking"].set_property("pkg_config_name", "boost_disable_autolinking") # FIXME: disable on pkg_config self.cpp_info.components["_libboost"].requires.append("disable_autolinking") if self._is_msvc or self._is_clang_cl: if self.options.magic_autolink: @@ -1415,9 +1411,8 @@ def package_info(self): self.output.info("Disabled magic autolinking (smart and magic decisions)") self.cpp_info.components["dynamic_linking"].libs = [] - self.cpp_info.components["dynamic_linking"].names["cmake_find_package"] = "dynamic_linking" - self.cpp_info.components["dynamic_linking"].names["cmake_find_package_multi"] = "dynamic_linking" - self.cpp_info.components["dynamic_linking"].names["pkg_config"] = "boost_dynamic_linking" # FIXME: disable on pkg_config + self.cpp_info.components["dynamic_linking"].set_property("cmake_target_name", "dynamic_linking") + self.cpp_info.components["dynamic_linking"].set_property("pkg_config_name", "boost_dynamic_linking") # FIXME: disable on pkg_config self.cpp_info.components["_libboost"].requires.append("dynamic_linking") if self._shared: # A Boost::dynamic_linking cmake target does only make sense for a shared boost package @@ -1530,9 +1525,8 @@ def filter_transform_module_libraries(names): self.cpp_info.components[module].libs = module_libraries self.cpp_info.components[module].requires = self._dependencies["dependencies"][module] + ["_libboost"] - self.cpp_info.components[module].names["cmake_find_package"] = module - self.cpp_info.components[module].names["cmake_find_package_multi"] = module - self.cpp_info.components[module].names["pkg_config"] = "boost_{}".format(module) + self.cpp_info.components[module].set_property("cmake_target_name", module) + self.cpp_info.components[module].set_property("pkg_config_name", "boost_{}".format(module)) for requirement in self._dependencies.get("requirements", {}).get(module, []): if self.options.get_safe(requirement, None) == False: