From a3b1a188934a11a1380dbbbe3c4a9aee1855cfc8 Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Wed, 15 Dec 2021 12:36:29 -0600 Subject: [PATCH] Configure the proper namespace for CMake targets --- recipes/boost/all/conanfile.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/recipes/boost/all/conanfile.py b/recipes/boost/all/conanfile.py index 5f3a51a5ecc25..f76428f22c8cc 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.43.0" # When adding (or removing) an option, also add this option to the list in @@ -1359,6 +1359,7 @@ def _option_to_conan_requirement(name): def package_info(self): self.env_info.BOOST_ROOT = self.package_folder + self.cpp_info.set_property("cmake_file_name", "Boost") 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" @@ -1368,6 +1369,7 @@ def package_info(self): # - Use '_libboost' component to attach extra system_libs, ... self.cpp_info.components["headers"].libs = [] + self.cpp_info.components["headers"].set_property("cmake_target_name", "Boost::headers") 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" @@ -1401,6 +1403,7 @@ 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"].set_property("cmake_target_name", "Boost::boost") self.cpp_info.components["_boost_cmake"].names["cmake_find_package"] = "boost" self.cpp_info.components["_boost_cmake"].names["cmake_find_package_multi"] = "boost" @@ -1408,6 +1411,7 @@ def package_info(self): self.cpp_info.components["_libboost"].requires = ["headers"] self.cpp_info.components["diagnostic_definitions"].libs = [] + self.cpp_info.components["diagnostic_definitions"].set_property("cmake_target_name", "Boost::diagnostic_definitions") 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 @@ -1416,6 +1420,7 @@ def package_info(self): self.cpp_info.components["diagnostic_definitions"].defines = ["BOOST_LIB_DIAGNOSTIC"] self.cpp_info.components["disable_autolinking"].libs = [] + self.cpp_info.components["disable_autolinking"].set_property("cmake_target_name", "Boost::disable_autolinking") 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 @@ -1433,6 +1438,7 @@ 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"].set_property("cmake_target_name", "Boost::dynamic_linking") 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 @@ -1548,6 +1554,7 @@ 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].set_property("cmake_target_name", "Boost::" + module) 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)