diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-06-15 10:25:25 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-06-17 06:56:48 +0200 |
commit | 8e731da36ee8616f2da005f19c7a6c8c02665118 (patch) | |
tree | e55f2d21495816db6403e30fc3f8ff2e40032745 /build_scripts/options.py | |
parent | 099d6c09f704a6f8ace929e5522c5fd655e14215 (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/options.py')
-rw-r--r-- | build_scripts/options.py | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/build_scripts/options.py b/build_scripts/options.py index 1e32d5e92..58673c1ea 100644 --- a/build_scripts/options.py +++ b/build_scripts/options.py @@ -206,7 +206,8 @@ class DistUtilsCommandMixin(object): ('sanitize-address', None, 'Build with address sanitizer'), ('shorter-paths', None, 'Use shorter paths'), ('doc-build-online', None, 'Build online documentation'), - ('qmake=', None, 'Path to qmake'), + ('qtpaths=', None, 'Path to qtpaths'), + ('qmake=', None, 'Path to qmake (deprecated, use qtpaths)'), ('qt=', None, 'Qt version'), ('cmake=', None, 'Path to CMake'), ('openssl=', None, 'Path to OpenSSL libraries'), @@ -245,7 +246,9 @@ class DistUtilsCommandMixin(object): self.snapshot_build = False self.shorter_paths = False self.doc_build_online = False + self.qtpaths = None self.qmake = None + self.has_qmake_option = False self.qt = '5' self.cmake = None self.openssl = None @@ -294,11 +297,18 @@ class DistUtilsCommandMixin(object): OPTION['SANITIZE_ADDRESS'] = self.sanitize_address OPTION['SHORTER_PATHS'] = self.shorter_paths OPTION['DOC_BUILD_ONLINE'] = self.doc_build_online + + qtpaths_abs_path = os.path.abspath(self.qtpaths) + OPTION['QTPATHS'] = qtpaths_abs_path + # FIXME PYSIDE7: Remove qmake handling # make qtinfo.py independent of relative paths. qmake_abs_path = os.path.abspath(self.qmake) OPTION['QMAKE'] = qmake_abs_path + OPTION['HAS_QMAKE_OPTION'] = self.has_qmake_option OPTION['QT_VERSION'] = self.qt - QtInfo().setup(self.cmake, qmake_abs_path) + QtInfo().setup(qtpaths_abs_path, self.cmake, qmake_abs_path, + self.has_qmake_option) + OPTION['CMAKE'] = os.path.abspath(self.cmake) OPTION['OPENSSL'] = self.openssl OPTION['SHIBOKEN_CONFIG_DIR'] = self.shiboken_config_dir @@ -324,7 +334,18 @@ class DistUtilsCommandMixin(object): log.error(f"'{self.cmake}' does not exist.") return False - if not self.qmake: + if not self.qtpaths: + self.qtpaths = find_executable("qtpaths") + if not self.qtpaths: + log.error("qtpaths could not be found.") + return False + if not os.path.exists(self.qtpaths): + log.error(f"'{self.qtpaths}' does not exist.") + return False + + if self.qmake: + self.has_qmake_option = True + else: self.qmake = find_executable("qmake") if not self.qmake: self.qmake = find_executable("qmake-qt5") |