aboutsummaryrefslogtreecommitdiffstats
path: root/conanfile.py
diff options
context:
space:
mode:
authorIikka Eklund <iikka.eklund@qt.io>2021-06-24 09:05:24 +0300
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-06-28 08:48:00 +0000
commit4e30cf2a712834b47a115a0a676667e9d4d28ea3 (patch)
tree1502188a3daea85076bfc8928e31a85d9339b182 /conanfile.py
parent68fa157f52bc5d4adfc9eda40d0a2ed20ef7d69f (diff)
Conan: Split version string interpolation into separate function
Make the readibility and syntax highlighting a bit cleaner. Change-Id: I46f0eed30124e1155b746c2e9c9e2c272a5a3d59 Reviewed-by: Toni Saario <toni.saario@qt.io> (cherry picked from commit e34a5435fc8fcb4732f0c1b73ae2a7d553de9ed2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'conanfile.py')
-rw-r--r--conanfile.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/conanfile.py b/conanfile.py
index 2a698d3b72..c600997ff6 100644
--- a/conanfile.py
+++ b/conanfile.py
@@ -76,6 +76,10 @@ def _parse_qt_version_by_key(key: str) -> str:
return ret.pop() if ret else ""
+def _get_qt_minor_version() -> str:
+ return _parse_qt_version_by_key('QT_REPO_MODULE_VERSION')[0:3]
+
+
class QtDeclarative(ConanFile):
name = "qtdeclarative"
license = "LGPL-3.0-only, Commercial Qt License Agreement"
@@ -91,7 +95,7 @@ class QtDeclarative(ConanFile):
exports_sources = "*", "!conan*.*"
# use commit ID as the RREV (recipe revision) if this is exported from .git repository
revision_mode = "scm" if Path(Path(__file__).parent.resolve() / ".git").exists() else "hash"
- python_requires = f"qt-conan-common/{_parse_qt_version_by_key('QT_REPO_MODULE_VERSION')[0:3]}@qt/everywhere"
+ python_requires = f"qt-conan-common/{_get_qt_minor_version()}@qt/everywhere"
options = {item.replace("-", "_"): ["yes", "no", None] for item in _qtdeclarative_features}
default_options = {item.replace("-", "_"): None for item in _qtdeclarative_features}