aboutsummaryrefslogtreecommitdiffstats
path: root/build_scripts/qtinfo.py
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-06-15 10:25:25 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2021-06-17 06:56:48 +0200
commit8e731da36ee8616f2da005f19c7a6c8c02665118 (patch)
treee55f2d21495816db6403e30fc3f8ff2e40032745 /build_scripts/qtinfo.py
parent099d6c09f704a6f8ace929e5522c5fd655e14215 (diff)
Introduce qtpaths as qmake replacement
qtpaths has become the recommended tool for querying Qt properties (see qtbase/fef850c51a069ed89ba400e6ffccbbea4b0cbb9f). Deprecate the --qmake option in favor of it and use qtpaths for the values. qmake is only used if a path is given on the command line. [ChangeLog][PySide6] qtpaths is now used to query Qt properties. Task-number: QTBUG-75870 Change-Id: I9a29b05d8b6e982647eeeeeda0134ddc807da141 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'build_scripts/qtinfo.py')
-rw-r--r--build_scripts/qtinfo.py29
1 files changed, 26 insertions, 3 deletions
diff --git a/build_scripts/qtinfo.py b/build_scripts/qtinfo.py
index 61483a83c..024ab0c16 100644
--- a/build_scripts/qtinfo.py
+++ b/build_scripts/qtinfo.py
@@ -79,14 +79,18 @@ class QtInfo(object):
class __QtInfo: # Python singleton
def __init__(self):
+ self._qtpaths_command = None
self._cmake_command = None
self._qmake_command = None
+ self._force_qmake = False
# Dict to cache qmake values.
self._query_dict = {}
- def setup(self, cmake, qmake):
+ def setup(self, qtpaths, cmake, qmake, force_qmake):
+ self._qtpaths_command = qtpaths
self._cmake_command = cmake
self._qmake_command = qmake
+ self._force_qmake = force_qmake
@property
def qmake_command(self):
@@ -164,6 +168,19 @@ class QtInfo(object):
return None
return self._query_dict[prop_name]
+ def _get_qtpaths_output(self, args_list=[], cwd=None):
+ assert self._qtpaths_command
+ cmd = [self._qtpaths_command]
+ cmd.extend(args_list)
+ proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=False,
+ cwd=cwd, universal_newlines=True)
+ output, error = proc.communicate()
+ proc.wait()
+ if proc.returncode != 0:
+ raise RuntimeError(f"Could not run {self._qtpaths_command}: {error}")
+ return output
+
+ # FIXME PYSIDE7: Remove qmake handling
def _get_qmake_output(self, args_list=[], cwd=None):
assert self._qmake_command
cmd = [self._qmake_command]
@@ -189,14 +206,20 @@ class QtInfo(object):
return props
def _get_query_properties(self):
- output = self._get_qmake_output(["-query"])
+ if self._force_qmake:
+ output = self._get_qmake_output(["-query"])
+ else:
+ output = self._get_qtpaths_output(["--qt-query"])
self._query_dict = self._parse_query_properties(output)
def _get_other_properties(self):
# Get the src property separately, because it is not returned by
# qmake unless explicitly specified.
key = "QT_INSTALL_PREFIX/src"
- result = self._get_qmake_output(["-query", key])
+ if self._force_qmake:
+ result = self._get_qmake_output(["-query", key])
+ else:
+ result = self._get_qtpaths_output(["--qt-query", key])
self._query_dict[key] = result
# Get mkspecs variables and cache them.