From b3c5a1c3835d5a705fe75c249c5d79225efa40ce Mon Sep 17 00:00:00 2001 From: Viktor Arvidsson Date: Thu, 3 Feb 2022 23:55:56 +0100 Subject: [PATCH 1/8] Qt6: Added option to use the bundled versions of dependencies. --- recipes/qt/6.x.x/conanfile.py | 73 ++++++++++++++++++----------------- 1 file changed, 38 insertions(+), 35 deletions(-) diff --git a/recipes/qt/6.x.x/conanfile.py b/recipes/qt/6.x.x/conanfile.py index 48c6128b723a5..8aeb7eea99832 100644 --- a/recipes/qt/6.x.x/conanfile.py +++ b/recipes/qt/6.x.x/conanfile.py @@ -63,16 +63,16 @@ class QtConan(ConanFile): "opengl": ["no", "desktop", "dynamic"], "with_vulkan": [True, False], "openssl": [True, False], - "with_pcre2": [True, False], + "with_pcre2": [True, False, "qt"], "with_glib": [True, False], - "with_doubleconversion": [True, False], - "with_freetype": [True, False], + "with_doubleconversion": [True, False, "qt"], + "with_freetype": [True, False, "qt"], "with_fontconfig": [True, False], "with_icu": [True, False], - "with_harfbuzz": [True, False], - "with_libjpeg": ["libjpeg", "libjpeg-turbo", False], - "with_libpng": [True, False], - "with_sqlite3": [True, False], + "with_harfbuzz": [True, False, "qt"], + "with_libjpeg": ["libjpeg", "libjpeg-turbo", False, "qt"], + "with_libpng": [True, False, "qt"], + "with_sqlite3": [True, False, "qt"], "with_mysql": [True, False], "with_pq": [True, False], "with_odbc": [True, False], @@ -259,7 +259,7 @@ def validate(self): if self.settings.os != "Windows" and self.options.get_safe("opengl", "no") == "dynamic": raise ConanInvalidConfiguration("Dynamic OpenGL is supported only on Windows.") - if self.options.get_safe("with_fontconfig", False) and not self.options.get_safe("with_freetype", False): + if self.options.get_safe("with_fontconfig", False) and not self.options.get_safe("with_freetype", False) is True: raise ConanInvalidConfiguration("with_fontconfig cannot be enabled if with_freetype is disabled.") if "MT" in self.settings.get_safe("compiler.runtime", default="") and self.options.shared: @@ -273,7 +273,7 @@ def requirements(self): self.requires("zlib/1.2.11") if self.options.openssl: self.requires("openssl/1.1.1m") - if self.options.with_pcre2: + if self.options.with_pcre2 is True: self.requires("pcre2/10.37") if self.options.get_safe("with_vulkan"): self.requires("vulkan-loader/1.2.182") @@ -281,24 +281,24 @@ def requirements(self): self.requires("moltenvk/1.1.4") if self.options.with_glib: self.requires("glib/2.70.1") - if self.options.with_doubleconversion and not self.options.multiconfiguration: + if self.options.with_doubleconversion is True and not self.options.multiconfiguration: self.requires("double-conversion/3.1.7") - if self.options.get_safe("with_freetype", False) and not self.options.multiconfiguration: + if self.options.get_safe("with_freetype", False) is True and not self.options.multiconfiguration: self.requires("freetype/2.11.0") if self.options.get_safe("with_fontconfig", False): self.requires("fontconfig/2.13.93") if self.options.get_safe("with_icu", False): self.requires("icu/70.1") - if self.options.get_safe("with_harfbuzz", False) and not self.options.multiconfiguration: + if self.options.get_safe("with_harfbuzz", False) is True and not self.options.multiconfiguration: self.requires("harfbuzz/3.2.0") if self.options.get_safe("with_libjpeg", False) and not self.options.multiconfiguration: if self.options.with_libjpeg == "libjpeg-turbo": self.requires("libjpeg-turbo/2.1.2") - else: + elif self.options.with_libjpeg == "libjpeg": self.requires("libjpeg/9d") - if self.options.get_safe("with_libpng", False) and not self.options.multiconfiguration: + if self.options.get_safe("with_libpng", False) is True and not self.options.multiconfiguration: self.requires("libpng/1.6.37") - if self.options.with_sqlite3 and not self.options.multiconfiguration: + if self.options.with_sqlite3 is True and not self.options.multiconfiguration: self.requires("sqlite3/3.37.2") self.options["sqlite3"].enable_column_metadata = True if self.options.get_safe("with_mysql", False): @@ -402,7 +402,9 @@ def source(self): tools.replace_in_file(os.path.join("qt6", "CMakeLists.txt"), "enable_testing()", - "include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)\nconan_basic_setup(KEEP_RPATHS)\n" + "include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)\n" + "list(REMOVE_ITEM CONAN_INCLUDE_DIRS \"${CONAN_INCLUDE_DIRS_STRAWBERRYPERL}\")\n" # strawberryperl exports includes for jpg, png and many other dependencies that might interfere with the build + "conan_basic_setup(KEEP_RPATHS)\n" "set(QT_EXTRA_INCLUDEPATHS ${CONAN_INCLUDE_DIRS})\n" "set(QT_EXTRA_DEFINES ${CONAN_DEFINES})\n" "set(QT_EXTRA_LIBDIRS ${CONAN_LIB_DIRS})\n" @@ -572,22 +574,23 @@ def _configure_cmake(self): self._cmake.definitions["FEATURE_%s" % conf_arg] = ("ON" if self.options.get_safe(opt, False) else "OFF") - for opt, conf_arg in [ - ("with_doubleconversion", "doubleconversion"), - ("with_freetype", "freetype"), - ("with_harfbuzz", "harfbuzz"), - ("with_libjpeg", "jpeg"), - ("with_libpng", "png"), - ("with_sqlite3", "sqlite"), - ("with_pcre2", "pcre2"),]: - if self.options.get_safe(opt, False): - if self.options.multiconfiguration: - self._cmake.definitions["FEATURE_%s" % conf_arg] = "ON" + for opt, feature, conf_arg in [ + ("with_doubleconversion", "doubleconversion", "doubleconversion"), + ("with_freetype", "freetype", "freetype"), + ("with_harfbuzz", "harfbuzz", "harfbuzz"), + ("with_libjpeg", "jpeg", "jpeg"), + ("with_libpng", "png", "png"), + ("with_sqlite3", "sqlite", "sql_sqlite"), + ("with_pcre2", "pcre2", "pcre2"),]: + if self.options.get_safe(opt, False) is not False: + self._cmake.definitions["FEATURE_%s" % conf_arg] = "ON" + if self.options.multiconfiguration or self.options.get_safe(opt, False) == "qt": + self._cmake.definitions["FEATURE_system_%s" % feature] = "OFF" else: - self._cmake.definitions["FEATURE_system_%s" % conf_arg] = "ON" + self._cmake.definitions["FEATURE_system_%s" % feature] = "ON" else: self._cmake.definitions["FEATURE_%s" % conf_arg] = "OFF" - self._cmake.definitions["FEATURE_system_%s" % conf_arg] = "OFF" + self._cmake.definitions["FEATURE_system_%s" % feature] = "OFF" if self.settings.os == "Macos": self._cmake.definitions["FEATURE_framework"] = "OFF" @@ -853,9 +856,9 @@ def _create_plugin(pluginname, libname, type, requires): self.cpp_info.components[componentname].requires = _get_corrected_reqs(requires) core_reqs = ["zlib::zlib"] - if self.options.with_pcre2: + if self.options.with_pcre2 is True: core_reqs.append("pcre2::pcre2") - if self.options.with_doubleconversion: + if self.options.with_doubleconversion is True: core_reqs.append("double-conversion::double-conversion") if self.options.get_safe("with_icu", False): core_reqs.append("icu::icu") @@ -877,9 +880,9 @@ def _create_plugin(pluginname, libname, type, requires): gui_reqs = [] if self.options.with_dbus: gui_reqs.append("DBus") - if self.options.with_freetype: + if self.options.with_freetype is True: gui_reqs.append("freetype::freetype") - if self.options.with_libpng: + if self.options.with_libpng is True: gui_reqs.append("libpng::libpng") if self.options.get_safe("with_fontconfig", False): gui_reqs.append("fontconfig::fontconfig") @@ -893,7 +896,7 @@ def _create_plugin(pluginname, libname, type, requires): gui_reqs.append("vulkan-loader::vulkan-loader") if tools.is_apple_os(self.settings.os): gui_reqs.append("moltenvk::moltenvk") - if self.options.with_harfbuzz: + if self.options.with_harfbuzz is True: gui_reqs.append("harfbuzz::harfbuzz") if self.options.with_libjpeg == "libjpeg-turbo": gui_reqs.append("libjpeg-turbo::libjpeg-turbo") @@ -924,7 +927,7 @@ def _create_plugin(pluginname, libname, type, requires): _create_module("XcbQpaPrivate", ["xkbcommon::libxkbcommon-x11", "xorg::xorg"]) _create_plugin("QXcbIntegrationPlugin", "qxcb", "platforms", ["Core", "Gui", "XcbQpaPrivate"]) - if self.options.with_sqlite3: + if self.options.with_sqlite3 is True: _create_plugin("QSQLiteDriverPlugin", "qsqlite", "sqldrivers", ["sqlite3::sqlite3"]) if self.options.with_pq: _create_plugin("QPSQLDriverPlugin", "qsqlpsql", "sqldrivers", ["libpq::libpq"]) From 3d249b32fa92f2065e0a96df2006f5a82fccdbf8 Mon Sep 17 00:00:00 2001 From: Viktor Arvidsson Date: Thu, 3 Feb 2022 23:57:00 +0100 Subject: [PATCH 2/8] Qt6: Added option to disable arbitrary qt features. Like the "config" option did for Qt5. --- recipes/qt/6.x.x/conanfile.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/recipes/qt/6.x.x/conanfile.py b/recipes/qt/6.x.x/conanfile.py index 8aeb7eea99832..964ef91261076 100644 --- a/recipes/qt/6.x.x/conanfile.py +++ b/recipes/qt/6.x.x/conanfile.py @@ -91,6 +91,7 @@ class QtConan(ConanFile): "cross_compile": "ANY", "sysroot": "ANY", "multiconfiguration": [True, False], + "disabled_features": "ANY", } options.update({module: [True, False] for module in _submodules}) @@ -130,6 +131,7 @@ class QtConan(ConanFile): "cross_compile": None, "sysroot": None, "multiconfiguration": False, + "disabled_features": "", } default_options.update({module: False for module in _submodules}) @@ -592,6 +594,9 @@ def _configure_cmake(self): self._cmake.definitions["FEATURE_%s" % conf_arg] = "OFF" self._cmake.definitions["FEATURE_system_%s" % feature] = "OFF" + for feature in str(self.options.disabled_features).split(" "): + self._cmake.definitions["FEATURE_%s" % feature] = "OFF" + if self.settings.os == "Macos": self._cmake.definitions["FEATURE_framework"] = "OFF" elif self.settings.os == "Android": From 8e6d59c96d31e63d7b0c2f5ced1dc0afd22a0779 Mon Sep 17 00:00:00 2001 From: Viktor Arvidsson Date: Thu, 3 Feb 2022 23:57:23 +0100 Subject: [PATCH 3/8] Qt6: Expose WidgetsPrivate target. --- recipes/qt/6.x.x/conanfile.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/recipes/qt/6.x.x/conanfile.py b/recipes/qt/6.x.x/conanfile.py index 964ef91261076..b045902d5de15 100644 --- a/recipes/qt/6.x.x/conanfile.py +++ b/recipes/qt/6.x.x/conanfile.py @@ -787,6 +787,9 @@ def _create_private_module(module, dependencies=[]): if self.options.gui: _create_private_module("Gui", ["CorePrivate", "Gui"]) + if self.options.widgets: + _create_private_module("Widgets", ["CorePrivate", "GuiPrivate", "Widgets"]) + if self.options.qtdeclarative: _create_private_module("Qml", ["CorePrivate", "Qml"]) @@ -909,6 +912,9 @@ def _create_plugin(pluginname, libname, type, requires): gui_reqs.append("libjpeg::libjpeg") _create_module("Gui", gui_reqs) + self.cpp_info.components["qtGui"].build_modules["cmake_find_package"].append(self._cmake_qt6_private_file("Gui")) + self.cpp_info.components["qtGui"].build_modules["cmake_find_package_multi"].append(self._cmake_qt6_private_file("Gui")) + if self.settings.os == "Windows": _create_plugin("QWindowsIntegrationPlugin", "qwindows", "platforms", ["Core", "Gui"]) self.cpp_info.components["qtQWindowsIntegrationPlugin"].system_libs = ["advapi32", "dwmapi", "gdi32", "imm32", @@ -949,6 +955,8 @@ def _create_plugin(pluginname, libname, type, requires): _create_module("Test") if self.options.widgets: _create_module("Widgets", ["Gui"]) + self.cpp_info.components["qtWidgets"].build_modules["cmake_find_package"].append(self._cmake_qt6_private_file("Widgets")) + self.cpp_info.components["qtWidgets"].build_modules["cmake_find_package_multi"].append(self._cmake_qt6_private_file("Widgets")) if self.options.gui and self.options.widgets: _create_module("PrintSupport", ["Gui", "Widgets"]) if self.options.get_safe("opengl", "no") != "no" and self.options.gui: @@ -1215,9 +1223,6 @@ def _create_plugin(pluginname, libname, type, requires): self.cpp_info.components["qtCore"].build_modules["cmake_find_package"].append(self._cmake_entry_point_file) self.cpp_info.components["qtCore"].build_modules["cmake_find_package_multi"].append(self._cmake_entry_point_file) - self.cpp_info.components["qtGui"].build_modules["cmake_find_package"].append(self._cmake_qt6_private_file("Gui")) - self.cpp_info.components["qtGui"].build_modules["cmake_find_package_multi"].append(self._cmake_qt6_private_file("Gui")) - for m in os.listdir(os.path.join("lib", "cmake")): module = os.path.join("lib", "cmake", m, "%sMacros.cmake" % m) component_name = m.replace("Qt6", "qt") From a72f2f0a76611498478de5b2b133c36e88f7a919 Mon Sep 17 00:00:00 2001 From: Viktor Arvidsson Date: Fri, 4 Feb 2022 17:54:58 +0100 Subject: [PATCH 4/8] Qt6: When building bundled dependencies make sure to tell conan about it. --- recipes/qt/6.x.x/conanfile.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/recipes/qt/6.x.x/conanfile.py b/recipes/qt/6.x.x/conanfile.py index b045902d5de15..89a7b915bb05b 100644 --- a/recipes/qt/6.x.x/conanfile.py +++ b/recipes/qt/6.x.x/conanfile.py @@ -57,6 +57,7 @@ class QtConan(ConanFile): homepage = "https://www.qt.io" license = "LGPL-3.0" settings = "os", "arch", "compiler", "build_type" + provides = [] options = { "shared": [True, False], @@ -232,6 +233,16 @@ def _enablemodule(mod): if self.options.get_safe(module): _enablemodule(module) + for opt, dep in [("with_doubleconversion", "double-conversion"), + ("with_freetype", "freetype"), + ("with_harfbuzz", "harfbuzz"), + ("with_libjpeg", "libjpeg"), + ("with_libpng", "libpng"), + ("with_sqlite3", "sqlite3"), + ("with_pcre2", "pcre2")]: + if self.options.get_safe(opt, False) == "qt": + self.provides.append(dep) + def validate(self): # C++ minimum standard required if self.settings.compiler.get_safe("cppstd"): From 221bc3a88769b36fe791c6dd09bea06857863368 Mon Sep 17 00:00:00 2001 From: Cyriuz Date: Sat, 5 Feb 2022 01:12:12 +0100 Subject: [PATCH 5/8] Qt6: Create QSQLiteDriverPlugin even if the bundled sqlite is used Co-authored-by: ericLemanissier --- recipes/qt/6.x.x/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/qt/6.x.x/conanfile.py b/recipes/qt/6.x.x/conanfile.py index 89a7b915bb05b..beb51f85579e3 100644 --- a/recipes/qt/6.x.x/conanfile.py +++ b/recipes/qt/6.x.x/conanfile.py @@ -949,8 +949,8 @@ def _create_plugin(pluginname, libname, type, requires): _create_module("XcbQpaPrivate", ["xkbcommon::libxkbcommon-x11", "xorg::xorg"]) _create_plugin("QXcbIntegrationPlugin", "qxcb", "platforms", ["Core", "Gui", "XcbQpaPrivate"]) - if self.options.with_sqlite3 is True: - _create_plugin("QSQLiteDriverPlugin", "qsqlite", "sqldrivers", ["sqlite3::sqlite3"]) + if self.options.with_sqlite3: + _create_plugin("QSQLiteDriverPlugin", "qsqlite", "sqldrivers", ["sqlite3::sqlite3"] if self.options.with_sqlite3 is True else []) if self.options.with_pq: _create_plugin("QPSQLDriverPlugin", "qsqlpsql", "sqldrivers", ["libpq::libpq"]) if self.options.with_odbc: From b3838fbf98a8ef4c2094276c17c17b3d865e06d4 Mon Sep 17 00:00:00 2001 From: Viktor Arvidsson Date: Tue, 8 Feb 2022 10:07:33 +0100 Subject: [PATCH 6/8] Qt6: Removed strawberryperl haxx in favor of fixing its package instead Also cleaned up the bundled dependencies check as it was a bit fragile to have to check for bool values. --- recipes/qt/6.x.x/conanfile.py | 40 ++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/recipes/qt/6.x.x/conanfile.py b/recipes/qt/6.x.x/conanfile.py index beb51f85579e3..dc0cded3b64d4 100644 --- a/recipes/qt/6.x.x/conanfile.py +++ b/recipes/qt/6.x.x/conanfile.py @@ -167,6 +167,10 @@ def _get_module_tree(self): return self._submodules_tree + def _with_system_dependency(self, dep): + option = self.options.get_safe(dep, False) + return option and option != "qt" + def export_sources(self): for patch in self.conan_data.get("patches", {}).get(self.version, []): self.copy(patch["patch_file"]) @@ -241,7 +245,7 @@ def _enablemodule(mod): ("with_sqlite3", "sqlite3"), ("with_pcre2", "pcre2")]: if self.options.get_safe(opt, False) == "qt": - self.provides.append(dep) + self.provides.append(dep) def validate(self): # C++ minimum standard required @@ -272,7 +276,7 @@ def validate(self): if self.settings.os != "Windows" and self.options.get_safe("opengl", "no") == "dynamic": raise ConanInvalidConfiguration("Dynamic OpenGL is supported only on Windows.") - if self.options.get_safe("with_fontconfig", False) and not self.options.get_safe("with_freetype", False) is True: + if self.options.get_safe("with_fontconfig", False) and not self._with_system_dependency("with_freetype", False): raise ConanInvalidConfiguration("with_fontconfig cannot be enabled if with_freetype is disabled.") if "MT" in self.settings.get_safe("compiler.runtime", default="") and self.options.shared: @@ -286,7 +290,7 @@ def requirements(self): self.requires("zlib/1.2.11") if self.options.openssl: self.requires("openssl/1.1.1m") - if self.options.with_pcre2 is True: + if self._with_system_dependency("with_pcre2"): self.requires("pcre2/10.37") if self.options.get_safe("with_vulkan"): self.requires("vulkan-loader/1.2.182") @@ -294,24 +298,24 @@ def requirements(self): self.requires("moltenvk/1.1.4") if self.options.with_glib: self.requires("glib/2.70.1") - if self.options.with_doubleconversion is True and not self.options.multiconfiguration: + if self._with_system_dependency("with_doubleconversion") and not self.options.multiconfiguration: self.requires("double-conversion/3.1.7") - if self.options.get_safe("with_freetype", False) is True and not self.options.multiconfiguration: + if self._with_system_dependency("with_freetype") and not self.options.multiconfiguration: self.requires("freetype/2.11.0") if self.options.get_safe("with_fontconfig", False): self.requires("fontconfig/2.13.93") if self.options.get_safe("with_icu", False): self.requires("icu/70.1") - if self.options.get_safe("with_harfbuzz", False) is True and not self.options.multiconfiguration: + if self._with_system_dependency("with_harfbuzz") and not self.options.multiconfiguration: self.requires("harfbuzz/3.2.0") if self.options.get_safe("with_libjpeg", False) and not self.options.multiconfiguration: if self.options.with_libjpeg == "libjpeg-turbo": self.requires("libjpeg-turbo/2.1.2") elif self.options.with_libjpeg == "libjpeg": self.requires("libjpeg/9d") - if self.options.get_safe("with_libpng", False) is True and not self.options.multiconfiguration: + if self._with_system_dependency("with_libpng") and not self.options.multiconfiguration: self.requires("libpng/1.6.37") - if self.options.with_sqlite3 is True and not self.options.multiconfiguration: + if self._with_system_dependency("with_sqlite3") and not self.options.multiconfiguration: self.requires("sqlite3/3.37.2") self.options["sqlite3"].enable_column_metadata = True if self.options.get_safe("with_mysql", False): @@ -415,9 +419,7 @@ def source(self): tools.replace_in_file(os.path.join("qt6", "CMakeLists.txt"), "enable_testing()", - "include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)\n" - "list(REMOVE_ITEM CONAN_INCLUDE_DIRS \"${CONAN_INCLUDE_DIRS_STRAWBERRYPERL}\")\n" # strawberryperl exports includes for jpg, png and many other dependencies that might interfere with the build - "conan_basic_setup(KEEP_RPATHS)\n" + "include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)\nconan_basic_setup(KEEP_RPATHS)\n" "set(QT_EXTRA_INCLUDEPATHS ${CONAN_INCLUDE_DIRS})\n" "set(QT_EXTRA_DEFINES ${CONAN_DEFINES})\n" "set(QT_EXTRA_LIBDIRS ${CONAN_LIB_DIRS})\n" @@ -594,8 +596,8 @@ def _configure_cmake(self): ("with_libjpeg", "jpeg", "jpeg"), ("with_libpng", "png", "png"), ("with_sqlite3", "sqlite", "sql_sqlite"), - ("with_pcre2", "pcre2", "pcre2"),]: - if self.options.get_safe(opt, False) is not False: + ("with_pcre2", "pcre2", "pcre2")]: + if self.options.get_safe(opt, False): self._cmake.definitions["FEATURE_%s" % conf_arg] = "ON" if self.options.multiconfiguration or self.options.get_safe(opt, False) == "qt": self._cmake.definitions["FEATURE_system_%s" % feature] = "OFF" @@ -875,9 +877,9 @@ def _create_plugin(pluginname, libname, type, requires): self.cpp_info.components[componentname].requires = _get_corrected_reqs(requires) core_reqs = ["zlib::zlib"] - if self.options.with_pcre2 is True: + if self._with_system_dependency("with_pcre2"): core_reqs.append("pcre2::pcre2") - if self.options.with_doubleconversion is True: + if self._with_system_dependency("with_doubleconversion"): core_reqs.append("double-conversion::double-conversion") if self.options.get_safe("with_icu", False): core_reqs.append("icu::icu") @@ -899,9 +901,9 @@ def _create_plugin(pluginname, libname, type, requires): gui_reqs = [] if self.options.with_dbus: gui_reqs.append("DBus") - if self.options.with_freetype is True: + if self._with_system_dependency("with_freetype"): gui_reqs.append("freetype::freetype") - if self.options.with_libpng is True: + if self._with_system_dependency("with_libpng"): gui_reqs.append("libpng::libpng") if self.options.get_safe("with_fontconfig", False): gui_reqs.append("fontconfig::fontconfig") @@ -915,7 +917,7 @@ def _create_plugin(pluginname, libname, type, requires): gui_reqs.append("vulkan-loader::vulkan-loader") if tools.is_apple_os(self.settings.os): gui_reqs.append("moltenvk::moltenvk") - if self.options.with_harfbuzz is True: + if self._with_system_dependency("with_harfbuzz"): gui_reqs.append("harfbuzz::harfbuzz") if self.options.with_libjpeg == "libjpeg-turbo": gui_reqs.append("libjpeg-turbo::libjpeg-turbo") @@ -950,7 +952,7 @@ def _create_plugin(pluginname, libname, type, requires): _create_plugin("QXcbIntegrationPlugin", "qxcb", "platforms", ["Core", "Gui", "XcbQpaPrivate"]) if self.options.with_sqlite3: - _create_plugin("QSQLiteDriverPlugin", "qsqlite", "sqldrivers", ["sqlite3::sqlite3"] if self.options.with_sqlite3 is True else []) + _create_plugin("QSQLiteDriverPlugin", "qsqlite", "sqldrivers", ["sqlite3::sqlite3"] if self._with_system_dependency("with_sqlite3") else []) if self.options.with_pq: _create_plugin("QPSQLDriverPlugin", "qsqlpsql", "sqldrivers", ["libpq::libpq"]) if self.options.with_odbc: From f899f47eef920b092c9b600f99b3aa43ea55325e Mon Sep 17 00:00:00 2001 From: Viktor Arvidsson Date: Tue, 8 Feb 2022 13:33:01 +0100 Subject: [PATCH 7/8] Qt6: Missed removing argument in the previous change. --- recipes/qt/6.x.x/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/qt/6.x.x/conanfile.py b/recipes/qt/6.x.x/conanfile.py index dc0cded3b64d4..d28bbf7d071b7 100644 --- a/recipes/qt/6.x.x/conanfile.py +++ b/recipes/qt/6.x.x/conanfile.py @@ -276,7 +276,7 @@ def validate(self): if self.settings.os != "Windows" and self.options.get_safe("opengl", "no") == "dynamic": raise ConanInvalidConfiguration("Dynamic OpenGL is supported only on Windows.") - if self.options.get_safe("with_fontconfig", False) and not self._with_system_dependency("with_freetype", False): + if self.options.get_safe("with_fontconfig", False) and not self._with_system_dependency("with_freetype"): raise ConanInvalidConfiguration("with_fontconfig cannot be enabled if with_freetype is disabled.") if "MT" in self.settings.get_safe("compiler.runtime", default="") and self.options.shared: From 3652581b3bc38a3698b2667ab9c7e9e67a23eff2 Mon Sep 17 00:00:00 2001 From: Viktor Arvidsson Date: Tue, 8 Feb 2022 13:44:07 +0100 Subject: [PATCH 8/8] Qt6: Call the non bundled dependencies conan instead of system --- recipes/qt/6.x.x/conanfile.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/recipes/qt/6.x.x/conanfile.py b/recipes/qt/6.x.x/conanfile.py index d28bbf7d071b7..e17eccc789f67 100644 --- a/recipes/qt/6.x.x/conanfile.py +++ b/recipes/qt/6.x.x/conanfile.py @@ -167,7 +167,7 @@ def _get_module_tree(self): return self._submodules_tree - def _with_system_dependency(self, dep): + def _with_conan_dependency(self, dep): option = self.options.get_safe(dep, False) return option and option != "qt" @@ -276,7 +276,7 @@ def validate(self): if self.settings.os != "Windows" and self.options.get_safe("opengl", "no") == "dynamic": raise ConanInvalidConfiguration("Dynamic OpenGL is supported only on Windows.") - if self.options.get_safe("with_fontconfig", False) and not self._with_system_dependency("with_freetype"): + if self.options.get_safe("with_fontconfig", False) and not self._with_conan_dependency("with_freetype"): raise ConanInvalidConfiguration("with_fontconfig cannot be enabled if with_freetype is disabled.") if "MT" in self.settings.get_safe("compiler.runtime", default="") and self.options.shared: @@ -290,7 +290,7 @@ def requirements(self): self.requires("zlib/1.2.11") if self.options.openssl: self.requires("openssl/1.1.1m") - if self._with_system_dependency("with_pcre2"): + if self._with_conan_dependency("with_pcre2"): self.requires("pcre2/10.37") if self.options.get_safe("with_vulkan"): self.requires("vulkan-loader/1.2.182") @@ -298,24 +298,24 @@ def requirements(self): self.requires("moltenvk/1.1.4") if self.options.with_glib: self.requires("glib/2.70.1") - if self._with_system_dependency("with_doubleconversion") and not self.options.multiconfiguration: + if self._with_conan_dependency("with_doubleconversion") and not self.options.multiconfiguration: self.requires("double-conversion/3.1.7") - if self._with_system_dependency("with_freetype") and not self.options.multiconfiguration: + if self._with_conan_dependency("with_freetype") and not self.options.multiconfiguration: self.requires("freetype/2.11.0") if self.options.get_safe("with_fontconfig", False): self.requires("fontconfig/2.13.93") if self.options.get_safe("with_icu", False): self.requires("icu/70.1") - if self._with_system_dependency("with_harfbuzz") and not self.options.multiconfiguration: + if self._with_conan_dependency("with_harfbuzz") and not self.options.multiconfiguration: self.requires("harfbuzz/3.2.0") if self.options.get_safe("with_libjpeg", False) and not self.options.multiconfiguration: if self.options.with_libjpeg == "libjpeg-turbo": self.requires("libjpeg-turbo/2.1.2") elif self.options.with_libjpeg == "libjpeg": self.requires("libjpeg/9d") - if self._with_system_dependency("with_libpng") and not self.options.multiconfiguration: + if self._with_conan_dependency("with_libpng") and not self.options.multiconfiguration: self.requires("libpng/1.6.37") - if self._with_system_dependency("with_sqlite3") and not self.options.multiconfiguration: + if self._with_conan_dependency("with_sqlite3") and not self.options.multiconfiguration: self.requires("sqlite3/3.37.2") self.options["sqlite3"].enable_column_metadata = True if self.options.get_safe("with_mysql", False): @@ -877,9 +877,9 @@ def _create_plugin(pluginname, libname, type, requires): self.cpp_info.components[componentname].requires = _get_corrected_reqs(requires) core_reqs = ["zlib::zlib"] - if self._with_system_dependency("with_pcre2"): + if self._with_conan_dependency("with_pcre2"): core_reqs.append("pcre2::pcre2") - if self._with_system_dependency("with_doubleconversion"): + if self._with_conan_dependency("with_doubleconversion"): core_reqs.append("double-conversion::double-conversion") if self.options.get_safe("with_icu", False): core_reqs.append("icu::icu") @@ -901,9 +901,9 @@ def _create_plugin(pluginname, libname, type, requires): gui_reqs = [] if self.options.with_dbus: gui_reqs.append("DBus") - if self._with_system_dependency("with_freetype"): + if self._with_conan_dependency("with_freetype"): gui_reqs.append("freetype::freetype") - if self._with_system_dependency("with_libpng"): + if self._with_conan_dependency("with_libpng"): gui_reqs.append("libpng::libpng") if self.options.get_safe("with_fontconfig", False): gui_reqs.append("fontconfig::fontconfig") @@ -917,7 +917,7 @@ def _create_plugin(pluginname, libname, type, requires): gui_reqs.append("vulkan-loader::vulkan-loader") if tools.is_apple_os(self.settings.os): gui_reqs.append("moltenvk::moltenvk") - if self._with_system_dependency("with_harfbuzz"): + if self._with_conan_dependency("with_harfbuzz"): gui_reqs.append("harfbuzz::harfbuzz") if self.options.with_libjpeg == "libjpeg-turbo": gui_reqs.append("libjpeg-turbo::libjpeg-turbo") @@ -952,7 +952,7 @@ def _create_plugin(pluginname, libname, type, requires): _create_plugin("QXcbIntegrationPlugin", "qxcb", "platforms", ["Core", "Gui", "XcbQpaPrivate"]) if self.options.with_sqlite3: - _create_plugin("QSQLiteDriverPlugin", "qsqlite", "sqldrivers", ["sqlite3::sqlite3"] if self._with_system_dependency("with_sqlite3") else []) + _create_plugin("QSQLiteDriverPlugin", "qsqlite", "sqldrivers", ["sqlite3::sqlite3"] if self._with_conan_dependency("with_sqlite3") else []) if self.options.with_pq: _create_plugin("QPSQLDriverPlugin", "qsqlpsql", "sqldrivers", ["libpq::libpq"]) if self.options.with_odbc: