diff options
author | Iikka Eklund <iikka.eklund@qt.io> | 2021-06-24 09:05:24 +0300 |
---|---|---|
committer | Iikka Eklund <iikka.eklund@qt.io> | 2021-06-28 10:10:04 +0300 |
commit | e34a5435fc8fcb4732f0c1b73ae2a7d553de9ed2 (patch) | |
tree | 6c3cebc7c2d702ca3d0a1bea09cfaea93f069366 /conanfile.py | |
parent | 42779e2d8fffc918e66c0290eaecef1b7cd4a126 (diff) |
Conan: Split version string interpolation into separate function
Make the readibility and syntax highlighting a bit cleaner.
Pick-to: 6.2
Change-Id: I46f0eed30124e1155b746c2e9c9e2c272a5a3d59
Reviewed-by: Toni Saario <toni.saario@qt.io>
Diffstat (limited to 'conanfile.py')
-rw-r--r-- | conanfile.py | 6 |
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} |