diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-09-27 17:02:11 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-10-27 16:36:49 +0000 |
commit | b02e70ca9aebced0a76cc36e9071cb73281afa63 (patch) | |
tree | 86614a880493306768a5401befa444494514935b /build_scripts | |
parent | 85bf9171e14d29ebeee1be312d44ef11ba52cf4c (diff) |
setup.py: Fix QT_SRC_DIR to only be set if a path is set and it exists
Fixes an issue when using a Qt that was not installed by the Qt
online installer and thus doesn't have a Src subfolder.
Change-Id: Ide633e265a1768f88b39ab0b6b7306f1b890d087
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit baad76306056ce4a55976508f1c2adb357421c0a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'build_scripts')
-rw-r--r-- | build_scripts/main.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/build_scripts/main.py b/build_scripts/main.py index 7239d328e..887e8e293 100644 --- a/build_scripts/main.py +++ b/build_scripts/main.py @@ -329,7 +329,9 @@ def prepare_build(): if install_prefix.endswith("qtbase"): qt_src_dir = install_prefix else: # SDK: Use 'Src' directory - qt_src_dir = os.path.join(os.path.dirname(install_prefix), 'Src', 'qtbase') + maybe_qt_src_dir = os.path.join(os.path.dirname(install_prefix), 'Src', 'qtbase') + if os.path.exists(maybe_qt_src_dir): + qt_src_dir = maybe_qt_src_dir class PysideInstall(_install, DistUtilsCommandMixin): @@ -760,7 +762,8 @@ class PysideBuild(_build, DistUtilsCommandMixin): cmake_cmd.append(f"-DSKIP_MODULES={skip_modules}") # Add source location for generating documentation cmake_src_dir = OPTION["QT_SRC"] if OPTION["QT_SRC"] else qt_src_dir - cmake_cmd.append(f"-DQT_SRC_DIR={cmake_src_dir}") + if cmake_src_dir: + cmake_cmd.append(f"-DQT_SRC_DIR={cmake_src_dir}") if OPTION['NO_QT_TOOLS']: cmake_cmd.append("-DNO_QT_TOOLS=yes") if OPTION['SKIP_DOCS']: |