Skip to content

Commit

Permalink
(#17925) [qt/6.x.x] Fix conan toolchain
Browse files Browse the repository at this point in the history
* [qt/6.5.1] Add version

* [qt/6.x.x] Add qt_add_qml_module to test_package

* Add conan_qt_qt6_policies.cmake to Qt6Qml cmake package

* Add qtdeclarative to default component

* Revert "Add qtdeclarative to default component"

This reverts commit a7fc4b3.

* Revert "[qt/6.x.x] Add qt_add_qml_module to test_package"

This reverts commit 55d7fb1.

* Set QT6_IS_SHARED_LIBS_BUILD

* Put conan_qt_qt6_variables in Qt6Core instead of Qt6Qml

* Add macdeployqt target

* Append Qt6CoreConfigExtras.cmake to build_modules_list instead of creating conan_qt_qt6_variables.cmake

* Remove merge conflict markers from conandata.yml

* Fix linter warnings
  • Loading branch information
MartinDelille authored Oct 30, 2023
1 parent f13df22 commit c5b1ea6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
16 changes: 13 additions & 3 deletions recipes/qt/6.x.x/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def _enablemodule(mod):
for module in self._get_module_tree:
if getattr(self.options, module):
_enablemodule(module)

# disable all modules which are:
# - not explicitely enabled by the consumer and
# - not required by a module explicitely enabled by the consumer
Expand Down Expand Up @@ -806,10 +806,12 @@ def package(self):
targets.append("qvkgen")
if self.options.widgets:
targets.append("uic")
if self._settings_build.os == "Macos" and self.settings.os != "iOS":
targets.extend(["macdeployqt"])
if self.settings.os == "Windows":
targets.extend(["windeployqt"])
if self.options.qttools:
targets.extend(["qhelpgenerator", "qtattributionsscanner"])
if self.settings.os == "Windows":
targets.extend(["windeployqt"])
targets.extend(["lconvert", "lprodump", "lrelease", "lrelease-pro", "lupdate", "lupdate-pro"])
if self.options.qtshadertools:
targets.append("qsb")
Expand Down Expand Up @@ -874,6 +876,9 @@ def _create_private_module(module, dependencies):

if self.options.qtdeclarative:
_create_private_module("Qml", ["CorePrivate", "Qml"])
save(self, os.path.join(self.package_folder, "lib", "cmake", "Qt6Qml", "conan_qt_qt6_policies.cmake"), textwrap.dedent("""\
set(QT_KNOWN_POLICY_QTP0001 TRUE)
"""))

if self.settings.os in ["Windows", "iOS"]:
contents = textwrap.dedent("""\
Expand Down Expand Up @@ -1376,6 +1381,9 @@ def _create_plugin(pluginname, libname, plugintype, requires):

build_modules_list = []

if self.options.qtdeclarative:
build_modules_list.append(os.path.join(self.package_folder, "lib", "cmake", "Qt6Qml", "conan_qt_qt6_policies.cmake"))

def _add_build_modules_for_component(component):
for req in self.cpp_info.components[component].requires:
if "::" in req: # not a qt component
Expand All @@ -1386,4 +1394,6 @@ def _add_build_modules_for_component(component):
for c in self.cpp_info.components:
_add_build_modules_for_component(c)

build_modules_list.append(os.path.join(self.package_folder, "lib", "cmake", "Qt6Core", "Qt6CoreConfigExtras.cmake"))

self.cpp_info.set_property("cmake_build_modules", build_modules_list)
1 change: 0 additions & 1 deletion recipes/qt/6.x.x/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import textwrap

from conan import ConanFile
from conan.tools.build import can_run
Expand Down

0 comments on commit c5b1ea6

Please sign in to comment.